Automatically Add Product to Cart on Visit
function g9_add_product_to_cart() { if (!is_admin()) { $product_id = 64; //replace with your own product id $found = false; //check if product already in cart if (sizeof(WC()->cart->get_cart()) > 0) { foreach (WC()->cart->get_cart() as $cart_item_key => $values) { $_product = $values[‘data’]; if…Continue reading