If the ECommerce store option 'Users adds product to cart using link' is unchecked then the Add to cart link does not appear if added in an ecviews View. Attached patch adds a parameter to the product_link function in product.module and changes the call in ecviews.module so that the Add to cart link shows up no matter how the store is configured.

CommentFileSizeAuthor
ecviews-addtocart.patch1.61 KBdjflux

Comments

djflux’s picture

Just wanted to post a follow-up note - This patch will not work on a Product with subproduct variations due to the fact that you must pick which variation that you want added to your cart.

Another more complicated patch could add a field to ecviews that would create a drop-down list in the view and then the add to cart link would add that variation node to the cart. Writing that code is beyond my PHP coding skills at the moment. I might tackle writing it after my site goes live.

brmassa’s picture

Status: Needs review » Closed (works as designed)

Andrew,

this behaviour was designed to not show when its not marked and the reason is exactly the one you pointed. maybe on the future we look on this.

regards,

massa