• Hello,

    Is there any way to break up the metadata of the product into individual columns? So if a product is a Levi’s Jean in a 36×30 Medium Stonewash, I’d like 36, 30, and Medium Stonewash in different columns on their own.Let me know what is possible.

    Best,
    Jeff

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi Jeff

    Please, use >Setup Fields>Product order items>button “Add Field”.
    You should see meta keys in the dropdown.

    thanks, Alex

    Thread Starter jeffatrmc

    (@jeffatrmc)

    Hi @algolplus

    This is good to know and close to what I was looking for. We have a lot of different products with different metadata sets. Instead of putting every possible metadata option in its own column(20+ columns), is there any way to have the system recognize and output the different metadata values in their own columns?

    So for example, there would be three columns labeled Metadata 1, metadata 2, etc with the values of each metadata per product.

    The P Order Item Metadata field already separates these metadata values by a | so I’m really wondering if there is any way to have them separated into different columns instead of just adding a | in between them.

    Best,
    Jeff

    Plugin Author algol.plus

    (@algolplus)

    hi Jeff

    please, follow to https://algolplus.freshdesk.com/support/solutions/articles/25000018287-add-calculated-field-for-product-

    add keys metadata_1,metadata_2,metadata_3 (add more if it’s necessary!)
    and use this PHP code.
    thanks, Alex

    add_filter( 'woe_fetch_order_product', function($row, $order, $item, $product, $item_meta) {
    	$metas = WC_Order_Export_Data_Extractor::get_product_variation( $item, $order, $item->get_id(), $product );
    	$metas = explode("|", $metas);
    	foreach($metas as $pos=>$meta){
    		$key = "metadata_" . ($pos+1);
    		if(isset($row[$key]))$row[$key] = $meta;
    	}
    	return $row;
    },10,5);
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Item Meta Data’ is closed to new replies.