#I want to get product id from site plugin on product details page in wix blocks

1 messages · Page 1 of 1 (latest)

agile void
#

I added a site plugin on the product details page on wix blocks, how do i access the product Id

import wixData from 'wix-data';

$w.onReady(function () {
// Initialize your plugin code here. Make sure that your plugin has the required Plugin API properties to communicate with the plugin slot.
});

$widget.onPropsChanged((oldProps, newProps) => {
// Handle changes to plugin property values here.

console.log(oldProps);
console.log(newProps);

});

tacit shardBOT
#

👀 Looks like you’re trying to post some code? I can help... probably more eagerly than I should.
-# FYI: My humans sent me back to the Academy to spend more time training my unformatted code detection skills. And now I'm back 😎. This is a friendly test. 🛠️

jovial flower
#

Need to create a property in blocks.

The property for the product page widget is “productId”

Then use this property in your code.

https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/site-plugins/supported-wix-app-pages/wix-stores/wix-stores-product-page

Hope that helps

agile void
#

Thank you

#

I have it now