leboutlet Posted March 30, 2013 Share Posted March 30, 2013 Hello, the "Add to Cart" button suddenly disappeared from only a few items of the catalog after I set a discount on them. They have the same available quantities as other products. They have a price reduction too. But the button is missing. I suspect the issue to be with the them? Maybe there is not enough space in the box? But the add to cart button is at the top, it loads before the description or the price. so I am not sure. 2 examples below: http://www.lebaneseoutlet.com/en/consoles/254-ps3-500gb-fifa-13-extra-controller.html http://www.lebaneseoutlet.com/en/home-audio/187-hcd-gpx8g.html Anybody faced this? Link to comment Share on other sites More sharing options...
prestashopninja Posted March 30, 2013 Share Posted March 30, 2013 Hi, Add to cart button is actually still there, but it's invisible under last items warning. Please see the attached screenshot. Link to comment Share on other sites More sharing options...
leboutlet Posted March 30, 2013 Author Share Posted March 30, 2013 (edited) Thank you PrestashopNinja Any idea why it would there instead of the usual place like in the other example? Do you think It is only a box size issue to be corrected? This is truly puzzling me, the script looks different for each product!?! edited: same script, but button not appearing. I think the fact that I used the reduction% added a few lines to the box. I will see if increasing the box size will help it reappear. Time to search for the box size increase without altering the theme.... Edited March 30, 2013 by leboutlet (see edit history) Link to comment Share on other sites More sharing options...
prestashopninja Posted March 30, 2013 Share Posted March 30, 2013 The button has also css property "display:none" there. I am not certain, but this must have something to do with the product quantities. Could you try to edit one of those products for which the button doesn't appear and switch to "quantities" tab and try to change "when out of order" preference to "allow orders" and see what happens then? Link to comment Share on other sites More sharing options...
leboutlet Posted March 30, 2013 Author Share Posted March 30, 2013 Tried that but add to cart button still missing Check the attached thumbnail please Link to comment Share on other sites More sharing options...
yaniv14 Posted March 30, 2013 Share Posted March 30, 2013 check you theme folder file 'product.tpl' lines 154-156: {if $product->description} <p class="buttons_bottom_block"><a class="exclusive" href="javascript:document.getElementById('add2cartbtn').click();">{l s='Add to cart'}</a><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} you have a statement that says to show the add to cart button only if the product have long description. you can either add long description to item or remove the if statement, like this. {*if $product->description*}<p class="buttons_bottom_block"><a class="exclusive" href="javascript:document.getElementById('add2cartbtn').click();">{l s='Add to cart'}</a><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {*/if*} Link to comment Share on other sites More sharing options...
leboutlet Posted March 30, 2013 Author Share Posted March 30, 2013 (edited) I will try it now. This is what I have, a bit different: {if $product->description_short OR $packItems|@count > 0} <div id="short_description_block"> {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short}</div> {/if} {if $product->description} <p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} I disabled it, it worked but the layout got f***ked up Edited March 30, 2013 by leboutlet (see edit history) Link to comment Share on other sites More sharing options...
leboutlet Posted March 30, 2013 Author Share Posted March 30, 2013 (edited) I am gonna restore the script. edit: I restored the script but the layout is still f***ed up!!! once i solve this I will try increasing the "short description" Edited March 30, 2013 by leboutlet (see edit history) Link to comment Share on other sites More sharing options...
leboutlet Posted March 30, 2013 Author Share Posted March 30, 2013 Restored the script, is working as original now. Reset the default "no order if stock 0" Tried the short/long description. It did not work. I have items with very short description not working AND OTHER WITH VERY LONG "SHORT DESCRIPTION" and it is still not working. Anybody knows how to increase the size of the box (height)? I believe just 1 to 5 pixels would suffice Link to comment Share on other sites More sharing options...
yaniv14 Posted March 30, 2013 Share Posted March 30, 2013 Which box? the short description area? if so you need to find in product.css or global.css #primary_block #short_description_block {} and add desire height #primary_block #short_description_block {height: 50px;} if you mean the box in the bottom where you have share, send, print its a bit tricky because the border is a background image which set to 65px height, so you need to modify image or remove to get more height. also I don't understand how come you couldn't fix what I suggested on my first post. Link to comment Share on other sites More sharing options...
leboutlet Posted March 30, 2013 Author Share Posted March 30, 2013 Which box? the short description area? if so you need to find in product.css or global.css and add desire height if you mean the box in the bottom where you have share, send, print its a bit tricky because the border is a background image which set to 65px height, so you need to modify image or remove to get more height. also I don't understand how come you couldn't fix what I suggested on my first post. I meant the box where the price/reduce price/add to cart are in. Your script solution worked but it modified the whole layout, check my previous attached thumbnail and the last one in my posts above to get a picture of what I mean. What did not work was to increase the description because i have items with shorter description with a working/visible add to cart button, and others with longer description without the button. So I suspect it may have to do with the height of the box?!?! Link to comment Share on other sites More sharing options...
yaniv14 Posted March 31, 2013 Share Posted March 31, 2013 Let me try to explain my self better. The different between the 2 links you submit in your first post is that: the product that show the add to cart button has description for the item and the other product don't, in your product.tpl you have a script that check if the product have a description it will show the buttons of add to cart & more info. in your back office, for each product you can attach a short description & description (long description "more info"). I hope I am clear with this part. Now let go back to your script: {if $product->description_short OR $packItems|@count > 0}<div id="short_description_block"> {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short|strip_tags}</div> {/if} {if $product->description} <p class="buttons_bottom_block"><a class="exclusive" href="javascript:document.getElementById('add2cartbtn').click();">{l s='Add to cart'}</a><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} what I've marked in red is the area that I am talking about. {if $product->description} ...... ......WILL HAPPEN ONLY IF DESCRIPTION EXIST FOR PRODUCT ..... ....... {/if} now we can change it to say that show the add to cart all the times but the more info show only when we have long description. so change the section to look like this: {if $product->description_short OR $packItems|@count > 0}<div id="short_description_block"> {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short|strip_tags}</div> {/if} <p class="buttons_bottom_block"><a class="exclusive" href="javascript:document.getElementById('add2cartbtn').click();">{l s='Add to cart'}</a>{if $product->description}<a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} We moved the if statement after the add to cart button and before the more info button. Please make the changes and clear your browser cache (ctrl + f5, 2-3 times). when you make the change if you still have a style issue please don't revert it, keep it so I can inspect it with the changes. Good luck 1 Link to comment Share on other sites More sharing options...
leboutlet Posted March 31, 2013 Author Share Posted March 31, 2013 Hello 1)Thank you for your help, Now I understand better. I thought we were talking about the "short description", not the "long full description" because it was in another box on the bottom of the page. So the "add to cart" button is joint with the "more details" button. I thought they were "stick" together through the layout only not script too. So if the description is not there, Instead of just disabling the "more details" button, there is no "more details" button and so there is no "add to cart" button. 2) disable script and put it back on Before disabling: "enable java script" After disabling: "disable java" 3) I think I will just add the description to each product, what is puzzling is that I did not have this bug before, it only appeared when I set a "reduction in price"... Link to comment Share on other sites More sharing options...
yaniv14 Posted March 31, 2013 Share Posted March 31, 2013 I also noticed that you have a small bug in left column cart block, the 'Cart' & 'Checkout' buttons. if you want to fix it you need to edit 'modules/blockcart/blockcart.tpl' line #145 5th or 6th from the bottom. it look like this: <a href="{$link->getPageLink("$order_process.php", true)}{if $order_process == 'order'}?step=1{/if}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}">{l s='Check out' mod='blockcart'}</a> Change to: <a href="{$link->getPageLink("$order_process.php", true)}{if $order_process == 'order'}?step=1{/if}" id="button_order_cart" class="button_small{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}">{l s='Check out' mod='blockcart'}</a> see if its better 1 Link to comment Share on other sites More sharing options...
leboutlet Posted April 1, 2013 Author Share Posted April 1, 2013 (edited) Thank you for the advice: Check out the code, it is already "button small" ???? {/if} <p id="cart-buttons"> {if $order_process == 'order'}<a href="{$link->getPageLink(" $order_process.php",="" true)}"="" class="button_mini" title="{l s='Cart' mod='blockcart'}">{l s='Cart' mod='blockcart'}</a>{/if} <a href="{$link->getPageLink(" $order_process.php",="" true)}{if="" $order_process="=" 'order'}?step="1{/if}"" id="button_order_cart" class="button_small{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}">{l s='Check out' mod='blockcart'}</a> </p> Edited April 1, 2013 by leboutlet (see edit history) Link to comment Share on other sites More sharing options...
yaniv14 Posted April 1, 2013 Share Posted April 1, 2013 I guess you didn't check where I told you you checked 'blockcart.tpl' in your theme modules folder, you should check the file in Root/Modules/Blockcart Link to comment Share on other sites More sharing options...
leboutlet Posted April 1, 2013 Author Share Posted April 1, 2013 I guess you didn't check where I told you you checked 'blockcart.tpl' in your theme modules folder, you should check the file in Root/Modules/Blockcart Correct. just changed the code in the other blockcart. No changes yet. Will refresh it tomorrow morning and will revert back to you Link to comment Share on other sites More sharing options...
yaniv14 Posted April 1, 2013 Share Posted April 1, 2013 make sure you force compile on and clear cache Link to comment Share on other sites More sharing options...
leboutlet Posted April 2, 2013 Author Share Posted April 2, 2013 make sure you force compile on and clear cache Changed the code but no changes. The website is still under "force recompile" and "no cache enabled" for production purposes. any tip on why? Below a snapshot of the code and the button: Link to comment Share on other sites More sharing options...
leboutlet Posted April 2, 2013 Author Share Posted April 2, 2013 Just succeeded in doing it. It was the Root/Modules/Blockcart2 the 2nd newest blockcart. It is better layed out now but it lost the "color" blue/white color of the theme. Can I fix it? Link to comment Share on other sites More sharing options...
yaniv14 Posted April 2, 2013 Share Posted April 2, 2013 The way you have it now I think its the way this theme was designed. But if you want to make it blue instead the only solution I can find for you is to revert it to class exclusive and add inline style, unless you know how to add a class of your own and make what ever you want. change this line: {if $order_process == 'order'}<a href="{$link->getPageLink("$order_process.php", true)}" class="button_small" title="{l s='Cart' mod='blockcart'}">{l s='Cart' mod='blockcart'}</a>{/if} To: {if $order_process == 'order'}<a href="{$link->getPageLink("$order_process.php", true)}" class="exclusive" style="float:left; width: 93px;" title="{l s='Cart' mod='blockcart'}">{l s='Cart' mod='blockcart'}</a>{/if} and see if its better, in this case you won't have the red background when hovering with the mouse (you cannot do it with inline style). 1 Link to comment Share on other sites More sharing options...
leboutlet Posted April 2, 2013 Author Share Posted April 2, 2013 Excellent it worked!!!! THANK YOU Link to comment Share on other sites More sharing options...
NOSaint Posted July 22, 2013 Share Posted July 22, 2013 I had the same issue, but my fix was easier. It was as you said earlier, it was linked to the product quantities in my BO. So products that has quantity of 0 or less (if back order) the Add to Cart button would not show up. So I have to check all of the quantities of my products. Once that is up to date, all my buttons showed up as they were supposed to. Thanks for the good idea! Link to comment Share on other sites More sharing options...
Recommended Posts