Jump to content

Anoying discovery when having products with attributes


Recommended Posts

Hi all.

I've just discovered something bad. When I go to category "lipsticks" I can click [add to basket] and also [sHOW MORE INFO] ..the problem is occurs of a customers doesn't go all the way into the unique page of the product and choose which color the customer wants. If the product is added to the basket from the product list, it will automatically get a default color...in this case 'black'...

Can this be fixed without having to take away the attributes and instead add every lipstick as one unique product?

Link to comment
Share on other sites

I've also been thinking about this very problem. The quick and easy fix is to remove the 'add to cart' button from the product-list template (themes/prestashop/product-list.tpl) and probably the homefeatured template as well (modules/homefeatured/homefeatured.tpl). See this thread for the exact code to remove.

It looks like you ought to be able to use the $product.customizeable value to selectively show the 'add to cart' button, but it appears the value is never properly set in Product.php.

So remove the button entirely or fix Product.php to set the correct value for $product.customizable and use that in the if block in the template.

Link to comment
Share on other sites

So I ended up adding "&& $product.id_product_attribute == NULL" (without quotes) to the if condition in the product-list and homefeatured templates. This will show the 'add to cart' button only if the product has no attributes (no default attribute technically). If a product does have attributes, the 'add to cart' button will not be active. Remove the else block to have the button not show up at all. Sorry, that's a bit short on detail, let me know if you need clarification.

Link to comment
Share on other sites

  • 1 month later...

I suggest leaving the button in and changing the text from

{l s='Add to cart' mod='homefeatured'}



To

{l s='Must View First' mod='homefeatured'}



Do the same for the modules\homefeatured\homefeatured.tpl as above for themes\prestashop\product-list.tpl

This way if a product has attributes set, then people will be prompted to do something...... otherwise a total lack of little green buttons will reduce sales... and we don't want that do we?

Link to comment
Share on other sites

×
×
  • Create New...