woocommerce show data to cart page

Solutions on MaxInterview for woocommerce show data to cart page by the best coders in the world

showing results for - "woocommerce show data to cart page"
Jet
13 Mar 2016
1add_filter( "woocommerce_get_item_data", "cs_get_item_data", 10,2 );
2function cs_get_item_data( $data, $cart_item ){
3  if ( isset( $cart_item['singleFood'] ) ) {
4    $data[] = array(
5        'name'    => 'Choosen Custom Food Items',
6        'value'   => sanitize_text_field( $cart_item['singleFood'] ),
7      );
8  }
9  return $data;
10}
11