Create progress bar based on number of items in cart

Hello, I’ve added a progress bar to my website. Currently i sell juices, and would like customers to see a progress bar that progress as they add juices to their cart. The target value is 21, but i am a little confused on how to set the progress value to the number of items that is currently in cart. Right the javascript for my bar reads as follows. Looking for what function I can create to replace the progress value with a user input element.


$w.onReady(function () {
 // Set the target value as 21
$w('#progressBar2').targetValue = 21;

// Set the progress as 20
$w('#progressBar2').value = 20;

});

Hey,

You could use the getCurrentCart() function to determine how many items are in the users cart and then display that value on the progress bar.

Hope this helps!

Dara | Corvid Team

Hi Dara, unfortunately i cant figure out how to make this work. Is there anyone that can assist me with direct coding support?

Hey,

If you feel like you’re having difficulty implementing this feature, please consider hiring a Wix Partner to help you build your site.

Dara | Corvid Team