Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

woocommerce show data to cart page

add_filter( "woocommerce_get_item_data", "cs_get_item_data", 10,2 );
function cs_get_item_data( $data, $cart_item ){
  if ( isset( $cart_item['singleFood'] ) ) {
    $data[] = array(
        'name'    => 'Choosen Custom Food Items',
        'value'   => sanitize_text_field( $cart_item['singleFood'] ),
      );
  }
  return $data;
}
 
PREVIOUS NEXT
Tagged: #woocommerce #show #data #cart #page
ADD COMMENT
Topic
Name
9+4 =