Post by IbtesamUddin » Mon Nov 14, 2016 1:48 pm

Hye there! I am running a campaign on my store as "Buy 1 get 1 free". So i want to add 2 products at a time when user clicks ADD TO CART.
Waiting for your precious replies. Thanks in advance.

Newbie

Posts

Joined
Mon Nov 14, 2016 1:40 pm

Post by knowband.plugins » Tue Nov 15, 2016 5:05 pm

Do you want to add 2 products when a customer clicks on an add to cart button in email?

Below code is responsible to sent ajax request to add products. If you face issues to implement this code and need some help, feel free to contact us.

Code: Select all

$.ajax({
			url: 'index.php?route=checkout/cart/add',
			type: 'post',
			data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
			dataType: 'json',
			beforeSend: function() {
				
			},
			success: function(json) {
				if (json['redirect']) {
					location = json['redirect'];
				}

				if (json['success']) {
					
			}
		});

Regards,
Knowband Team

Opencart Plugins: Knowband Store
Email: support@knowband.com


User avatar
Active Member

Posts

Joined
Thu Aug 04, 2016 2:56 pm


Post by thekrotek » Wed Nov 16, 2016 4:44 am

IbtesamUddin wrote:Hye there! I am running a campaign on my store as "Buy 1 get 1 free". So i want to add 2 products at a time when user clicks ADD TO CART.
Waiting for your precious replies. Thanks in advance.
Have you tried changing Minimum Quantity value to 2 for products, participating in your campaign? They should be added to cart in minimum quantity.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by opencartmart » Wed Nov 16, 2016 5:18 pm

did you mean same product?

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 32 guests