blackmiles Posted December 5, 2013 Share Posted December 5, 2013 (edited) Dear all, i applied the tutorial explained on this page: http://mypresta.eu/en/art/developer/prestashop-quantity-field-on-product-list.html However, I have problem with Product-list.tplAfter applying changes, the quantity field does not appear and the add to cart button doesn't work any more. Where was I wrong? Thank you Stefano Edited December 9, 2013 by blackmiles (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 share url please, i will inspect code. Link to comment Share on other sites More sharing options...
blackmiles Posted December 5, 2013 Author Share Posted December 5, 2013 Hi, here the url http://www.andfood.it/ Thanks! Stefano Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 hello there is no "grid" list you changed also ajax-cart.js if you don't want to use grid you have to revert changes to all files you changed. Link to comment Share on other sites More sharing options...
blackmiles Posted December 5, 2013 Author Share Posted December 5, 2013 Hi, thanks for the reply. I don't understand. The system you provided works just in the grid modality? If yes, I'll try to put in that modality. Yes, I also changed the ajax-cart.js. Stefano Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 apply changes to tpl file and turn on force compile under adv. paramters > performance tab in your BO now there is no "grid" code, probably due to the cache (this is why i asked about force compilation) Link to comment Share on other sites More sharing options...
blackmiles Posted December 5, 2013 Author Share Posted December 5, 2013 I forced comply. but when you say "there is no "grid" code", should I do something to the template? Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 oh dear it was my mistake, i don't know why but i thought that you want grid there :| so sorry In this case it will be necessary to modify block cart module .js file and modify one simple thing. So, please open file located in blockcart module directory. The file name is ajax-cart.js. Full path to this file: /modules/blockcart/ajax-cart.js or if exist, you have to modify this file in your theme directory (overriding feature). So, in this file you can find code which looks like: 1 2 // add the picture to the cart var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img'); all that we have to do with this code is: add additional parent() code. This is the final code: 1 2 // add the picture to the cart var $element = $(callerElement).parent().parent().parent().find('a.product_image img,a.product_img_link img'); in addition: you need to decrease button width, because it overlapping quantity field: Link to comment Share on other sites More sharing options...
blackmiles Posted December 8, 2013 Author Share Posted December 8, 2013 Dear vekia, maybe I still have problems with the compilation (also in another modification of a .tpl file). Is it possible that cache is still active if I put - Cache template on force compilation- Cache on No my prestashop version is 1.5.6.1 thanks Stefano Link to comment Share on other sites More sharing options...
vekia Posted December 8, 2013 Share Posted December 8, 2013 i don't think so, it was related to missed one "parent()" code in ajax-cart.js nothing more Link to comment Share on other sites More sharing options...
blackmiles Posted December 8, 2013 Author Share Posted December 8, 2013 Ah. I immediately try! Link to comment Share on other sites More sharing options...
blackmiles Posted December 8, 2013 Author Share Posted December 8, 2013 Thank you so much vekia. From the code, I can see the quantity box. But, last thing. Where do I have to reduce the width of the buttom? Thanks! Stefano Link to comment Share on other sites More sharing options...
vekia Posted December 9, 2013 Share Posted December 9, 2013 product-list.css line 127 #product_list li .ajax_add_to_cart_button { padding-left: 20px; width: 60px; } add width param there, i added width:60px; - it's enough Link to comment Share on other sites More sharing options...
blackmiles Posted December 9, 2013 Author Share Posted December 9, 2013 Great! It works!! Thank you so much!!!! Link to comment Share on other sites More sharing options...
vekia Posted December 9, 2013 Share Posted December 9, 2013 you're welcome im so glad that my tutorial was helpful for you if you've got any other ideas about new features - im ready to write about it just let me know with regards, Milos 1 Link to comment Share on other sites More sharing options...
blackmiles Posted December 9, 2013 Author Share Posted December 9, 2013 For sure!! Thanks again!! 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