add custom fields to ean (existing and new)

Top WooCommerce & WordPress Plugins Forums EAN and Barcodes for WooCommerce add custom fields to ean (existing and new)

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #124274
    Angelo
    Participant

    Hi Support,

    I want to put extra information about the product on the EAN via custom fields.
    I dont get it working. For now i want this meta fields enabled:

    $warehouse = get_post_meta($product_id, 'usbs_stock_location_level_1', true);
    $rack = get_post_meta($product_id, 'usbs_stock_location_level_2', true);
    $shelf = get_post_meta($product_id, 'usbs_stock_location_level_3', true);
    

    i would like to have the warehouse locations printed on the barcodes extra fields on a single line format: for example like this: 1.1.1 (warehouse, rack,shelf)

    with a different plugin i implemented the meta fields like this:

    add_filter('wf_pklist_package_product_table_additional_column_val', 'wt_pklist_add_custom_col_vl', 10, 6);
    function wt_pklist_add_custom_col_vl($column_data, $template_type, $columns_key, $_product, $order_item, $order) {
        if ($columns_key == 'new_col') {
            $product_id = get_effective_product_id($_product);
    
            $warehouse = get_post_meta($product_id, 'usbs_stock_location_level_1', true);
            $rack = get_post_meta($product_id, 'usbs_stock_location_level_2', true);
            $shelf = get_post_meta($product_id, 'usbs_stock_location_level_3', true);
            // Bouw de locatie string op
            $location_str = "";
            if (!empty($warehouse)) {
                $location_str.='Warehouse: '.$warehouse.'<br>';
            }
            if (!empty($rack)) {
                $location_str.='Rack: '.$rack.'<br>';
            }
            if (!empty($shelf)) {
                $location_str.='Shelf: '.$shelf;
            }
            $column_data = $location_str;
        }
        return$column_data;
    }
    
    #124444
    Moshtafizur
    Moderator
    Plugin Support

    Hi there,

    I hope you are well today.

    I have passed your request to our development team. They will get back to you as soon as possible.

    Kind regards.

    #124497
    Tom Anbinder
    Moderator
    Plugin Support

    Hi, Angelo,

    Do you mean in the “EAN > Print” section? If that’s the case, I think what you need is our [alg_wc_ean_product_meta] shortcode:

    [alg_wc_ean_product_meta key="usbs_stock_location_level_1"]
    [alg_wc_ean_product_meta key="usbs_stock_location_level_2"]
    [alg_wc_ean_product_meta key="usbs_stock_location_level_3"]

    This should go in the “EAN > Print > Template” option.

    Please give it a try and let me know what you think.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.