hi Sven
Do you use “Summary by products” mode ?
thanks, Alex
Hello Alex
I’ve tried to ‘setup fields for export’ and also the ‘express export’ with ‘summary by products’.
With ‘setup fields for export’ i get one row for each variation and a total weight based on orders.
And ‘express export’ with ‘summary by products’ i get a better grouped view but also one row for every variation without the total weight.
I would like to use the ‘express export’ with ‘summary by products’ to get only the calculated total weight for each product (within all variations).
Perhaps you have a code snippet? I also can ‘setup another field for export’.
Thank you!
Sven
hi Sven
please, use mode “Summary by products”
1. open “Setup Fields”, click “Add field” , type “total_weight” in text input and add new field to export
2. open “Misc Settings” and put following PHP code.
thanks, Alex
//group variations
add_filter( "woe_summary_products_adjust_key", function($key, $product, $product_item, $order ){
return $product_item['product_id'];
},10,4);
// sum weights
add_action( "woe_summary_products_add_item", function($key, $product_item, $order ){
$product = $product_item->get_product();
if($product ) {
$_SESSION['woe_summary_products'][$key]['total_weight'] += $product->get_weight() * $product_item['qty'] ;
}
},10,3);
hey Alex,
wonderful! works like charme.
te just bought your pro version to use profiles, too!
thanks for your great support!
best, Sven
just one more little thing:
the output column ‘product name’ has a variation weight added to the name.
example:
name total_weight
antigua - 500g 2500
yellow bourbon - 250g 1750
nice to have:
name total_weight
antigua 2500
yellow bourbon 1750
thanks again,
Sven
-
This reply was modified 6 years, 1 month ago by
sventertain.
hi Sven
Please, upload your settings (as .txt file) to https://algolplus.freshdesk.com/
Use tab Tools to get them.
thanks, Alex