• Resolved kegobeer

    (@kegobeer)


    I installed the free version and I see that there are attributes in the product field on invoices and packing slips. Here is an example:

    GOOD THINGS ARE COMING - MEDIUM
    attribute : MEDIUM _square_item_variation_id :

    How can I get rid of the second line? I’ve installed another PDF invoice/packing list plugin and that information doesn’t show.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter kegobeer

    (@kegobeer)

    I found a custom function in another post and modified it:

    add_filter('wf_pklist_modify_meta_data', 'wf_modify_meta_data', 10, 2);
    
    function wf_modify_meta_data($meta) {
    
        // Below are the keys for bundled products - Change the array keys according to the needs
    
        $keys = array('attribute', '_square_item_variation_id');
    
        foreach ($meta as $id => $value) {
            if (in_array($id, $keys)) {
                if (isset($meta[$id])) {
                    unset($meta[$id]);
                }
            }
        }
    
        return $meta;
    }

    Is that the correct way to filter it out? When I use that code the info is gone, but the product item is not centered vertically in the block, almost like there is another line added.

    • This reply was modified 4 years, 5 months ago by kegobeer.
    Plugin Author WebToffee

    (@webtoffee)

    Hi @kegobeer,

    Please try using below code snippet:

    add_filter('wf_pklist_alter_settings', 'wt_pklist_remove_variation_data', 10, 2);
    function wt_pklist_remove_variation_data($settings, $base_id)
    {
    if($base_id=='wf_woocommerce_packing_list_invoice' || $base_id=='wf_woocommerce_packing_list_packinglist')
    {
    $settings['woocommerce_wf_packinglist_variation_data']='No';
    }
    return $settings;
    }
    Thread Starter kegobeer

    (@kegobeer)

    Thanks. That helps mostly center it vertically, which works for me.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @kegobeer,

    Great. Leave us a review if you like the plugin. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove attribute in product field’ is closed to new replies.