stranyer
Forum Replies Created
-
Forum: Plugins
In reply to: [Checkout Upsell Funnel for WooCommerce] Limit products you can add to cartMy client has the pro version, and I see the Products Quantity Limit, but that only affects how many of a specific product you can add to your cart.
What I need, is for ex: I have a funnel with 5 unique products to select, I want to limit the users to only be able to select 2 out of the 5. And it shouldn’t let you select a 3rd product.
What I did for a workaround is to modify function viwcuf_us_woocommerce_add_to_cart_quantity for:
if ( isset( $_REQUEST['viwcuf_us_product_id'] ) ) { $qty = isset($_REQUEST['quantity']) ? floatval(sanitize_text_field($_REQUEST['quantity'])): 1; // Determine the total number of upsell products already in the cart $current_upsell_products_in_cart = 0; foreach ( WC()->cart->get_cart() as $cart_item ) { if ( isset($cart_item['viwcuf_us_product']) ) { $current_upsell_products_in_cart += $cart_item['quantity']; } } // Check if adding the new products will exceed the limit of 2 if ($current_upsell_products_in_cart + $qty > 2) { wc_add_notice( __( 'Solo puedes agregar un máximo de 2 productos.', 'woocommerce-checkout-upsell-funnel' ), 'error' ); return 0; // Do not add the product to the cart } return $qty; // Allow the product to be added to the cart }
- This reply was modified 1 year, 5 months ago by stranyer.
Gracias Edgar!
Please let me know how, or when is it gonna be fixed.
Thanks!Forum: Plugins
In reply to: [Extra Product Options Builder for WooCommerce] Error with Pricing in MapsThat’s ok, just figured a workaround, since it seems it would conflict with another plugin not really necessary.
However I’m trying to get the account info, so I can sent you a few request/doubts!Thanks!
Forum: Plugins
In reply to: [Extra Product Options Builder for WooCommerce] Error with Pricing in MapsEdgar, I sent you a message over Slack.
- This reply was modified 3 years, 12 months ago by stranyer.