Jump to content

 

Bart-PDX

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

Posts I've Made

In Topic: Checkout Shipping_Rate Hook Problem

08 October 2019 - 12:00 PM

The addon is working ok for other modified templates that i have put into my_changes. It is just this one.

 

I'll keep playing around and post back if i discover what is causing this. I'll just make the changes to the main template files for the meantime.

 

Thanks for your help


In Topic: Checkout Shipping_Rate Hook Problem

07 October 2019 - 03:40 PM

Thanks for the changes Robert, these make everything display how i'd like. I just can't get it to work using the my_changes addon.

 

I have now tried manually disabling all addons except the my_changes addon, removed the other .tpl files in my_changes and reverted to the default template.

 

Unfortunately i am still seeing the (inc tax) displayed.


In Topic: Checkout Shipping_Rate Hook Problem

07 October 2019 - 01:48 PM

If i make this change directly to the template file i get the shipping method price followed by () e.g. £3.00 ().

 

I can see where these brackets are coming from and where to remove them. {$rate = "`$rate` ("} and {$rate = "`$rate``$inc_tax_lang`)"}

 

However when i make the same change to the override file in my_changes nothing happens. This is what is puzzling me...


In Topic: Checkout Shipping_Rate Hook Problem

07 October 2019 - 01:12 PM

Thanks for this line.

 

I've just had a quick look at this. Unfortunately {$rate nofilter} returns both the price and the (inc tax) part. I am trying to stop the display of the (inc tax).

 

What does the nofilter part of the code mean? Can i change this to somthing else to return only the shipping method price?


In Topic: Checkout Shipping_Rate Hook Problem

07 October 2019 - 11:49 AM

I have deleted the cache folder and cleared the cache.

 

The hook checkout:shipping_rate is in:

templates / views / checkout / components / shipping_rates.tpl

 

The file with my changed code is:

design/themes/vivashop/templates/addons/my_changes/hooks/checkout/shipping_rate.override.tpl

 

I have added some random text into the override file to see what is being pulled so i can see that the file is being loaded but it in't displaying how i would expect.

 

The random text is being shown outside the shipping method box.

 

The test code i am using in the override is:

aaa{$delivery_time = ""}bbb
                        {if $shipping.delivery_time || $shipping.service_delivery_time}
                            {$delivery_time = "(`$shipping.service_delivery_time|default:$shipping.delivery_time`)"}
                        {/if}
ccc
                        {if $shipping.rate}ddd
                            {capture assign="rate"}{include file="common/price.tpl" value=$shipping.rate}{/capture}
                           eee {if $shipping.inc_tax}
                                {$rate = "`$rate` (11"}
                                {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 = "33`$rate``$tax` 44"}
                                {/if}
                                {$inc_tax_lang = __('inc_tax')}
                                {$rate = "`$rate``$inc_tax_lang`22)"}
                            222{/if}eee
                        {elseif fn_is_lang_var_exists("free")}
                            {$rate = __("free")}fff
                        {else}
                            {$rate = ""}ggg
                        {/if}hhh

and displays as in this image:

sm-error.PNG

 

At least i can see it is seeing the file ok but i'm sure some of these bits should be in the shipping method boxes.