• I have this plugin setup with a variable product. We have all but one variation where we want an “Any Text” add-on box to appear. Visually, everything works fine. However, whenever an order is placed on this product that has info in the “any text” variation, the text does not show up in the cart or in the order.

    Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @axelseaa, Is that option created using Our plugin?

    Thread Starter Aaron Axelsen

    (@axelseaa)

    I have the “Product Add-Ons” from Woo setup, and am using your plugin to hide those options on all but a single variation on this product. When that variation is selected, it does show the add-ons correctly on the front end, however the text value entered is no longer saved and passed along to the cart / order process.

    Thread Starter Aaron Axelsen

    (@axelseaa)

            
    function woocommerce_add_cart_item_data( $cart_item_data, $product_id, $variation_id )
            {
                $add_ons = get_post_meta( $variation_id, '_variable_add_ons', true );
                if( $add_ons == 'no' ) $cart_item_data = '';
                return $cart_item_data;
            }
    

    Based on my review of the plugin, when “add_ons” is true / yes, that essentially means that products add_ons should be disabled for that variation – correct? With that logic, I believe there is a bug and the above function should actually be:

    
            function woocommerce_add_cart_item_data( $cart_item_data, $product_id, $variation_id )
            {
                $add_ons = get_post_meta( $variation_id, '_variable_add_ons', true );
                if( $add_ons == 'yes' ) $cart_item_data = '';
                return $cart_item_data;
            }
    

    This did correct the issue that I was seeing with my site. Hopefully this helps someone else as well!

    Thanks, wee will look into that and see if we need to make any adjustments .

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue with “Any Text” Product Add-On’ is closed to new replies.