Can’t use updated variables in handle function

A huge thanks to @JacobPeattie We should pass the url to data function and retrieve it using _POST so the main file will be: <?php /* Plugin info… */ class Example_Background_Processing { protected $process_single; public function __construct() { add_action( ‘plugins_loaded’, array( $this, ‘init’ ) ); add_action( ‘woocommerce_add_to_cart’, array($this, ‘add_to_cart_callback’), 10, 2); } public function init() … Read more

Add different sizes packaging boxes to orders plugin

Definitely a job for a plugin! I haven’t used it personally, but it looks like Auto Add Product to Cart can do the job for you. From the description: You can use conditions like “cart subtotal”, “products in cart”, “categories in cart”, “money spent history”, “purchase history”, “quantity of products in cart”, “quantity of categories … Read more