Redirect Woocommerce add to cart to Product page

Hi,

I used the necessary Woocommerce code to add a product to the cart within the rev slider action setting. How do I get it to redirect automatically to that particular product page once the item is actually added to the cart? Right now it adds to the cart and does show an item in the cart, but does not go to the product page at all. Once I click the add to cart button the page refreshes only. How can I change this? The website isn’t live just yet so I will create a secure note.

Hello @fantasy_5,

Thanks for writing to us.

If you add “Add To Cart” shortcode to button link it would only cart product and the product will be displayed in the cart. To link the button to any page you need to select “Action Type” as “Simple Link” then add page URL. I checked your site Dashboard as I can see you have set the link properly. It is taking you to shop page on button click event since you have added shop page URL.

Thanks

Hi, Prakash_s

When I add the item to the cart it does add but refreshes on that same page and does not redirect to the shop page, which is fine. I don’t have an actual URL set as the link at present only the woocommerce add to cart code in place of the link URL for that particular slider as in my screenshot above. I do notice after I add the item to the cart if I visit a particular page this shows up there that’s the main reason I was asking about redirection to the product page. In reality, I’m ok with it just adding to the cart. I just do not wish to wish to receive this message when visiting another page. if this message does need to appear by default can it appear on the actual page where the product was purchased?

Hi @fantasy_5,

The Added to Cart notice is a WooCommerce notice and will only show in WooCommerce pages, even if you added the Product from a different page. If you want that to removed, it will affect the WooCommerce notice too.
If you wish to do so, it needs customization and beyond the scope of our theme support. I would suggest you hire a developer who can assist you to do the customization or you can avail of our newly launched service called One, where the customization questions are answered.
You can also go through this article which may help you:

  1. https://stackoverflow.com/questions/34645095/remove-hide-woocommerce-added-to-cart-message-but-keep-display-coupon-applied-me
  2. https://njengah.com/woocommerce-remove-has-been-added-to-your-cart-message/

Please remember that we don’t offer any support to the custom codes or related issues.

Thanks

Hi,

I was able to add the woocommerce short snippet of code to my functions.php and it did the trick. With both codes added I received an error message. Thank you!

Hi @fantasy_5,

Great that it resolved now.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.