Stay on top with regular WordPress updates.
Subscribe to our newsletter(s) and get the latest stories in your mailbox!
Stay on top with regular WordPress updates.
Subscribe to our newsletter(s) and get the latest stories in your mailbox!
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