Jump to content

 

Bart-PDX

Member Since 12 Jun 2017
Offline Last Active Oct 16 2019 09:58 AM
-----

Topics I've Started

Checkout Shipping_Rate Hook Problem

03 October 2019 - 12:15 PM

I am trying to hide "(inc tax)" from after the price of the shipping method in the checkout.

 

I have gone into templates / views / checkout / components / shipping_rates.tpl

 

I have modified the code directly in the template for the hook checkout:shipping_rate to:

{$delivery_time = ""}
                        {if $shipping.delivery_time || $shipping.service_delivery_time}
                            {$delivery_time = "(`$shipping.service_delivery_time|default:$shipping.delivery_time`)"}
                        {/if}

                        {if $shipping.rate}
                            {capture assign="rate"}{include file="common/price.tpl" value=$shipping.rate}{/capture}
                            {*if $shipping.inc_tax}
                                {$rate = "`$rate` ("}
                                {if $shipping.taxed_price && $shipping.taxed_price != $shipping.rate}
                                    {capture assign="tax"}{include file="common/price.tpl" value=$shipping.taxed_price class="ty-nowrap"}{/capture}
                                    {$rate = "`$rate``$tax` "}
                                {/if}
                                {$inc_tax_lang = __('inc_tax')}
                                {$rate = "`$rate``$inc_tax_lang`)"}
                            {/if*}
                        {elseif fn_is_lang_var_exists("free")}
                            {$rate = __("free")}
                        {else}
                            {$rate = ""}
                        {/if}

Commenting out the tax bit of the code has worked fine when i make the changes directly to the template file.

 

If however i add this same code to shipping_rate.override.tpl and upload it to design/themes/vivashop/templates/addons/my_changes/hooks/checkout the code doesn't work.

 

I can't for the life of me see what i am missing.

 

What am i doing wrong?

 

Is there maybe another way of hiding this text? If i just remove the language text 'inc_tax' i am still left with the ()...

 

Thanks