I need help to add the custom data in the front end of the product just like this:
This image is a sample if PD # i just add and i want it to add in the front end of the product:
Just done adding a the custom field in WooCommerce product pages general setting tab, with the help of: How to add a Custom Fields in Woocommerce 3.1 thanks @Ankur Bhadania.
Thanks
For simple products your product
'_pd_number'
custom field in simple product pages before add-to-cart, usingwoocommerce_before_add_to_cart_button
action hook this way:Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested on WooCommerce version 3+ and works.
You can also output your product custom field in the cart items below the name, using
woocommerce_cart_item_name
filter hook this way:Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested on WooCommerce version 3+ and works.
Here the code I have use from he provided link in comments just for testing:
Related answer: Override External Product URL to "Add to Cart" product button
For display custom product meta in signal product page used 2 hook. used any of one as per your requirement.