This topic has 8 replies, 3 voices, and was last updated 7 years, 11 months ago ago by Rose Tyler
In my product description text I have the following code for a size chart button that, when clicked, opens up a new smaller new window with the size chart for that item.
<button onclick=”myFunction()”>View Size Chart</button>
<script>
function myFunction() {
var myWindow = window.open(“http://www.thegirlway.com.au/wp-content/uploads/2016/11/Screen-Shot-2016-12-08-at-6.25.50-PM-1-1024×528.png”, “”, “width=663,height=300”);
}
</script>
The button works fine, however when I edit the product in any way (title, picture, price, quantity ect) it changes the first line of code to <button>View Size Chart</button>, so when you click the button it does nothing. If I change the code back to the original coding the button works again as normal.
This is happening with every single one of my products that have a size chart. I also use a few different size charts and it is happening with all of them so doesn’t appear to be related to the image itself.
Can you advise why this piece of code would be automatically changing when I edit the product and also how I can prevent this from happening every time I edit a product.
Thanks
Hello,
Please provide us with WP Dashboard credentials in private content.
Best regards,
Jack Richardson.
Hi, please see below.
Thanks
Hello,
Please show a page where you added that code.
Thank you.
Best regards,
Jack Richardson.
Oh, so sorry about that! I meant to include it for you and then got sidetracked and forgot!
I’ve added the link to the private content
Hello,
I’ve updated the page several times and the button code wasn’t changed.
Please check now.
Best regards,
Jack Richardson.
Yes, this seems to be working now. Thank you for your assistance.
Hello,
You’re welcome!
Regards,
Rose Tyler.
The issue related to '‘product text changing when product edited’' has been successfully resolved, and the topic is now closed for further responses