Reputation: 2221
All the products in the magento site are configurable products. The add to cart button works okay in the product page.
My problem comes in when I try to add the product to the cart from the compare window, the wishlist page or related products, it doesn't add the product to the cart for the obvious reason that there is no selected option on the dropdown attribute I've added(product size).
Anyway, how can I add the product to the cart from these windows using the product with the smallest size as the default value so that the customer wouldn't be redirected to the product page anymore to select a size when the link/button obviously says Add to Cart?
Upvotes: 0
Views: 1219
Reputation: 2384
There are 2 solutions.
1°) Display a dropdown selection in every one of these places. To let user choose size.
2°) Define a global rule to define the default size to select (like the smallest in stock, or always the 'M', etc.) you may have a rule for every attribute set if needed. Then modify these area to show information of the configurable except price and add to cart button that are taken from the "default" simple product, the one with the default attribute value.
!! Be sure to always have a default size (ie. your rule have some 'else'/'catch' part to always find a size even if 'M' doesn't exist or isn't in stock).
There is no code here, choose a solution, try to do it and if you're unsuccessful someone (incl me) will help you.
Upvotes: 1