Streaming live at 10am (PST)

Custom code to get quantity of items in cart

#1

Hi,

I am a newb in javascript but, are there any way to make a custom html/js to write the quantity in cart outside of the cart view.

JSPath looks like this: document.querySelector('body > div.navbar-3.w-nav > div.div-block-76 > div > div.div-block-78 > div > div > div > div.w-commerce-commercecartheader.cart-header > div')

Read-only

What I am trying to do is to tell my customersh how many shipping boxes they will recieve depending on their item count. (Eg. <10 = 1 box, 10<20 = 2 boxes).

Thanks in advance!

1 Like

#2

Why not just give a class to qty field in cart, and with some jquery / js target that class, (store the value if necessary for instance to calculate boxes) and append it somewhere else in your page ?

0 Likes