Bruna BSPCU Posted April 19, 2013 Share Posted April 19, 2013 The problem appears like that: If i have 2 or more products on the basket, the shopping cart appears like that: Cart: 2 PRODUTO produtos But if i have only 1 product, the shopping cart appears like: Cart: 1 PRODUTO produto I'd never changed the code (blockuserinfo.tpl), that is like that: <li id="shopping_cart"> <a href="{$link->getPageLink("$order_process.php", true)}" title="{l s='Your Shopping Cart' mod='blockuserinfo'}"><span class="cart_title">{l s='Cart:' mod='blockuserinfo'}</span></a> <span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span> <span class="ajax_cart_product_txt{if $cart_qties != 1}hidden {/if}">{l s='product' mod='blockuserinfo'}</span> <span class="ajax_cart_product_txt_s{if $cart_qties < 2}hidden{/if}">{l s='products' mod='blockuserinfo'}</span><br /> What can i do to fix that? Thanks for all! Link to comment Share on other sites More sharing options...
NemoPS Posted April 20, 2013 Share Posted April 20, 2013 Hi There, That's a really weird issue. Are you using a third party theme? Try looking for "producto" or "product" in the theme folder, or better this way s='produto' (or product again). Try it with double quotes as well and see if you can find it Link to comment Share on other sites More sharing options...
Bruna BSPCU Posted April 21, 2013 Author Share Posted April 21, 2013 I've tried, but there is only one s='product' and one s='products'on the other span... Link to comment Share on other sites More sharing options...
Bruna BSPCU Posted April 21, 2013 Author Share Posted April 21, 2013 Hey Nemo1, look my code: <ul id="header_nav"> {if !$PS_CATALOG_MODE} <li id="shopping_cart"> <a href="{$link->getPageLink("$order_process.php", true)}" title="{l s='Your Shopping Cart' mod='blockuserinfo'}"><span class="cart_title">{l s='Cart:' mod='blockuserinfo'}</span></a> <span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span> <span class="ajax_cart_product_txt{if $cart_qties != 1} hidden{/if}">{l s='product' mod='blockuserinfo'}</span> <span class="ajax_cart_product_txt_s{if $cart_qties >= 2} visible{/if}">{l s='products' mod='blockuserinfo'}</span><br /> {if $cart_qties >= 0} <span class="ajax_cart_total{if $cart_qties == 0} hidden{/if}"> {if $priceDisplay == 1} {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} {convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)} {else} {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} {convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)} {/if} </span> {/if} <span class="ajax_cart_no_product{if $cart_qties > 0} hidden{/if}">{l s='(empty)' mod='blockuserinfo'}</span> </li> {/if} <li id="your_account"><a href="{$link->getPageLink('my-account.php', true)}" title="{l s='My Account' mod='blockuserinfo'}">{l s='My Account' mod='blockuserinfo'}</a></li> <li id="atend"><a href="#" title="{l s='Atending' mod='blockuserinfo'}">{l s='Atending' mod='blockuserinfo'}</a></li><br/> </ul> With that, if i have 0 products, displays: 0 products; (OK) 1 product, displays: 1 PRODUCT Products; (Problem) 2 or more products, display: 2 Products. (OK). What is wrong in the code? Thanks a lot! Link to comment Share on other sites More sharing options...
PascalVG Posted April 21, 2013 Share Posted April 21, 2013 Hi Bruna, is your shop online? Of so, please give us a link to play with. What PS version?? Link to comment Share on other sites More sharing options...
Bruna BSPCU Posted April 21, 2013 Author Share Posted April 21, 2013 Hi PascalVG sorry but i don't have this online. My PS version is 1.4.7.3! Thanks! Link to comment Share on other sites More sharing options...
PascalVG Posted April 22, 2013 Share Posted April 22, 2013 Seems that ProductS is always on: <span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span> <span class="ajax_cart_product_txt{if $cart_qties != 1} hidden{/if}">{l s='product' mod='blockuserinfo'}</span> <span class="ajax_cart_product_txt_s{if $cart_qties >= 2} visible{/if}">{l s='products' mod='blockuserinfo'}</span><br /> s='products' never has to be invisible accoring to this code, only 'confirms' that it's visible (this code actually is not complete as well as it wants to tun it 'ON' only if >=2, but, with '0' you would like to get 0 productS as well. (That's 'working' now as it's never turned off, giving the 0 productS as well implicitly) But, it should be 'hidden' when $cart_qties ==1 ! That's not done in this code. So change the last line from: <span class="ajax_cart_product_txt_s{if $cart_qties >= 2} visible{/if}">{l s='products' mod='blockuserinfo'}</span><br /> into this: <span class="ajax_cart_product_txt_s{if $cart_qties == 1} hidden{/if}">{l s='products' mod='blockuserinfo'}</span><br /> This may solve this. My 2 cents, pascal Link to comment Share on other sites More sharing options...
PascalVG Posted April 22, 2013 Share Posted April 22, 2013 Bruna, according to your latest listing, you said it would show: 0 products Does it really show the 0 here? As I see the code, it doesn't show the $cart_qties when equal to 0. If you want to show it, change this line: <span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span> Into this: <span class="ajax_cart_quantity">{$cart_qties}</span> This will just always show it, not dependent on the value. My 2 cents, Pascal Link to comment Share on other sites More sharing options...
Bruna BSPCU Posted April 23, 2013 Author Share Posted April 23, 2013 Hey PascalVG thanks for helping me with this problem! But it doesn't work, looks like something is overriding this code, i don't know, because the code is write but it doesn't displays. Look how it is now with 1 and 2 products in the cart. And The code is here: <li id="shopping_cart"> <a href="{$link->getPageLink("$order_process.php", true)}" title="{l s='Your Shopping Cart' mod='blockuserinfo'}"><span class="cart_title">{l s='Cart:' mod='blockuserinfo'}</span></a> <span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span> <span class="ajax_cart_product_txt{if $cart_qties != 1} hidden{/if}">{l s='product' mod='blockuserinfo'}</span> <span class="ajax_cart_product_txt_s{if $cart_qties >= 2} visible{/if}">{l s='products' mod='blockuserinfo'}</span><br /> {if $cart_qties >= 0} <span class="ajax_cart_total{if $cart_qties == 0} hidden{/if}"> {if $priceDisplay == 1} {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} {convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)} {else} {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} {convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)} {/if} </span> {/if} <span class="ajax_cart_no_product{if $cart_qties > 0} hidden{/if}">{l s='(empty)' mod='blockuserinfo'}</span> </li> Thanks a lot for answering PascalVG! Link to comment Share on other sites More sharing options...
Recommended Posts