Hello, welcome to therichpost.com. In this post, I will tell you WOOCOMMERCE: ADD WHOLESALE PRICE IN ADMIN PRODUCT PAGE. WordPress is the best cms and Woocommerce is the best Ecommerce plugin. WordPress hooks(add_action, add_filter) give us the power to edit or change the code without interruption into the files and this is the best thing about wordpress. Now I am going to tell you how the hooks work.
Image of Wholesale Price:
Here is the working code for WOOCOMMERCE: ADD WHOLESALE PRICE IN ADMIN PRODUCT PAGE and you need to add this code into your theme’s functions.php file:
// CHANGE SALE PRICE LABEL TO SELLING PRICE & CHANGE REGULAR PRICE LABEL TO RRP
global $woocommerce, $post;
echo ‘<div class=”options_group”>’;
‘id’ => ‘_wholesale_price_field’,
‘label’ => __(‘Wholesale Price($)’, ‘woocommerce’) ,
‘placeholder’ => ”,
‘description’ => __(‘Enter the wholesale price here.’, ‘woocommerce’) ,
‘type’ => ‘number’,
‘custom_attributes’ => array(
‘step’ => ‘any’,
‘min’ => ‘0’
$woocommerce_number_field = $_POST[‘_wholesale_price_field’];
if (!empty($woocommerce_number_field)) update_post_meta($post_id, ‘_wholesale_price_field’, esc_attr($woocommerce_number_field));
There are so many hooks in woocommerce and i will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com
You Might Also Like
Hello to all and welcome on therichpost.com. In this post, I will tell you, How to add custom field in...
Hello to all, welcome to therichpost.com. In this post, I will tell you, Woocommerce hook add html to single product...