We have: Existing Wix site with some products and the classic ‘product-page’ dynamic type url.
e.g. https:// domain-name/product-page/productname1
https:// domain-name/product-page/productname2.
Is it possible to use (on the product-page) wix-code and get the above url or the ‘productnameN’?
Getting the url or productname of existing wix-store products will allow to add more js add-ons, reviews and allow to have a hybrid wix-store and wix-code.
dim.
Hi Liran,
i already try (wix location path, url etc) but I only get the url "https:// domain-name/product-page/ " and not the last part which is the one that changes and of course the significant one . (note that to test, I use a free published site copy of the premium).
dim.
The same thing happens to me, I would like to capture the whole URL, I leave my code, if you can help me, I would appreciate it
import wixLocation from ‘wix-location’;
$w.onReady(function () {
let url = wixLocation.url; // Change wixLocation.protocol to wixLocation.url. Should be in $w.onReady scope
$w(“#URLcurrent”).value = url; // #URLcurrent represents the id name of your input field, change it to the correct id name
$w(“#dataset1”).onAfterSave(sendFormData);
});
import {sendEmail, sendEmailWithRecipient} from ‘backend/email’;
your method worked for me, finally, you passed, I’ve been trying to capture the complete url for a long time and I see that you had the same problem, thanks for sharing your knowledge and thanks to everyone who also helped me in the forum.