Jump to content

Change 'free' text in shipping amount in order-detail.tpl


elainelow

Recommended Posts

Not too sure where to classify this so here we go!

Currently using: PrestaShop 1.7.2.2

In my website, all carriers have been marked to have Free Shipping with no handling charge because customers will only need to pay the shipping fee to the courier when they have received their goods. However, when customers view  details of their transactions in their order history in their account, they will see 

Shipping & Handling: Free

Therefore, in order-detail.tpl, I have attempted to change {$line.shipping_cost} to {l s= "<text>"}, but it has not worked. I have also changed the translation for 'Free' from the admin panel to <text>, but it has not worked either. Any idea why? 

Screen Shot 2018-04-03 at 5.11.05 PM.png

Screen Shot 2018-04-03 at 5.08.58 PM.png

Link to comment
Share on other sites

  • 6 months later...
  • 4 months later...

\src\Adapter\Order\OrderPresenter.php

change

        $cart = new Cart($order->id_cart);
        if (!$cart->isVirtualCart()) {
            $shippingCost = $includeTaxes ? $order->total_shipping_tax_incl : $order->total_shipping_tax_excl;
            $subtotals['shipping'] = array(
                'type' => 'shipping',
                'label' => $this->translator->trans('Shipping and handling', array(), 'Shop.Theme.Checkout'),
                'amount' => $shippingCost,
                'value' => $shippingCost != 0 ? $this->priceFormatter->format($shippingCost, Currency::getCurrencyInstance((int)$order->id_currency)) : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'),
            );
        }

to

        $cart = new Cart($order->id_cart);
        if (!$cart->isVirtualCart()) 

 

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...
On 3/28/2019 at 2:34 PM, xwvth said:

\src\Adapter\Order\OrderPresenter.php

change


        $cart = new Cart($order->id_cart);
        if (!$cart->isVirtualCart()) {
            $shippingCost = $includeTaxes ? $order->total_shipping_tax_incl : $order->total_shipping_tax_excl;
            $subtotals['shipping'] = array(
                'type' => 'shipping',
                'label' => $this->translator->trans('Shipping and handling', array(), 'Shop.Theme.Checkout'),
                'amount' => $shippingCost,
                'value' => $shippingCost != 0 ? $this->priceFormatter->format($shippingCost, Currency::getCurrencyInstance((int)$order->id_currency)) : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'),
            );
        }

to


        $cart = new Cart($order->id_cart);
        if (!$cart->isVirtualCart()) 

 

In latest version of Prestashop you can find this code in file:

/src/Adapter/Presenter/OrderOrderSubtotalLazyArray.php

Link to comment
Share on other sites

  • 1 year later...

Kindly replace the below code in "themes\{Your-theme}\templates\customer\_partials\order-detail-no-return.tpl" and "themes\{Your-theme}\templates\customer\_partials\order-detail-return" 

<td>{$line.value}</td>

with

{if $line.type eq "shipping"}
       <td>{Your Text}</td>
{else}    
       <td>{$line.value}</td>
{/if}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...