How do I add items to cart drawer using a custom function on Shopify Dawn theme

grimworld
Shopify Partner
19 0 4

I'm creating a quick-add feature, which allows users to add items to cart from the home page, which displays product variants when a user hovers over said product.

My problem is, the cart drawer code is way too advanced for me to even begin to comprehend what's happening, or how it works. I get the basic idea, but that does not even come close to generating that logic in my brain.

 

You can find my specific code here

The cart-drawer code for dawn is here The cart code for dawn is here

 

I tried creating a form to wrap the products, with a hidden input as shown here. I got it to work somewhat in a different theme that has the ajax functions commented and coded pretty simply. But this specific integration has been causing me stress for WEEKS.

I've tried simply adding products to cart, without the cart drawer part, but that's counterintuitive, as nobody wants to refresh the page to see their items in cart. That part worked just fine, I just need to get it to render in the cart drawer 😔

Replies 0 (0)