Ecwid is an eCommerce platform that helps to simply create on-line retailer and begin promoting your merchandise immediately anyplace across the globe.
Within the following article I’ll clarify some fundamental examples that can be utilized to do easy customization in your Ecwid retailer.
If you wish to programmatically replace an enter worth. Then solely choosing and assigning worth to the enter utilizing JS is not going to work. However you’ll additionally must rise corresponding occasion like enter or change, to let the framework know the brand new change. For instance, the next code will rise enter occasion for “ec-qty” area.
let el = doc.querySelector('enter[name="ec-qty"]'); el.dispatchEvent(new Occasion('enter', bubbles:true, cancelable:true));
2. Subscribe to Web page Load Occasion in Ecwid
Fortunately, Ecwid does present its personal occasion which is fired each time a consumer redirects to a different web page. You may merely subscribe to the occasion and voila! All of the required web page data might be accessible within the callback. Which incorporates web page identify, kind, key phrases, categoryId, orderId, productid and many others.
You should utilize following code block to subscribe to Ecwid’s “OnPageLoaded” occasion:
Ecwid.OnPageLoaded.add(operate(web page) console.log("Present web page is of kind: " + web page.kind); );
Within the following code instance, we’re subscribing to the “OnPageLoaded” occasion and checking if we’re on product particulars web page.
Ecwid.OnPageLoaded.add(operate(web page) if (web page.kind == 'PRODUCT') console.log("Present web page is of kind: " + web page.kind); );
The opposite web page varieties might be CATEGORY, CHECKOUT_PAYMENT_DETAILS, CHECKOUT_DELIVERY, CHECKOUT_ADDRESS, ACCOUNT_ROOT, PRODUCT and many others.
3. Redirecting to a different web page in Ecwid
You may open cart web page in storefront like so:
The pages in storefront might be of two varieties:
- Basic web page like cart and delivery stage at checkout
- Web page with parameters, like product, class, search, and many others.
For basic pages, specify the identify of the web page you need to open. Nevertheless, for pages with parameters, it’s essential to must specify what web page you need to open precisely.
The Proper Software program are Ecwid knowledgeable of Pakistan and we now have quite a lot of achievements on this space. We labored in cart setup, customized app improvement, backend and frontend customization, fee gateways, delivery strategies and rather more. The Proper Software program can also be formally listed as knowledgeable at Ecwid web site.
You may focus on your Ecwid necessities with us.