Packing List – Woocommerce Product prices
-
I have a packing list that I’m using for my Woocommerce shop that I’m pulling in some info to. The problem I’m running into is that I am unable to find the proper variable to pull in individual product prices (rather than order total) from either the cart or checkout page. Are you able to provide any feedback on this code I’ve attached to do this? It works, but I’d like to modify to get each individual price rather than order total.
add_filter( ‘wf_pklist_package_product_table_additional_column_val’, wt_pklist_add_new_column_val’, 10, 6 );
function wt_pklist_add_new_column_val( $column_data, $template_type, $columns_key, $_product, $item,$order )
{
if($template_type==’packinglist’ )
{
if($columns_key==’new_col’)
{
$order_shipping_method = is_callable(array($order, get_shipping_method’)) ? $order->get_shipping_method() : $order->order_shipping_method;
$order_total=$order->get_shipping_method();
if(!empty($order_total))
{
$column_data=$order_shipping_method;
}
else
{
$column_data=’-‘;
}
}
if($columns_key==’new_col_2′)
{
$order_total = is_callable(array($order, get_total’)) ? $order->get_total() : $order->order_total;
$order_total=$order->get_total();
if(!empty($order_total))
{
$column_data=$order_total;
}
else
{
$column_data=’-‘;
}}
return $column_data;
}
}
- The topic ‘Packing List – Woocommerce Product prices’ is closed to new replies.