Auto add accessory product to cart or after checkout

bmahk
New Member
2 0 0

I've seen a few conversations about this, but can't seem to find a solution that works. I'm looking to avoid any third party apps. We have a product that requires an accessory box to be shipped with it. When fulfilling the order, our warehouse employees have to manually add this additional (free) accessory box product so that a shipping label can be printed and tracked for both the main product and the accessory box. This is easy, but when you have 500 orders to fulfill in one day...  it's a lot of extra time. 

My hope is to either 1) when purchasing product A, have product B automatically add to the cart. I've found some possible solutions on github, but they don't seem to work. Not sure if my theme, Empire, utilizes Ajax in some capacity? Or 2) On the backend after checkout, have this product automatically set up as two boxes prior to fulfillment. 

Any insight would be greatly appreciated. 

 

 

0 Likes

@bmahk 

This is fairly simple to do using something AJAX & something like CartJS.

For the sake of simplicity let's say that:

- original product is A
- the free, extra product is B.

The workflow would basically be:

1. Check if the user is on product A page;
2. If so, listen for clicks on the ATC button.
3. Whenever there's a click, add the extra product B * the quantity chosen for the product A.

You can shoot me an e-mail if you need help.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes