Setting shipping details in CS cart checkout page

I have an issue that I am trying to figure out. There are some conditions that are set by the wholesaler to apply to certain categories of products during shipping.

I am using a CSV file with freight cost to import these products and since there aren’t any ways to apply shipping conditions and costs to a particular category, I have added the conditions to freight cost and have modified the file itself.

The issue is on the checkout page. The shipping costs are displayed accordingly, but is there a way to separate the freight cost and the shipping method cost and show the information on the condition in detail?

In the checkout page, it shows the shipping cost, but no additional information on it. Like in this example, the freight cost was $6.99 and the shipping method cost was $6. Is there a way to configure and show the information?

Hello!

If you need to make the changes to display shipping cost and shipping freight separately only in the Order summary block, I can offer you to make the following changes:

  1. Create the design/themes/responsive/templates/addons/my_changes/overrides/blocks/checkout/summary.tpl file with the content of the design/themes/responsive/templates/blocks/checkout/summary.tpl file file.
  2. Replace the following code:
            {if !$cart.shipping_failed
                && $cart.chosen_shipping
                && $cart.shipping_required
                && $cart.display_shipping_cost
            }
            <tr>
                <td class="ty-checkout-summary__item">{__("shipping")}</td>
                <td class="ty-checkout-summary__item ty-right" data-ct-checkout-summary="shipping">
                    <span>{include file="common/price.tpl" value=$cart.display_shipping_cost}</span>
                </td>
            </tr>
            {/if}

with this one:

            {if !$cart.shipping_failed
                && $cart.chosen_shipping
                && $cart.shipping_required
                && $cart.display_shipping_cost
            }
                {$shipping_cost = fn_calculate_shipping_freight()}
            <tr>
                <td class="ty-checkout-summary__item">{__("shipping")}</td>
                <td class="ty-checkout-summary__item ty-right" data-ct-checkout-summary="shipping">
                    <span>{include file="common/price.tpl" value=$shipping_cost.shipping_cost}</span>
                </td>
            </tr>
            <tr>
                <td class="ty-checkout-summary__item">{__("shipping_freight")}</td>
                <td class="ty-checkout-summary__item ty-right" data-ct-checkout-summary="shipping">
                    <span>{include file="common/price.tpl" value=$shipping_cost.freight}</span>
                </td>
            </tr>
            {/if}
  1. Create the file app/addons/my_changes/func.php with the following content:
<?php

defined('BOOTSTRAP') or die('Access denied');

function fn_calculate_shipping_freight()
{
    $cart = & Tygh::$app['session']['cart'];
    $freight = 0;
    foreach ($cart['product_groups'] as $group) {
        if ($group['package_info']['shipping_freight']) {
            $freight += $group['package_info']['shipping_freight'];
        }
    }
    return ['freight' => $freight, 'shipping_cost' => $cart['display_shipping_cost'] - $freight];
}
  1. Install & activate the My changes add-on.
  2. Clear the cache of your installation.

In case you require a more complex modification, I am afraid you will have to contact third party developers to achieve them.

Hope it helps.

4 Likes

Thank you so much. It works.

1 Like