# getProduct promise not resolving - cannot use .then()

**URL:** <https://forum.wixstudio.com/t/getproduct-promise-not-resolving-cannot-use-then/79555>\
**Category:** Ask the community\
**Tags:** wix-studio, code\
**Created:** [August 31, 2026, 3:29pm UTC](https://forum.wixstudio.com/t/getproduct-promise-not-resolving-cannot-use-then/79555 "2026-08-31T15:29:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hypemodedesigns](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/hypemodedesigns/32/108935_2.png) [@hypemodedesigns](https://forum.wixstudio.com/u/hypemodedesigns)\
**Post date:** [August 31, 2026, 3:29pm UTC](https://forum.wixstudio.com/t/getproduct-promise-not-resolving-cannot-use-then/79555/1 "2026-08-31T15:29:09Z")

</div>

**I’m having trouble with**

getProduct() method on product page element promise not resolving  
doesn’t seem to worth with await  
doesn’t allow .then chain even tho the docs clearly state it should

**Working in**  
wix studio

```javascript
import { canAddSampleToCart } from 'backend/sampleChecks.web.js';

$w.onReady(async function () {

	console.log($w('#productPage1'));
	setTimeout(() => {
		const product = $w('#productPage1').getProduct();
		console.log('product:', product);			
	}, 5000);

	$w('#productPage1').onAddToCart(async(resume, cancel) => {
		const result = await canAddSampleToCart();
		console.log('result:', result);
	});

	$w('#productPage1').onQuantityChanged((quantity) => {

	});

});

```

i added the setTimeout for testing.  
because even tho it returns a promise… it doesnt await

just returns `<promise>`no matter what…  
won’t allow .then() chaining… even tho the docs clearly show it should…

 ![image](https://us1.discourse-cdn.com/wix/original/3X/9/c/9ca8632e5c3f54caf28da390017de4f8a413ab5e.png)

i don’t think im missing anything here, right?

---

<div class="post-metadata">

**Author:** ![hypemodedesigns](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/hypemodedesigns/32/108935_2.png) [@hypemodedesigns](https://forum.wixstudio.com/u/hypemodedesigns)\
**Post date:** [August 31, 2026, 3:53pm UTC](https://forum.wixstudio.com/t/getproduct-promise-not-resolving-cannot-use-then/79555/2 "2026-08-31T15:53:49Z")

</div>

Ah apparently this is one of those functions that do not work in preview mode. Works on test-site.

A note on the docs would be a good idea, I think. Easy to overlook or forget about otherwise.
