As per german PAngV rules and regulations the additional shipping costs and delivery status must be shown below the price and for that I am using below code in the fun php , but with that code the set words also appear near the virtual and digital product price , please advice me to remove that from digital and virtual products.
The code you’re using is adding the shipping costs and delivery status to all products, including virtual and digital ones. To exclude these products, you need to modify the function to check if the product is virtual or digital before adding the text. Here is the updated code:
Please note that we don’t provide support for code customization as per our support policy. In the future, if you need assistance with coding, we recommend asking on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.
I hope this helps! Please let us know how it goes or if you need further assistance.
Dear Shameem, thank you so much for the code you’ve given.
While this code works well for virtual and digital products, it does not function as intended for VARIABLE virtual and digital products. I am seeking your expertise to help modify this code to also work seamlessly with VARIABLE virtual/digital products.
I respect your support .org policy and will certainly consider seeking assistance from Stack Developers in the future but your insights and guidance on this specific matter would be greatly appreciated.
I’m glad to hear that the code works for simple products! However, you’ll need to slightly adjust to make it work with variable product types. Here’s the modified code that you may use:
I tested it on my testing site and everything works perfectly as expected:
As previously mentioned, we don’t provide support for code customization as per our support policy. For future coding inquiries, please consider asking on the #developers channel of the WooCommerce Community Slack.
I hope this helps! Please let us know how it goes or if you need further assistance. Thanks!