Arsenal21 / simple-wp-shopping-cart

Repository for the simple WordPress shopping cart plugin
9 stars 13 forks source link

Items with ampersands (&) in the title are broken. #8

Open minerscale opened 1 year ago

minerscale commented 1 year ago

Version: 4.6.2

Hi, apologies about the multiple issues but this one is a goodie.

Items with ampersands in the title claim take you to the page which says that the user has tampered with the price field when you hit 'add to cart'

image

A simple workaround is to get rid of any of the ampersands obviously but if this issue could be worked out that would be fantastic.

Thanks very much, Aaron.

Arsenal21 commented 1 year ago

The ampersands (&) should be fine in the product name field of the shortcode. I tested with the following and it works fine.

[wp_cart_button name="Product & test" price="20.00"]

The issue you pointed out could be related to page caching. The following documentation should be helpful: https://www.tipsandtricks-hq.com/ecommerce/wp-shopping-cart-and-wp-super-cache-workaround-334

minerscale commented 1 year ago

Oh! How fascinating, that would explain the weird behaviour given that your code that I read through just sanitises the input immediately. Thanks for your help.