All Collections
General Overview
Switch a widgets add to cart buttons to product page redirects
Switch a widgets add to cart buttons to product page redirects

You can send customers to the product page from a widget instead of adding the product to the cart.

Jason Khan avatar
Written by Jason Khan
Updated over a week ago

There are certain products that require customization directly on their product page and cannot be added to the cart directly from a widget. In this situation, you have two available choices.


Exclude Products

You can exclude those items from being returned by the widget using the data source exclusion filters.

Custom Code Workaround

By incorporating this code into the widget, the buttons will be configured to redirect the user to the product page, rather than adding the item to the cart. Take the code provided below and paste it into the "Advanced" > "Ready" section of the widget. Afterward, remember to click on the "Save" button to preserve the changes.

/* Make widget ATC buttons redirect to product page */
setTimeout(() => {
const items =;
const widgetButtons = document.querySelectorAll(`#rebuy-widget-${} .rebuy-button`);
widgetButtons.forEach((btn, index) => {
const newBtn = btn.cloneNode(true)
newBtn.addEventListener("click", () => {
window.location.href = items[index].link
}, 400)

Once you have successfully pasted the given code into the widget's "Advanced" > "Ready" section and saved the changes, the buttons in the widget will be modified. Instead of adding the item to the cart when clicked, they will now redirect the user to the corresponding product page. This way, users can view the product details and customize it as needed before making a purchase.

To complete the process, you need to adjust the language of the widget's button. Follow these steps:

  1. Open the widget settings.

  2. Look for the "Language" tab or section in the widget settings.

  3. Find the option that allows you to change the text for the "Add to Cart" button.

  4. Edit the text to say whatever you prefer, for example, "View Details" or "Customize Now."

  5. Save the changes in the widget settings.

By doing this, the button language will be updated, and it will now display the new text you've set, aligning with the functionality change to redirect users to the product page instead of adding the item directly to the cart.

Did this answer your question?