# Request a quote on product pages

**URL:** <https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411>\
**Category:** Ask the community\
**Tags:** code\
**Created:** [July 1, 2024, 8:36pm UTC](https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411 "2024-07-01T20:36:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Digital\_Gaming](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/digital_gaming/32/93762_2.png) [@Digital\_Gaming](https://forum.wixstudio.com/u/Digital_Gaming)\
**Post date:** [July 1, 2024, 8:36pm UTC](https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411/1 "2024-07-01T20:36:04Z")

</div>

Currently getting this error

 ![Screenshot 2024-07-01 223404](https://us1.discourse-cdn.com/wix/original/3X/6/3/632ccc9b4ab714b25219f102fa0bd1c6298d230d.png)

when running the following code

```javascript
import wixWindowFrontend from 'wix-window-frontend';
import wixLocationFrontend from 'wix-location-frontend';

let product;

$w.onReady(function () {
  initProductPage();
});

wixLocationFrontend.onChange((location) => {
  let newPath = location.path;
  if (newPath?.[0] === 'product-page') {
    initProductPage();
  }
});

async function initProductPage() {
  product = await $w('#productPage1').getProduct();
    $w('#productPage1').setAddToCartLabel('Request a Quote');
    $w('#productPage1').onAddToCart(onAddToCartHandler);
}

async function onAddToCartHandler(resume, cancel) {
  const data = await getProductInfo();
  wixWindowFrontend.openLightbox('Request a quote', data)
    .then((results) => {
      cancel();
    });
}

async function getProductInfo() {
  const quantity = await $w('#productPage1').getQuantity();
  const choices = await $w('#productPage1').getSelectedChoices();
  const customText = await $w('#productPage1').getCustomText();
  return {
    product: product,
    quantity: quantity,
    choices: choices,
    customTextFields: customText,
  }
}

```

any idea on how to fix ?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [July 1, 2024, 10:56pm UTC](https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411/2 "2024-07-01T22:56:13Z")

</div>

> [@Digital\_Gaming](#):
>
> `$w('#productPage1').setAddToCartLabel('Request a Quote');`

Where did you find this command? —\> **setAddToCartLabel(‘Request a Quote’);**`

1. I could not find such an API-Command.
2. And you never have imported a backend function with such a name.

So one more time the question…

Where does → **setAddToCartLabel()** \<— come from ?

Maybe you were looking for —\> [https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/cart/stores-to-e-commerce-cart-conversion-table](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/cart/stores-to-e-commerce-cart-conversion-table)

So it is normal that you get this error…  
 ![632ccc9b4ab714b25219f102fa0bd1c6298d230d_2_690x1161](https://us1.discourse-cdn.com/wix/original/3X/7/b/7b85e75f4b2160ec17683bdc76dcd6d1c9a8ec38.png)

---

<div class="post-metadata">

**Author:** ![CMSblocks.com](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/cmsblocks.com/32/93515_2.png) [@CMSblocks.com](https://forum.wixstudio.com/u/CMSblocks.com)\
**Post date:** [July 2, 2024, 5:34am UTC](https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411/3 "2024-07-02T05:34:11Z")

</div>

**I understand! You’re looking for a way to handle situations where customers might want a quote for a product instead of adding it directly to their cart.**

Wix Stores doesn’t have a built-in feature for this specific scenario, but here are a couple of approaches you can explore, keeping in mind that some users might prefer a clear choice between adding a product to the cart (in-stock) or requesting a quote (out-of-stock):

**1. Conditional Buttons (Advanced)**

- This approach requires some coding knowledge with Wix’s Velo development platform.
- You can create two buttons on your product page: “Add to Cart” and “Get Quote.”
- Use Velo to check the product’s stock level in real-time.
- Based on the stock availability:
  - If the product is in stock, the “Add to Cart” button is visible, and the “Get Quote” button is hidden.
  - If the product is out of stock, the “Add to Cart” button is hidden, and the “Get Quote” button becomes visible.

**2. “Get Quote” Button and Contact Form (Simple):**

- Add a custom button labeled “Get Quote” using the “Buttons” element in Wix Editor. This approach works regardless of stock availability.
- Create a dedicated contact form in Wix Forms.
- When users click the “Get Quote” button, it can either:
  - Pre-populate the contact form with relevant product information.
  - Or, simply open the blank contact form for users to fill out with additional details about their quote request.

---

<div class="post-metadata">

**Author:** ![Digital\_Gaming](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/digital_gaming/32/93762_2.png) [@Digital\_Gaming](https://forum.wixstudio.com/u/Digital_Gaming)\
**Post date:** [July 2, 2024, 4:18pm UTC](https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411/4 "2024-07-02T16:18:17Z")

</div>

Thanks tried your second suggestion and works perfectly for now

---

<div class="post-metadata">

**Author:** ![JD3\_wds](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jd3_wds/32/16586_2.png) [@JD3\_wds](https://forum.wixstudio.com/u/JD3_wds)\
**Post date:** [December 11, 2025, 1:33pm UTC](https://forum.wixstudio.com/t/request-a-quote-on-product-pages/60411/5 "2025-12-11T13:33:25Z")

</div>

We’ve also used the [Request a Quote for Wix App](https://www.wix.com/market/request-a-quote-for-wix?referral=developer&appIndex=2&referralTag=wd-strategies&referralSectionName=developer-page), in case that makes things easier. We just add it to the site and can achieve the functionality you’re talking about for our clients.
