newsletter emailing

Stay on top with regular WordPress updates.

Subscribe to our newsletter(s) and get the latest stories in your mailbox!

How to Automatically Add Upsell Products to Cart via Custom Link in WooCommerce?

Date:

When running marketing campaigns or BOGO “Buy One Get One” promotions, store owners may create specific URLs with upsell products to encourage customers to add complementary items to their carts. With this customization, you can automatically add the upsell products to the cart which will entice customers to purchase additional items in your WooCommerce store.

The provided code works well for adding upsell products to the cart via a URL parameter and the typical URL parameter is as follows: http://yourwebsite.com/?add-upsells-to-cart=PRODUCT_ID

add_action( ‘wp_loaded’, ‘bulk_upsell_add_to_cart_action’, 20 ); function bulk_upsell_add_to_cart_action() { if ( ! empty( $_GET[‘add-upsells-to-cart’] ) ) { $product_id = absint( $_GET[‘add-upsells-to-cart’]

This is the first part of the article

How to Automatically Add Upsell Products to Cart via Custom Link in WooCommerce?

wpforms banner 01 468x602x