How to add quantity in drawer cart

Topic summary

A user working with the Uray theme needs help adding a quantity selector to their cart drawer, as the theme currently lacks this functionality. The theme’s support team has been unresponsive.

Technical Context:

  • The cart drawer appears to be JavaScript-based rather than using Liquid templates
  • The provided code snippet shows currency conversion logic but doesn’t contain cart drawer functionality
  • The code appears corrupted or improperly formatted (reversed/garbled text)

Current Status:

  • No solutions have been proposed yet
  • The discussion remains open with the original question unanswered
  • The user is seeking community assistance to implement quantity adjustment controls in the drawer cart
Summarized with AI on November 7. AI used: claude-sonnet-4-5-20250929.

Hello,

I’m using Uray theme and there is no quantity or quantity selector in cart drawer. Theme support is not responding.

So I’m asking you to help.

As I understand there is no liquid for this cart, only javascript.

<script type="text/javascript">
    if (vela.settings.currencies) {
      Currency.format = "money_format";
      var shopCurrency = vela.strings.currency;
      Currency.moneyFormats[shopCurrency].money_with_currency_format = vela.strings.shop_money_with_currency_format;
      Currency.moneyFormats[shopCurrency].money_format = vela.strings.shop_money_format;
      var defaultCurrency = 'USD';
      var cookieCurrency = Currency.cookie.read();
      var velaCurrencies = $('[name=currencies]'),
          velaCurrencyItem = $('.jsvela-currency__item'),
          velaCurrencyCurrent = $('.jsvela-currency__current');
      $('span.money span.money').each(function() {
          $(this).parents('span.money').removeClass('money');
      });
      $('span.money').each(function() {
          $(this).attr('data-currency-' + vela.strings.currency, $(this).html());
      });
      if (cookieCurrency == null) {
          if (shopCurrency !== defaultCurrency) {
              Currency.convertAll(shopCurrency, defaultCurrency);
          }
          else {
              Currency.currentCurrency = defaultCurrency;
          }
      }
      else if ($('[name=currencies]').length > 0 && $('[name=currencies] .jsvela-currency__item[data-value=' + cookieCurrency + ']').length === 0) {
          Currency.currentCurrency = shopCurrency;
          Currency.cookie.write(shopCurrency);
      }
      else if (cookieCurrency === shopCurrency) {
          Currency.currentCurrency = shopCurrency;
      }
      else {
          Currency.currentCurrency = cookieCurrency;
          Currency.convertAll(shopCurrency, cookieCurrency);
          velaCurrencies.data('value', cookieCurrency);
          velaCurrencyItem.removeClass('active');
          velaCurrencyItem.each(function() {
              if ($(this).data('value') === cookieCurrency)
                  $(this).addClass('active');
          });

      }
      $('body').on('click', '.jsvela-currency__item', function() {
          var newCurrency = $(this).data('value');
          velaCurrencies.data('value', newCurrency);
          velaCurrencyItem.removeClass('active');
          $(this).addClass('active');
          Currency.convertAll(Currency.currentCurrency, newCurrency);
          velaCurrencyCurrent.text(Currency.currentCurrency);
          $(this).parent().removeClass('show');
          $('[data-bs-toggle="dropdown"]').removeClass('show');
          return false;
      });
      var original_selectCallback = window.selectCallback;
      var selectCallback = function(variant, selector) {
          original_selectCallback(variant, selector);
          Currency.convertAll(shopCurrency, $('[name=currencies]').data('value'));
          velaCurrencyCurrent.text(Currency.currentCurrency);
      };
      $('body').on('ajaxCart.afterCartLoad', function(cart) {
          Currency.convertAll(shopCurrency, $('[name=currencies]').data('value'));
          velaCurrencyCurrent.text(Currency.currentCurrency);  
      });
      velaCurrencyCurrent.text(Currency.currentCurrency);
   }
</script>
		<div class="toast ajaxcart-toast fade hide" role="alert" aria-live="assertive" aria-atomic="true" data-delay="2000">
    <button type="button" class="ajaxcart-toast__close text-white btn-link p-0 border-0 top-0 end-0 position-absolute" data-bs-dismiss="toast" aria-label="Close">
      <svg  "  aria-hidden="true" focusable="false" role="presentation" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M8.48627 9.32917L2.82849 3.67098" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
        <path d="M2.88539 9.38504L8.42932 3.61524" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
    </svg>
    </button>
  	<div class="toast-body"></div>
