Jump to content

Feature Request: Disable AddToCart button for Combination Accessories


BarryH

Recommended Posts

Not sure if this is the place to post this but here's my observation...

 

Scenario:

 

Prestashop 1.6.0.9

 

- Add an accessory to primary product.

- (The accessory product should be a product with combinations.)

- View primary product page.

- Accessory product listing shows "Add to Cart" button.

- (Only able to add default product to cart.)

 

Add to Cart button for accessory products should be handled the same way as category pages that list products (option to disable Add to Cart button).

 

Regards,

Barry

 

Link to comment
Share on other sites

Good call Barry

 

I suppose it will have to check if the accessory/product has attributes first,then if it has display choose options(or similar text)and if it has no attributes then display add to cart

 

I did try this in product.tpl

<div class="quick-view-wrapper-mobile">
<a rel="{$accessoryLink|escape:'html':'UTF-8'}" href="{$accessoryLink|escape:'html':'UTF-8'}" class="quick-view">
<span>Choose Options</span>
</a>
</div>

and it worked opening up the product in the quick view window so you could adjust attributes before adding to cart, but its only showing text at the moment and not a button

maybe an easy fix???

post-535854-0-37754000-1418844300_thumb.jpg

 

Not exactly sure how to phrase the IF statement yet though...

 

Anybody got a better way

 

This is similar to the same problem with products in the product-list, you can add to cart without choosing attributes too

Edited by mickeyboy1 (see edit history)
Link to comment
Share on other sites

I submitted this issue as a feature request in Bug Tracker. Florian provided the following work around to me. I've implemented it and, so far, it seems to be working excellently for me. Here's my description of his workaround:

 

product-list.tpl already uses the back office setting to disable the AddToCart button when a product has attributes:

 

- Preferences/Products/Display the "add to cart" button when a product has attributes

 

It's this feature that we can take advantage of to fix the accessories problem described above. We can replace the standard accessories handler code with the product-list handler.

 

(1) Find the location in product.tpl that is identified by "<!-- Accessories -->:

<!--Accessories -->
<section class="page-product-box">
<h3 class="page-product-heading">{l s='Accessories'}</h3>
 

(2) After the <h3> tags line, insert:

<!-- begin modification -->

{include file="./product-list.tpl" products=$accessories}
 

(3) Comment out the existing code from that point to just before the closing </section> tag:

{*
COMMENTED OUT STANDARD METHOD OF DISPLAYING ACCESSORIES
*}

<!-- end modification -->

</section>
<!--end Accessories -->
 

Voila! No more AddToCart button displayed for combination accessories!

Link to comment
Share on other sites

×
×
  • Create New...