This thread is resolved. Here is a description of the problem and solution.
Problem:
Display onsale custom shortcode
Solution:
To get the product object based on the current post in the view's loop, I've added the following line of code as you can see with the above shortcode:
Tell us what you are trying to do?
I have created a shortcode which takes the product regular price and sale price, and then display the percentage of the promotion:
It seems to work correctly except that the value of the percentage is displayed on the next product of the loop, please see screenshot for better understanding.
Can you please share problem URL as well as access details. Also, please share where you added the custom shortcode you created.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.