alpaca Posted January 21, 2010 Share Posted January 21, 2010 Hey Chaps,Well, thanks for a good few member on this forum, we are so super close to clompleing our actuall front office design and very happy with what has been done.There are only a few small issues remaining really and he is one of them:On the frobnt page, where the fearuted products are located, when a customer clicks "add to cart" and if this particular products happens to have a size attribute i.e. medium, large or extra large, the customer automatically seems to add the medium choice by default to the cart. Is there anyway to add that particular drop down menu to the front page as indicated in my attached screenshot:As always any help would be appreciated to know which files to change. Link to comment Share on other sites More sharing options...
alpaca Posted January 25, 2010 Author Share Posted January 25, 2010 Hi,Can anyone kindly help out on this one? Link to comment Share on other sites More sharing options...
rocky Posted January 26, 2010 Share Posted January 26, 2010 This is actually very difficult to do. Prestashop uses Javascript to display the attribute prices on the product page and puts every possible combination into the HTML code. To get the attributes to work on the product listings, you'd have to find a way to put every combination of attributes for every product on the one page and modify the Javascript so that they work together and don't conflict. Even if you manage to do it, I think it would slow down the loading of the product listings dramatically. It would be a lot of work and I doubt anyone will post a solution for free here. Maybe you could pay someone to do it. Link to comment Share on other sites More sharing options...
alpaca Posted January 26, 2010 Author Share Posted January 26, 2010 I completely agree with what you said. If it will compremise speeds then it's not worth it. Is there maybe a way to make the Add to cart just lick to the actuall product instead of add to cart on the front page? Basically the front page add to cart button uses the view link? Link to comment Share on other sites More sharing options...
rocky Posted January 26, 2010 Share Posted January 26, 2010 It is the following section starting on line 20 of modules/homefeatured/homefeatured.tpl that you should modify: {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'} {else} {l s='Add to cart' mod='homefeatured'} {/if} You could {* comment out *} this code to remove the "Add to cart" button altogether, or change its link to {$product.link} so that it acts like the "View" button. You could also disable the "Add to cart" button when the product has attributes by changing the first line to: {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0} Link to comment Share on other sites More sharing options...
mandrin Posted January 28, 2010 Share Posted January 28, 2010 Interesting this... Would love to see something like this.Btw, would it be the same difficulty to add attribs to the general product listing? Please see attached image example... Link to comment Share on other sites More sharing options...
rocky Posted January 28, 2010 Share Posted January 28, 2010 It would be as difficult and have the same problems as on the featured products. Link to comment Share on other sites More sharing options...
mandrin Posted January 28, 2010 Share Posted January 28, 2010 Would it be possible then to change the text on the "view" button to rather say "View / Sizes" ? Do this in Translations?Because some clients might first click "Add to cart" without realising that there are in fact size /colour attributes that should be first chosen otherwise the default attribute is selected... Link to comment Share on other sites More sharing options...
rocky Posted January 28, 2010 Share Posted January 28, 2010 Yes, you could go to the "Front Office translations" then enter "View / Sizes" as the translation for "View" in the product-list section. You could do the same under the "homefeatured" section of "Modules translations". Link to comment Share on other sites More sharing options...
mandrin Posted January 28, 2010 Share Posted January 28, 2010 Ok, translating works but I thought about what you said a few posts back "It is the following section starting on line 20 of modules/homefeatured/homefeatured.tpl that you should modify:{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}{l s='Add to cart' mod='homefeatured'}{else}{l s='Add to cart' mod='homefeatured'}{/if}You could {* comment out *} this code to remove the “Add to cart” button altogether, or change its link to {$product.link} so that it acts like the “View” button. You could also disable the “Add to cart” button when the product has attributes by changing the first line to:{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_pro"Could you please assist me to do the same to the product list?Regards, Link to comment Share on other sites More sharing options...
rocky Posted January 29, 2010 Share Posted January 29, 2010 The code you need to change is the same, it is just in a different position. It starts at line 20 of product-list.tpl in your theme's directory. Link to comment Share on other sites More sharing options...
manuel1972 Posted September 21, 2010 Share Posted September 21, 2010 It is the following section starting on line 20 of modules/homefeatured/homefeatured.tpl that you should modify:{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'}{else} {l s='Add to cart' mod='homefeatured'}{/if} You could {* comment out *} this code to remove the “Add to cart” button altogether, or change its link to {$product.link} so that it acts like the “View” button. You could also disable the “Add to cart” button when the product has attributes by changing the first line to:{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0} Is it possible to keep only the view button visible in case of existing attribute/combinations? Because with the above code I believe it still shows 'add to cart' but impossible to click on. This can be confiusing for customers because they might think the product cannot be ordered. Link to comment Share on other sites More sharing options...
rocky Posted September 21, 2010 Share Posted September 21, 2010 In that case, try: {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0} {l s='Add to cart' mod='homefeatured'} {*{else} {l s='Add to cart' mod='homefeatured'}*} {/if} Link to comment Share on other sites More sharing options...
manuel1972 Posted September 21, 2010 Share Posted September 21, 2010 That didn't work I guess there is something different in my code.This is my code after I did the first modification: {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0} {l s='Add to cart'} {else} {l s='Add to cart'} {/if} Maybe you can see the problem?PS I work with a third party theme. Link to comment Share on other sites More sharing options...
rocky Posted September 21, 2010 Share Posted September 21, 2010 You need to {* comment out *} or remove the following lines: {else} {l s='Add to cart'} Link to comment Share on other sites More sharing options...
manuel1972 Posted September 21, 2010 Share Posted September 21, 2010 Then it will only show the 'add to cart button' in case of no attributes? Link to comment Share on other sites More sharing options...
rocky Posted September 21, 2010 Share Posted September 21, 2010 Correct. Link to comment Share on other sites More sharing options...
manuel1972 Posted September 21, 2010 Share Posted September 21, 2010 Great Rocky, that did the job!!Yesterday I met another problem, not sure if I should open a new topic or if I can ask it over here?After using the attributes generator, and willing to modify the default combination; I get an error on top of the page saying: 1 error 1. This attribute already exists. Link to comment Share on other sites More sharing options...
rocky Posted September 22, 2010 Share Posted September 22, 2010 You should always put unrelated questions in different topics. I've never encountered that error message before. Link to comment Share on other sites More sharing options...
manuel1972 Posted September 22, 2010 Share Posted September 22, 2010 OK Rocky,I will do that in the future.Problem is solved , deleted all combinations, then got the generator made the combinations, then modify the generated combinates and finally selected the default one.Thanks! Link to comment Share on other sites More sharing options...
mutluok Posted March 9, 2011 Share Posted March 9, 2011 Would not help, please Link to comment Share on other sites More sharing options...
thebroadys Posted April 26, 2011 Share Posted April 26, 2011 RockyI tried your solution to remove the Add to cart option when the product had attributes but I just wont work, the add button is still there. Here's my code of product-list.tpl {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0} {l s='Add to cart'} <!--{else} {l s='Add to cart'}--> {/if} Link to comment Share on other sites More sharing options...
Achal Posted June 14, 2011 Share Posted June 14, 2011 Hello Rocky,Can you please tell me code to just show default attribute at product-list page?Thanks,Achal Link to comment Share on other sites More sharing options...
natalize Posted September 7, 2012 Share Posted September 7, 2012 And what about the possibility of amke a menu on the home page with possibility of choosing by size for example. Bec i put attributes but from hundreds of clothes and items how can they choose sizez available for deffinete models the need. Is it possible to make a section in main menu with attributes in my case children sizes (from 0 to 12) a simple or any other answer pls 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