Post by adamdanial » Mon Mar 03, 2014 7:40 pm

Hello opencart community,

I need your help. Actually i want to know a way to add all related products to cart with product. for example I have a product Apple Cinema 30" which has 2 related products 1. Iphone and 2. imac. Now what i want?

When i click on add to cart button on Apple Cinema 30 both related product should also add to cart. so total 3 product will add to cart. can anyone help me to do this. I am not require any commercial extension. Please help me for free as well as others users who want to add this functionality to their site.

thanks in advance

Newbie

Posts

Joined
Fri Dec 13, 2013 6:06 pm

Post by Vytenis » Mon Mar 03, 2014 7:44 pm

if this is limited amount of products and you know their ids, you can alter the .tpl (product.tpl, category.tpl) and notice the call for add product. Add there the needed IDs.

How ever this is a workaround and will work only with a small amount of products. If you need an automated solution:
Either go on jQuery/javascript functions to catch the related products and initiate addToCart calls for them or you need to rewrite the addtocart function controller. How ever this might fuck up if you have some products where you want to have related products, but not add those to cart.

New member

Posts

Joined
Mon Aug 01, 2011 1:33 am

Post by adamdanial » Tue Mar 04, 2014 3:15 pm

Vytenis wrote:if this is limited amount of products and you know their ids, you can alter the .tpl (product.tpl, category.tpl) and notice the call for add product. Add there the needed IDs.

How ever this is a workaround and will work only with a small amount of products. If you need an automated solution:
Either go on jQuery/javascript functions to catch the related products and initiate addToCart calls for them or you need to rewrite the addtocart function controller. How ever this might fuck up if you have some products where you want to have related products, but not add those to cart.

I need a automated solution where can i add related products add to cart with specific product. i have a list of huge amount of products. can you write me the code? ???

Newbie

Posts

Joined
Fri Dec 13, 2013 6:06 pm
Who is online

Users browsing this forum: No registered users and 33 guests