</div><div class="drawer__overlay js-drawer-close"></div>
	<div class="js-drawer drawer drawer--right drawer--has-fixed-footer">
		<div class="drawer__header border-bottom position-relative">
			<div class="drawer__title">Jūsų krepšelis</div>
			<button type="button" class="drawer__close-button js-drawer-close">
				<svg  class="icon-close" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" role="presentation"  fill="none" viewBox="0 0 18 17">
        <path d="M.865 15.978a.5.5 0 00.707.707l7.433-7.431 7.579 7.282a.501.501 0 00.846-.37.5.5 0 00-.153-.351L9.712 8.546l7.417-7.416a.5.5 0 10-.707-.708L8.991 7.853 1.413.573a.5.5 0 10-.693.72l7.563 7.268-7.418 7.417z" fill="currentColor" />
    </svg>
			</button>
		</div>
		<div class="drawer__inner position-absolute overflow-hidden w-100">
			<div class="ajaxcart-container" data-cart-container></div>
		</div>
	</div><div class="cookie-consent" role="dialog" aria-label="cookieconsent"
		style="background-color: rgba(0, 0, 0, 0.8); color: #fff;">
		<div class="cookie-consent__wrapper">
			<div class="cookie-consent__message">This website uses cookies to ensure you get the best experience on our website. <a href="/policies/privacy-policy">Learn more</a></div>
			<div class="cookie-consent__dismiss">
				<button class="cookie-consent-dismiss btn btn-dismiss" type="button">Got it!</button>
			</div>
		</div>
	</div><script id="ajaxcart-template" type="text/template">

  <form action="/cart" method="post" novalidate class="cart ajaxcart ajaxcart--header">
    <div class="ajaxcart__inner">
      {{#items}}
      <div class="ajaxcart__product" data-line="{{line}}">
        <div class="ajaxcart__line-item">
          <div class="ajaxcart__line-item--left">
            <div class="ajaxcart__product-image-wrapper">
              <a href="{{url}}" class="ajaxcart__product-image"><img class="img-fluid" src="{{img}}" alt="{{name}}"></a>
              
            </div>
          </div>
          <div class="ajaxcart__line-item--right">
            <div class="ajaxcart__product-description">
              <div class="ajaxcart__product-name-wrapper">
                <a href="{{url}}" class="ajaxcart__product-name d-block mb-2">{{{name}}}</a>
                {{#if variation}}
                  <span class="ajaxcart__product-meta mb-1">{{variation}}</span>
                {{/if}}
                {{#properties}}
                  {{#each this}}
                    {{#if this}}
                      <span class="ajaxcart__product-meta mb-1">{{@key}}: {{this}}</span>
                    {{/if}}
                  {{/each}}
                {{/properties}}
                <div class="ajaxcart__product-price-wrapper product-price">
                  {{#if discountsApplied}}
                    <del class="ajaxcart__price ajaxcart__price--regular">{{{price}}}</del>
                    <span class="ajaxcart__price ajaxcart__price--sale">{{{discountedPrice}}}</span>
                  {{else}}
                    <span class="ajaxcart__price">{{{price}}}</span>
                  {{/if}}
                  {{#if unitPrice}}
                    <span class="d-none">Vieneto kaina</span>
                    <span class="cart__unit-price">
                      

                      <span>{{{ unitPrice.price }}}</span><span aria-hidden="true">/</span><span class="d-none"> Translation missing: lt-LT.general.accessibility.unit_price_separator </span>{{#if unitPrice.addRefererenceValue }}{{{ unitPrice.reference_value }}}{{/if}}{{{ unitPrice.reference_unit }}}
                    </span>
                  {{/if}}
                </div>
                

                {{#if discountsApplied}}
                  <ul class="product-discount product-discount--ajax-cart" aria-label="Nuolaida">
                    {{#each discounts}}
                      <li class="product-discount__item">
                        <span class="fa fa-tag" aria-hidden="true"></span>{{ this.discount_application.title }} (-{{{ this.formattedAmount }}})
                      </li>
                    {{/each}}
                  </ul>
                {{/if}}
                <a class="ajaxcart__remove" href="javascript&colon;void(0)" data-line="{{line}}" data-cart-remove><svg   class="icon-close"  aria-hidden="true" focusable="false" role="presentation" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M8.48627 9.32917L2.82849 3.67098" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
        <path d="M2.88539 9.38504L8.42932 3.61524" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
    </svg></a>
              </div>
            </div>
          </div>
        </div>
      </div>
      {{/items}}
      
    </div>
    <div class="ajaxcart__footer">
      {{#if cartDiscountsApplied}}
        <div class="ajaxcart__footer-discount">
          {{#each cartDiscounts}}
            <div class="order-discount order-discount--ajax-cart">
              <i class="fa fa-tag" aria-hidden="true"></i>
              <span class="d-none">Nuolaida:</span> {{ this.title }}
            </div>
            <div class="order-discount__value text-right">
              <span class="ajaxcart__price">-{{{ this.formattedAmount }}}</span>
            </div>
          {{/each}}
        </div>
      {{/if}}
      <div class="ajaxcart__footer-price">
        <span class="ajaxcart__subtotal-name">Tarpinė suma</span>
        <span class="ajaxcart__subtotal">{{{totalPrice}}}</span>
      </div>
      <p class="ajaxcart__policies">
Siuntimo išlaidos apskaičiuojamos atsiskaitant. Nuolaidos kodą suveskite apmokėjimo puslapyje.

      </p>
      <div class="ajaxcart__footer-buttons d-flex justify-content-between">
        <button class="btn cart-modal__btn cart-modal__btn--viewcart" type="submit">
          Žiūrėti krepšelį
        </button>
        <button class="btn cart-modal__btn cart-modal__btn--checkout" type="submit" name="checkout">
          APMOKĖTI
        </button>
      </div>
    </div>
  </form>

</script>