PHP - Woocommerce - Get custom notes on Admin Order page
€8-30 EUR
Closed
Posted over 4 years ago
€8-30 EUR
Paid on delivery
I use this script on [login to view URL] of theme to register a custom note in the product:
// Set custom data as custom cart data in the cart item
add_filter( 'woocommerce_add_cart_item_data', 'save_custom_data_in_cart_object', 30, 3 );
function save_custom_data_in_cart_object( $cart_item_data, $product_id, $variation_id ) {
if( ! isset($_GET['custom_tipo']) )
$custom_tipo = esc_attr( $_GET['custom_tipo'] );
$cart_item_data['custom_data']['custom_tipo'] = esc_attr( $_GET['custom_tipo'] );
return $cart_item_data;
}
// Optionally display Custom data in cart and checkout pages
add_filter( 'woocommerce_get_item_data', 'custom_data_on_cart_and_checkout', 99, 2 );
function custom_data_on_cart_and_checkout( $cart_data, $cart_item = null ) {
if( $cart_item['custom_data']['custom_tipo']>'' )
$cart_data[] = array(
'name' => 'Tipo',
'value' => $cart_item['custom_data']['custom_tipo']);
}
This note apperars on Cart, but doesn't appear on Order details, or aren't send on emails. How can I get this notes on Orders? Example: How I get the custom note on this file /wp-content/plugins/woocommerce/includes/admin/list-tables/[login to view URL]
Hello. Wordpress development expert ready to help you with issue fix. I have more 400 good reviews and more 9 years of development experience behind, so all will be done with best quality and timeframe.
Free bugfixing support.
We can always make deal on price.
Tnx, and hope to hear you soon.
Hi,
My name is Heorhii (George), I've read the description and everything looks clear, except do you need an advice or someone to do the actual changes? Please contact me via chat.
Thanks,
George
I can fix............... ......
Please give me opportunity to work with you............................................................................................
Thank you