Custom product data field(panel) not showing on Vendor frontend
-
Hi, we are using Woocommerce Simple Auctions plugin and they have a custom product data tab called Auctions which shows up fine on the Vendor frontend. Now, we have added a custom field (panel) in the Auctions tab and it shows on the backend, however, the field does not show on the Vendor frontend. Can you help us with this?
Backend custom field: https://prnt.sc/15ej56f
Vendor frontend: https://prnt.sc/15ej8qcThis is the code that we used in adding the custom field to the Auctions tab:
add_action('woocommerce_product_options_auction', 'add_my_custom_product_data_fields'); function add_my_custom_product_data_fields() { woocommerce_wp_select( array( 'id' => '_auction_vehicle_soldas', 'label' => __( 'Vehicle Sold as', 'wc_simple_auctions' ), 'options' => array( '' => 'Please select', 'asis' => 'As Is', 'safetied' => 'Safetied'), ) ); } add_action('woocommerce_process_product_meta', function($post_id) { $product = wc_get_product($post_id); $auction_vehicle_soldas = isset($_POST['_auction_vehicle_soldas']) ? $_POST['_auction_vehicle_soldas'] : ''; $product->update_meta_data('_auction_vehicle_soldas', sanitize_text_field($auction_vehicle_soldas)); $product->save(); });
- The topic ‘Custom product data field(panel) not showing on Vendor frontend’ is closed to new replies.