JS Snippet
Add product to cart once its quantity is changed
jQuery(document).on('change', '[data-component~="wcpw-product-quantity-input"]', function () {
is $product = jQuery(this).closest('[data-component="wcpw-product"]');
var $wcpw = $product.closest('[data-component~="wcpw"]');
if ($product.data('submitTimeout')) {
clearTimeout ($product.data ('submitTimeout')
The
$product.data('submitTimeout', setTimeout(function () {
$wcpw.data('wcpw').addCartProduct(
{productToAddKey: $product.data('step-id') + '-' + $product.data('id')},
{behavior: ‘submit’}
and the
by 1000) ;
Here is the documentation.may need to be through a VPN or TOR because it looks like a Caspian serverhttps://products-wizard.troll-winner.com/docs/#js-snippetsDialogue with the plugin developer: Customer
Hello
is that possible to arrange adding to cart ( sidebar) live adding or minus.when we push + to add item and we can see chosen item immediately on the sidebar.we have 50 different items that can be loaded in one box and to avoid client counting in his mind we need scalebar and live adding items in sidebar.Please suggest how it can be realized?like here it is done https://patchi.com/us/en
by troll_winner
Hello there!Such reactive work mode would be great to have, but it requires a lot of coding and has many limitations.It's under the long consideration currently.If you have a fast server you can send selected product to the cart once it's selected or quantity is changed.It'll interrupt the process a little, but the totals will be updated.There is a small JS snippet to make it possible:
HTTPS://products-wizard.troll-winner.com/docs/#js-snippets
Let me know if it is helps somehow.Best Regards by Alex Customer
PURCHASED supported
you mean to assign to the + or - buttons "add to cart" function and to show cart contents on sidebar?by troll_winner
Not directly for the +/- buttons but to the quantity input.This snipped sends the product to cart in a second after you change a product quantity input.Therefore, you need to press +/- (not to enter the number of pieces) to see the position and the button "Remove" immediately in the sidebar.
https://www.syla.gifts/custom-box-create/
Therefore, you should probably enter the routes in this snipet or somewhere else to respond not to the number entered but to +/- buttons.
Current freelance projects in the category Javascript and Typescript
Full-stack development — Amazon PPC Dashboard (Stage 1)Need a full-stack developer with experience working with Amazon API to implement Stage 1 of the internal PPC dashboard. The project is real, the data is live, everything is ready to start. Frontend prototype (5 pages, React + TypeScript): WHAT IS ALREADY READY — Frontend… Javascript and Typescript, Web Programming ∙ 1 day 22 hours back ∙ 27 proposals |
Development of a photo book and photo frame constructor websiteProject Goal A modern website needs to be developed for ordering photo books, photo frames, and other personalized photo products. The main task of the project is to provide the client with the ability to independently create a ready-made layout of the product directly on the… Javascript and Typescript, Web Programming ∙ 3 days 14 hours back ∙ 96 proposals |
Team for a custom marketplace of funeral services.We are looking for a team to launch and develop a custom national marketplace for funeral services. Right away: we are not looking for solo freelancers, juniors, or "website builders." We need a strong product team at the middle+/senior level with real cases in… Javascript and Typescript, Web Programming ∙ 4 days 9 hours back ∙ 27 proposals |
Improvement of the existing Next.js/Supabase project: offers, CRM, analytics, AI chatThere is an active project WatchGenius — a luxury watch analytics platform with a catalog of models, price analytics, external offers, application forms, and an AI chat. The project has already been partially developed. We need not a website from scratch, but an experienced… Javascript and Typescript, Web Programming ∙ 6 days 10 hours back ∙ 55 proposals |
I am looking for a Senior Full-Stack Developer (Payload CMS) — migration of 2 websites for a hotel chain.The resort hotel network is transitioning from Webflow to its own headless stack. Two corporate websites (~140 pages in total), multi-tenant architecture — one code serves multiple hotels on different domains. The project has already started: the infrastructure is deployed,… Content Management Systems, Javascript and Typescript ∙ 10 days 8 hours back ∙ 19 proposals |