Ron morales Posted June 28, 2016 Share Posted June 28, 2016 helllo, i need a show only default store of multistore one button, what this conditional of show? {if $default-store} ? thanks Link to comment Share on other sites More sharing options...
Rolige Posted June 28, 2016 Share Posted June 28, 2016 Easy... {if Configuration::get('PS_SHOP_DEFAULT') == 1} {* Code here when default shop is 1 *} {/if} 1 Link to comment Share on other sites More sharing options...
Ron morales Posted June 29, 2016 Author Share Posted June 29, 2016 Ok very thanks Link to comment Share on other sites More sharing options...
Ron morales Posted June 29, 2016 Author Share Posted June 29, 2016 (edited) Easy... {if Configuration::get('PS_SHOP_DEFAULT') == 1} {* Code here when default shop is 1 *} {/if} {if Configuration::get('PS_SHOP_DEFAULT') == 1} <a class="distribuidores" href="#" >{l s='Acceso distribuidores' mod='blockcontact'}</a> {else} <a class="distribuidores" href="#" >{l s='Acceso Clientes' mod='blockcontact'}</a> {/if} i insert code for when default shop, and not default shop but not work, what have I done wrong? Edited June 29, 2016 by Ron morales (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted June 29, 2016 Share Posted June 29, 2016 You are working in Smarty, you need have enabled the option to "Force compilation" or "Clear cache" Also, my example is representative, I used the ID 1, of course, you need put the Id of your default shop. Link to comment Share on other sites More sharing options...
Ron morales Posted June 29, 2016 Author Share Posted June 29, 2016 You are working in Smarty, you need have enabled the option to "Force compilation" or "Clear cache" Also, my example is representative, I used the ID 1, of course, you need put the Id of your default shop. Cotoko no me había dado cuenta que eras tú, si que me funciona, pero el tema es que quiero que aparezca un boton cuando esté en una tienda, y cuando esté en la otra otro, pero con el {else} no me funciona, lo tengo dentro del tpl de blockcontact Link to comment Share on other sites More sharing options...
Ron morales Posted June 29, 2016 Author Share Posted June 29, 2016 {if $cart->id_shop==1} <a class="distribuidores" href="#" >{l s='Acceso distribuidores' mod='blockcontact'}</a> {/if} {if $cart->id_shop==2} <a class="distribuidores" href="3" >{l s='Acceso Clientes' mod='blockcontact'}</a> {/if} Work now this form Link to comment Share on other sites More sharing options...
Rolige Posted June 30, 2016 Share Posted June 30, 2016 Hola Ron, el codigo que te di en un principio es valido para que compares si es la tienda defecto o no, ahora cambiaste un poco a determinar en que id de tienda te encuentras, no se en que archivo te encuentras, pero dado el modulo supongo que es /themes/default-bootstrap/modules/blockcontact/nav.tpl El codigo que podrias utilizar es este {if Context::getContext()->shop->id == 1} <a class="distribuidores" href="#" >{l s='Acceso distribuidores' mod='blockcontact'}</a> {else if Context::getContext()->shop->id == 2} <a class="distribuidores" href="3" >{l s='Acceso Clientes' mod='blockcontact'}</a> {/if} Saludos! 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