• Resolved diginamix

    (@diginamix)


    Hi There,

    We’re using Product Add‑Ons Ultimate Pro (to generate child products) along with Flexible Product Fields for student name fields. Our previous snippet—using _composite_childs to hide duplicate “Student’s First Name” and “Student’s Surname” fields on child products—no longer works. Could you advise which meta key or method we should use now to hide these duplicate fields?

    The previous snippet was as follows:

    if (!function_exists(‘hide_duplicate_addon_fields’)) {

    /**
     * Hide duplicate addon field entries in the cart.
     *
     * @param bool  $visible   
     * @param array $cart_item 
     * 
     * @return bool Modified visibility status.
     */
    function hide_duplicate_addon_fields($visible, $cart_item) {
        $product_id = $cart_item['product_id'];
        $is_composite = get_post_meta($product_id, '_composite_childs', true);
    
        if ($is_composite) {
            $visible = false;
        }
    
        return $visible;
    }

    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support krzysztofskorupa

    (@krzysztofskorupa)

    Hi,
    thank you very much for your contact.

    I don’t quite understand.
    As far as I can see, the function takes meta data from another plugin.
    Is this function plugged into the Flexible Products Fields filter?
    Composite_child does not come from our plugin.
    I would appreciate additional clarification on how the logic of this scheme works so I can get a better look at the problem.
    If there is a possibility, I would also appreciate if you could provide a page address or screenshots where I can see exactly how this works.

    Regards,

    Thread Starter diginamix

    (@diginamix)

    Good Day,

    Thank you for getting back to me. Here is a screenshot of the cart and product page for a better understanding.
    CART: https://snipboard.io/Xz1Oe6.jpg
    PRODUCT: https://snipboard.io/ZJ62l3.jpg

    Within the screenshot you will see that “Bateleur College Grade 4” is the main/parent product, and the textbooks/products in the cart below the parent are “child products” which I use WooCommerce Product Add Ons Ultimate – Plugin Republic (https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/) – this is where I believe the “Composite_child” comes from.

    Flexible Product Fields (by WP Desk) is used to collect the student’s first name and surname on the parent product. The issue is that these student fields are also appearing on every child product line (in the cart and order), causing duplicate data. We want to “hide” the fields or meta data from (Child name & surname) from displaying in each child product.

    Plugin Support krzysztofskorupa

    (@krzysztofskorupa)

    Hi,
    Thank you for the additional clarification.

    We do not declare support for the plugin you are using to display subordinate and parent products.

    In the code you uploaded earlier, you can’t see the dependency between the code from our plugin.

    If you want any specific thing from our plugin, or where there is any information then let us know. I will try to help you. Perhaps this will make it easier for you to improve your code.

    Regards,

    Plugin Support krzysztofskorupa

    (@krzysztofskorupa)

    Hi,
    I have not received information for some time.
    At this point, let me close the thread.
    However, if you still have any questions, please let me know or contact me again.

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Product Items Duplication’ is closed to new replies.