fields are not shown in my theme
-
Hi
unfortunately your great plugin does not work with my theme TheGem ??
This is now the 3rd plugin which do not show the meta fields in my theme but the plugin I liked most in backend.
Would be great if you can help me!Sometimes my theme use other field names then standard woocommerce but I insert one fixed custom meta field in cart and chekcout from a hidden field in my product page with this hook.
// save to cart function save_custom_data_hidden_field( $cart_item_data, $product_id ) { if( isset( $_REQUEST['myVehicle'] ) ) { $cart_item_data[ 'myVehicle' ] = $_REQUEST['myVehicle']; /* below statement make sure every add to cart action as unique line item */ $cart_item_data['unique_key'] = md5( microtime().rand() ); } return $cart_item_data; } add_action( 'woocommerce_add_cart_item_data', 'save_custom_data_hidden_field', 10, 2 ); //Insert to Cart & Checkout Page function render_meta_on_cart_and_checkout( $cart_data, $cart_item = null ) { $custom_items = array(); if( !empty( $cart_data ) ) { $custom_items = $cart_data; } if( isset( $cart_item['myVehicle'] ) ) { $custom_items[] = array( "name" => 'Typ',"value" => $cart_item['myVehicle'] ); } return $custom_items; } add_filter( 'woocommerce_get_item_data', 'render_meta_on_cart_and_checkout', 10, 2 );
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘fields are not shown in my theme’ is closed to new replies.