Customizing WooCommerce Product Fields and Help Tips in WC Vendors Pro Dashboard
-
I’m using the WC Vendors Pro Dashboard and have utilized
WCVendors_Pro_Form_Helper
to display input fields for Foo Events within the WC Vendors dashboard. However, I the default values are loaded for the following fields of the Woodmere product:- Product Name
- Product Description
- Product Short Description
- Categories
- Featured Image
I want to change the default label values for these fields and also update the “Add Product” title to “Add Event.” Additionally, I need to add a help tip icon that shows a tooltip with text when hovering over specific labels.
Although I used WordPress hooks to achieve this, it hasn’t worked as intended. Here are the hooks I implemented:
edit_form_after_title
: For the Product Name.edit_form_after_editor
: For both Product Description and Short Description (this displays below the editor).woocommerce_product_options_categories
: Specifically for the Categories section.post_submitbox_misc_actions
: For the Featured Image, since it is rendered in a different area.
Here’s the code I used:
- Change Labels for Product Descriptions:
add_filter('woocommerce_product_data_tabs', 'custom_product_description_labels'); function custom_product_description_labels($tabs) { $tabs['general']['labels']['description'] = __('Custom Product Description', 'wcvendors-pro'); // Change the label $tabs['general']['labels']['short_description'] = __('Custom Short Description', 'wcvendors-pro'); // Change the label return $tabs; }
2. Custom Help Icon for Product Description:
add_action('edit_form_after_editor', 'custom_product_description_help_icon');
function custom_product_description_help_icon() {
global $post_type;
if ($post_type === 'product') {
echo '<h3>' . __('Product Description', 'woocommerce') .
' <span class="help-tip-icon" title="' . __('Enter the detailed description of the product.', 'woocommerce') . '">?</span></h3>';
}
}Appreciate your assistance. Thank you!
- You must be logged in to reply to this topic.