manuel1972 Posted August 30, 2010 Share Posted August 30, 2010 Hi All,After installing a third party theme, I noticed that the quantity displayed in the shopping cart overview is the quantity available in stock and not the quantity ordered by the customer.When switching to the PS theme everything is OK.When checking the shopping cart template the following parameter is used: {l s='Qty'}. I believe this is correct, nbut instead it is displaying the available stock.Screenshot attached,Thanks in advance for your help.Manuel quantity available instead of ordered.pdf Link to comment Share on other sites More sharing options...
rocky Posted August 31, 2010 Share Posted August 31, 2010 It's an old bug that was fixed a long time ago. You must be using an old theme that was created before the bug was fixed. You need to search in shopping-cart-product-line.tpl for $product.quantity and change it to $product.cart_quantity Link to comment Share on other sites More sharing options...
manuel1972 Posted August 31, 2010 Author Share Posted August 31, 2010 Thanks for the quick reaction Rocky,Is this what you mean? {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.quantity} {/foreach} {* If it exists also some uncustomized products *} {if $product.quantity-$quantityDisplayed > 0}{include file=$tpl_dir./shopping-cart-product-line.tpl}{/if} {/if} {/foreach} Link to comment Share on other sites More sharing options...
rocky Posted August 31, 2010 Share Posted August 31, 2010 No. Here's what's on line 26 on my site: {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)}{$customizedDatas.$productId.$productAttributeId|@count}{else}{$product.cart_quantity-$quantityDisplayed}{/if} Notice how it says $product.cart_quantity. On older versions of PrestaShop, it was $product.quantity, which was incorrect. Link to comment Share on other sites More sharing options...
manuel1972 Posted August 31, 2010 Author Share Posted August 31, 2010 I run Prestashop 1.3.1., but for sure my theme is older and that could explain the bug.However I can't find the line you refer to, neither in the original PS theme.The only referring to $product.quantity is the one I mentioned above (checked with agent ransack)Is there anything else I can try.As said, with the PS theme activated it displays correctly, so the problem has to be in the template I believe. Link to comment Share on other sites More sharing options...
rocky Posted August 31, 2010 Share Posted August 31, 2010 If you PM me your template, I'll check it for you. Link to comment Share on other sites More sharing options...
manuel1972 Posted August 31, 2010 Author Share Posted August 31, 2010 Hi Rocky,Did you finally get the template? I've send it .zip and received no error but forgot to leave a copy in my sentbox; so I can't check if it was sent succesfully.Manuel Link to comment Share on other sites More sharing options...
rocky Posted August 31, 2010 Share Posted August 31, 2010 Yes, I got it, but it is the wrong file. It is shopping-cart-product-line.tpl, not shopping-cart.tpl that needs to be changed. Link to comment Share on other sites More sharing options...
manuel1972 Posted August 31, 2010 Author Share Posted August 31, 2010 My mistake!Got it corrected and works perfectly!Thanks Link to comment Share on other sites More sharing options...
Daan Tol Posted September 11, 2010 Share Posted September 11, 2010 Thanks Rocky! I had a similar problem >> with this solution my cart looks good again!I said it before & I'll say it again: rocky is a hero. Link to comment Share on other sites More sharing options...
Jean L Posted October 24, 2010 Share Posted October 24, 2010 hi rocky, i tried to replace the code but the problem still persists. would you help me take a look at my code: getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'htmlall':'UTF-8'}">getImageLink($product.link_rewrite, $product.id_image, 'small')}" alt="{$product.name|escape:'htmlall':'UTF-8'}" /> getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'} {if $product.attributes}getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'htmlall':'UTF-8'}">{$product.attributes|escape:'htmlall':'UTF-8'}{/if} {if $product.reference}{$product.reference|escape:'htmlall':'UTF-8'}{else}--{/if} {if $product.active AND ($product.allow_oosp OR $product.stock_quantity > 0)} {else} {/if} {convertPrice price=$product.price} {l s='-Tx'} {if isset($customizedDatas.$productId.$productAttributeId) AND $quantityDisplayed == 0}{$product.customizationQuantityTotal}{/if} {if !isset($customizedDatas.$productId.$productAttributeId) OR $quantityDisplayed > 0} {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)}{$customizedDatas.$productId.$productAttributeId|@count}{else}{$product.cart_quantity-$quantityDisplayed}{/if} {/if} {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)} {if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.total_customization_wt}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if}{if $priceDisplay == 2} {/if} {if $priceDisplay}{convertPrice price=$product.total_customization}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/if} {else} {if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.total_wt}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if}{if $priceDisplay == 2} {/if} {if $priceDisplay}{convertPrice price=$product.total}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/if} {/if} thanks Link to comment Share on other sites More sharing options...
rocky Posted October 24, 2010 Share Posted October 24, 2010 Here's what I have in my file: <a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small')}" alt="{$product.name|escape:'htmlall':'UTF-8'}" width="{$smallSize.width}" height="{$smallSize.height}" /> <a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'} {if $product.attributes}<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|escape:'htmlall':'UTF-8'}">{$product.attributes|escape:'htmlall':'UTF-8'}{/if} {if $product.reference}{$product.reference|escape:'htmlall':'UTF-8'}{else}--{/if} {if $product.active AND ($product.allow_oosp OR ($product.quantity <= $product.stock_quantity))} <img src="{$img_dir}icon/available.gif" alt="{l s='Available'}" width="14" height="14" /> {else} <img src="{$img_dir}icon/unavailable.gif" alt="{l s='Out of stock'}" width="14" height="14" /> {/if} {if !$priceDisplay}{convertPrice price=$product.price_wt}{else}{convertPrice price=$product.price}{/if} {if isset($customizedDatas.$productId.$productAttributeId) AND $quantityDisplayed == 0}{$product.customizationQuantityTotal}{/if} {if !isset($customizedDatas.$productId.$productAttributeId) OR $quantityDisplayed > 0} <a class="cart_quantity_delete" href="{$base_dir_ssl}cart.php?delete&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&token={$token_cart}" title="{l s='Delete'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" class="icon" width="11" height="13" /> {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)}{$customizedDatas.$productId.$productAttributeId|@count}{else}{$product.cart_quantity-$quantityDisplayed}{/if} <a class="cart_quantity_up" href="{$base_dir_ssl}cart.php?add&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&token={$token_cart}" title="{l s='Add'}"><img src="{$img_dir}icon/quantity_up.gif" alt="{l s='Add'}" width="14" height="9" /> <a class="cart_quantity_down" href="{$base_dir_ssl}cart.php?add&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&op=down&token={$token_cart}" title="{l s='Subtract'}"><img src="{$img_dir}icon/quantity_down.gif" alt="{l s='Subtract'}" width="14" height="9"/> {/if} {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)} {if !$priceDisplay}{displayPrice price=$product.total_customization_wt}{else}{displayPrice price=$product.total_customization}{/if} {else} {if !$priceDisplay}{displayPrice price=$product.total_wt}{else}{displayPrice price=$product.total}{/if} {/if} Link to comment Share on other sites More sharing options...
Jean L Posted October 24, 2010 Share Posted October 24, 2010 hi rocky, thanks for the fast reply..unfortunately, something went wrong at my shopping cart summary after i used your code. i have attached a file for your viewing.and the paypal quantity is still showing the stock quantity your help is much appreciated, rocky. Link to comment Share on other sites More sharing options...
rocky Posted October 24, 2010 Share Posted October 24, 2010 The forums cut off some of the code. I've modified it to display properly. Try again.The PayPal cart quantity issue is in another file. See my post here. Link to comment Share on other sites More sharing options...
Jean L Posted October 24, 2010 Share Posted October 24, 2010 thanks! i have moved the discussion there.. 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