6.2 community edition to develop an apparel site where each product is available in various sizes, hence all products are added as configurable products. Tshirt size is a required attribute and is set as a dropdown with its first value as Select A Size. When add to cart is clicked from the product page, whether this attribute is selected or not is rightly checked. I have also added a ADD TO WISHLIST button to the product view page. But add to wishlist does not check the required field - attribute set. It just directly adds the configurable product to wishlist without its required attribute size.
QS: How do i make sure that like ADD TO CART, the add to wishlist button first checks whether or not the Tshirt size is selected, and if selected only then go and add it to wishlist. Otherwise, give an error .... like in the case of Add To Cart that the Tshirt Size is required..
thanks Moody
Navigate to /app/design/frontend/<YOUR_PACKAGE>/<YOUR_TEMPLATE>/catalog/product/view/addto.phtml
and change productAddToCartForm.submitLight
to productAddToCartForm.submit
. The full line is:
<li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, '<?php echo $_wishlistSubmitUrl ?>'); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
Change it to:
<li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submit(this, '<?php echo $_wishlistSubmitUrl ?>'); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>