Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
<script>
$("#atcbtn_click").click(function(event){
event.preventDefault();
//alert("click");
var atc_url = '/cart/'
$(".list_freq-product .meta_check:checked").each(function(){
atc_url = atc_url + $(this).attr('value') + ":1,"
});
//console.log("iddds",atc_url);
window.location.href = atc_url
})
</script>
<script>
document.getElementById('atcbtn_click').addEventListener('click', function(event) {
event.preventDefault();
// alert("click jkk");
var dataType = [];
$(".list_freq-product .meta_check:checked").each(function() {
var data = {}; // Create a new object for each iteration
data['id'] = parseInt($(this).attr('value'));
data['quantity'] = 1;
//console.log(data);
dataType.push(data);
});
const newData = {
items : [...dataType]
}
// console.log("data",newData)
jQuery.ajax({
type: 'POST',
url: '/cart/add.js',
data: newData,
dataType: 'json',
success: function(data) {
console.log(data);
window.location.href= '/cart'
}
});
});
</script>
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024