hakeryk2 Posted June 2, 2016 Share Posted June 2, 2016 Hello community, I have a question. In my case I would love to achieve this effect. If my product have addition shipping cost = 0 then add to current meta title "- Free shipping"! Can anyone help how to achieve this effect? Thanks in advance - I think that a lot of people would love to see this in their shops. Link to comment Share on other sites More sharing options...
shokinro Posted June 3, 2016 Share Posted June 3, 2016 You will need to override the Smarty variable "meta_title" to include text "Free Shipping" in initContent() method of product controller. /controllers/front/ProductController.php It is better to use override /override/controllers/front/ProductController.php The code will be something like this public function initContent() { parent::initContent(); // some logic here to determine if the product is a free shipping $this->context->smarty->assign(array('meta_title', $new_meta_title)); ...... Link to comment Share on other sites More sharing options...
hakeryk2 Posted June 3, 2016 Author Share Posted June 3, 2016 Thank You for You reply but I used a little bit stone and stick method I edited header.tpl and I replaced <title>{$meta_title|escape:'html':'UTF-8'} with this <title>{$meta_title|escape:'html':'UTF-8'} {if $page_name == 'product'} {if $product->additional_shipping_cost == 0.00} - Free shipping! {/if} {/if} </title> and it works Link to comment Share on other sites More sharing options...
shokinro Posted June 4, 2016 Share Posted June 4, 2016 Yes, that will work if it you only check additional_shipping_cost. But it is not real shipping fee, even additional_shipping_cost is 0, it may also have some other normal shipping fee. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now