Forum

Thread tagged as: Question, Shop

Checkbox in product template to add another product

Hello,

I am using the Shop App and I would like to be able to add extra products (not variants) from the product page. So for example if I am selling a bike, I would like a checkbox to also add a bikelock on the product page, so when checkbox is checked I add to cart > A bike and a lock will be added to the cart. What would be the best solution for this?

Thanks, Mike

Mike Hendriks

Mike Hendriks 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Mike,

You may have to use perch_shop_add_to_cart() to programmatically add the products to the cart:

https://docs.grabaperch.com/addons/shop/examples/add-to-cart-php/