Add „attribute“ to cart
-
hi there, can anyone help me with the „code“ for this:
//the following code works and adds the Purchase note to the carts items.
//I need to add a specific attribute aswell under the NOTE.
add_filter( ‚woocommerce_get_item_data‘, ‚wc_test‘, 10, 2 );function wc_test ( $other_data, $cart_item )
{
$post_data = get_post( $cart_item[‚product_id‘] );
$other_data[] = array( ’name‘ => $post_data->_purchase_note );
return $other_data;
}——
Also I always get „:“ as a Result for the Note @ all products that dont have a note :SKind Regards
Dave
Ansicht von 1 Antwort (von insgesamt 1)
Ansicht von 1 Antwort (von insgesamt 1)
- Das Thema „Add „attribute“ to cart“ ist für neue Antworten geschlossen.