Hooks
-
Where can I find the hooks for the Side Cart? I added a “custom item data” that is now displaying correctly at the regular cart, but it’s not showing at the side cart… How can I add the filter so the data is displayed similarly?
Below is a filter that creates a “Weight subtotal” that is not showing at the side cart.
Thanks in advace.
add_filter( ‘woocommerce_get_item_data’, ‘display_custom_item_data’, 10, 2 );
function display_custom_item_data( $cart_item_data, $cart_item ) {
if ( $cart_item[‘data’]->get_weight() > 0 ){
$cart_item_data[] = array(
‘name’ => __( ‘Weight subtotal’ , ‘woocommerce’ ),
‘value’ => ( number_format($cart_item[‘quantity’] * $cart_item[‘data’]->get_weight(),1) ) . ‘ ‘ . get_option(‘woocommerce_weight_unit’)
);
}
return $cart_item_data;
}
The topic ‘Hooks’ is closed to new replies.