Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We need to implement a button that activates a subscription on a certain product inside the mini cart, something like a switcher.
This is the code I'm using, which works for /cart/change.js
$('#cart-item-upgrade').on("click", function(e) { const $this = $(this); const id = $this.closest('.cart-drop-item-wrapper').find('.cart-drop-item').data('variant-id'); $.post('/cart/change.js', { id, selling_plan: 919371846 }) .always(function (data) { $.getJSON('/cart.js', function (cart) { updateCartTotal(cart.total_price); updateFreeShipping(cart.total_price); updateCartCount(cart.item_count); updateCart(); }); }); })
However, we want to make the selling_plan ID dynamically retrieved, how can we do this? We're using Recharge as our subscription provider.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025