• Resolved alexandrefuchs

    (@alexandrefuchs)


    Hello,
    I use Divi Engine Body commerce on my shop.
    I added a custom field on my products with Product Input Fields for WooCommerce.
    This field is displayed well via the shortcode on my product page but however the value is not saved in the cart.
    If I disable Divi Engine Body it works fine.
    So I’m looking for a solution so that, via the shortcode, this field works and the value is saved in the cart and in the order.
    Do you have a solution or do you know the hook that is used?
    With the PP Summary module of the Divi Engine Body product it works … But I can’t use this module for my layout.

    Thanks to you !

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support oluisrael

    (@oluisrael)

    Hi @alexandrefuchs can you try the code snippet below and let me know if that works?

    add_action( 'woocommerce_before_calculate_totals', 'getcustomfield', 10, 1 );
    function getcustomfield( $cart ) {
        foreach ( $cart->get_cart() as $cart_item ) {
            $customfield = $cart_item['alg_wc_pif_global'][0]['_value'];
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Wich Hook for this plugin’ is closed to new replies.