Retrieve SKU in wix via DOM

I’m trying to get the SKU on a product page. The product area is kind of a black box in the editor, but exposes values in the DOM.

In normal jquery, I’d use $(“[data-hook=‘product-page-sku’]”)[0].innerHTML.split(“:”)[1] to get the value, but this doesn’t work. Is there a $w method I’m missing? I want to use the value to lookup a row in a wix collection so I can generate a price estimation in a custom quote tool.

Or, is there a more Wixy way to do this? Basically, my product price isn’t fixed per product, but depends on the product, quantity, and other factors in a collection I’ve tied to the base product sku, so I’m trying to make a custom js user input module to use the sku/collection with another collection table.

I’ve got everything working but the code to get the SKU from the page.

Hi Frank,

Currently there is no integration between Wix stores and wix code.
This means it is not possible to pull data from any wix stores elements.

Ok. Appreciate the feedback, Ido. Thanks!

I would suggest that this functionality should be added, Wix devs. Either the ability to retrieve the product ID of the current page, or the ability to edit/create a product panel. Shouldn’t be difficult, as Wix controls the attributes defining the DOM placement of SKU values. It limits all products to a single price per unit, which is not how all product pricing models work.

Or, charge extra for this capability, but make it available. Wix does a fine job of making shop development simple and quick, so it’d still be more economical to use Wix and pay extra for extensibility.