0
votes

To be able to add content to the product page I created a page for each product and displayed them with the shortcode [product_page id="20"].

My own product page url is online-shop.de/my-product-1/

The product page of woocommerce is online-shop.de/product/my-product-1/

So to always keep the user on my editable product page I have a redirect which redirects /product/my-product-1/ to /my-product-1/ but my problem now is because of the redirect I can't add the product to the shopping cart anymore. How can I fix this?

1

1 Answers

0
votes

Solution was to use the wp_safe_redirect() function of wordpress instead of a permanent 303 redirect (with WP Plugin called Redirects). To do this i build the new url by getting the product url and building it again without the "product" directory and use it as parameter in the wp function wp_safe_redirect($newUrl)