zubator Posted June 15, 2013 Share Posted June 15, 2013 (sorry for my english) Hi I'm using presta 1.4 and I'd like to change logo image depending on id_supplier something like {if $product->id_supplier == 1} {else} {/if} but how I can correctly define variable product in header.tpl like in product.tpl Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 (sorry for my english) Hi I'm using presta 1.4 and I'd like to change logo image depending on id_supplier something like {if $product->id_supplier == 1} {else} {/if} but how I can correctly define variable product in header.tpl like in product.tpl hello you want to change shop logo depending on supplier id? please give us more information regards Link to comment Share on other sites More sharing options...
zubator Posted June 15, 2013 Author Share Posted June 15, 2013 Yes. You right. I have default logo with telephones in logo like here http://mototrend.org/ But when customer visit specal products, telephones must change. Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 in my opinion is better to use logo only for: remove the number from the logo etc. then you can easily add number in the header.tpl file, with {if} conditions you can display number depend on supplier id Link to comment Share on other sites More sharing options...
zubator Posted June 15, 2013 Author Share Posted June 15, 2013 No. my question is how to make conditition {if}. I don't know how to get value of $product->id_supplier. This variable does not defined in header.tpl Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 in the front controller you can define product object, then put it into smarty array: $product_object = new Product (Tools::getValue('id_product')); $this->context->smarty->assign(array('product_object'=>$product_object)); then in header.tpl you can use $product_object variable. Link to comment Share on other sites More sharing options...
zubator Posted June 15, 2013 Author Share Posted June 15, 2013 Thank you very much! Link to comment Share on other sites More sharing options...
vekia Posted June 15, 2013 Share Posted June 15, 2013 an if you use old ps (1.4) you have to use: global $smarty; $smarty->assign(array('product_object'=>$product_object)); instead the context object Link to comment Share on other sites More sharing options...
zubator Posted June 17, 2013 Author Share Posted June 17, 2013 how i can correctly paste it? Or I must create new function in Smarty and use {test} in header.tpl? 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