window.addEventListener('AddItemToCart', function(event) {
const productVariantId = event.detail;
// Perform AJAX request to add item to cart
fetch('/cart/add.js', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{
id: productVariantId,
quantity: 1,
}],
sections: 'cart-drawer,cart-icon-bubble'
})
})
.then(response => response.json())
.then(data => {
console.log('Item added to cart:', data);
document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', {
bubbles: true
}));
})
.catch((error) => {
console.error('Error adding item to cart:', error);
});
});
$(document).ready(function() {
// Cache the main add to cart area and sticky add to cart button elements
var $mainAddToCart = $('.Product__Info'); // Replace with your actual selector for the main add to cart area
var $stickyAddToCart = $('#stickycart'); // Replace with your actual selector for the sticky add to cart button
// Initially hide the sticky add to cart button
$stickyAddToCart.hide();
// Function to check visibility of main add to cart area
function checkAddToCartVisibility() {
// Check if the main add to cart area is visible in the viewport
var isVisible = $mainAddToCart.is(':visible') &&
$mainAddToCart.offset().top < $(window).scrollTop() + $(window).height() &&
$mainAddToCart.offset().top + $mainAddToCart.outerHeight() > $(window).scrollTop();
// Toggle sticky add to cart button based on visibility
if (isVisible) {
$stickyAddToCart.hide();
} else {
$stickyAddToCart.show();
}
}
// Run the check on scroll and on load
$(window).on('scroll resize', checkAddToCartVisibility);
checkAddToCartVisibility(); // Initial check
});
$(document).ready(function() {
// Show the first tab content by default
$(".tab-content .tab").hide();
$(".tab-content .tab:first").show();
// Handle click on tab link
$(".tab-links li").click(function(event) {
event.preventDefault();
// Remove active class from all tabs and content
$(".tab-links li").removeClass("active");
$(".tab-content .tab").removeClass("active").hide();
// Add active class to clicked tab and show the corresponding content
$(this).addClass("active");
var target = $(this).find("a").attr("href");
$(target).addClass("active").show();
});
$('.recrecenttab a').on('click', function(){
$('.recrecenttab a').removeClass('active');
$(this).addClass('active');
var isssss = $(this).attr('data_title');
$('.producttab').each(function(){
var isssssss = $(this).attr('data_title');
if(isssssss == isssss){
$(this).show();
// alert(isssss);
}else{
$(this).hide();
}
});
});
});
{"id":7155761217583,"title":"Luna Embellished Blouse (Black)","handle":"luna-embellished-blouse","description":"\u003cp\u003eMaterial : Cotton Blend ( Embellished )\u003c\/p\u003e","published_at":"2022-10-08T19:39:27+05:30","created_at":"2022-10-08T19:39:28+05:30","vendor":"Alamode By Akanksha","type":"Tops","tags":["Birthday theme","Black Tops for Women","blouses for women","concert theme","Embellished tops for women","FAST","india75","Ready to ship","Top","Western wear for women"],"price":175000,"price_min":175000,"price_max":175000,"available":true,"price_varies":false,"compare_at_price":319800,"compare_at_price_min":319800,"compare_at_price_max":319800,"compare_at_price_varies":false,"variants":[{"id":41355411750959,"title":"XS","option1":"XS","option2":null,"option3":null,"sku":"TP_Luna_XS","requires_shipping":true,"taxable":true,"featured_image":{"id":32259199270959,"product_id":7155761217583,"position":1,"created_at":"2022-10-10T01:50:03+05:30","updated_at":"2024-12-29T14:37:02+05:30","alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","width":1000,"height":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","variant_ids":[41355411750959,41355411783727,41355411816495,41355411849263]},"available":false,"name":"Luna Embellished Blouse (Black) - XS","public_title":"XS","options":["XS"],"price":175000,"weight":200,"compare_at_price":319800,"inventory_management":"shopify","barcode":null,"featured_media":{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854053423,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":41355411783727,"title":"S","option1":"S","option2":null,"option3":null,"sku":"TP_Luna_S","requires_shipping":true,"taxable":true,"featured_image":{"id":32259199270959,"product_id":7155761217583,"position":1,"created_at":"2022-10-10T01:50:03+05:30","updated_at":"2024-12-29T14:37:02+05:30","alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","width":1000,"height":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","variant_ids":[41355411750959,41355411783727,41355411816495,41355411849263]},"available":true,"name":"Luna Embellished Blouse (Black) - S","public_title":"S","options":["S"],"price":175000,"weight":200,"compare_at_price":319800,"inventory_management":"shopify","barcode":null,"featured_media":{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854053423,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":41355411816495,"title":"M","option1":"M","option2":null,"option3":null,"sku":"TP_Luna_M","requires_shipping":true,"taxable":true,"featured_image":{"id":32259199270959,"product_id":7155761217583,"position":1,"created_at":"2022-10-10T01:50:03+05:30","updated_at":"2024-12-29T14:37:02+05:30","alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","width":1000,"height":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","variant_ids":[41355411750959,41355411783727,41355411816495,41355411849263]},"available":false,"name":"Luna Embellished Blouse (Black) - M","public_title":"M","options":["M"],"price":175000,"weight":200,"compare_at_price":319800,"inventory_management":"shopify","barcode":null,"featured_media":{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854053423,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":41355411849263,"title":"L","option1":"L","option2":null,"option3":null,"sku":"TP_Luna_L","requires_shipping":true,"taxable":true,"featured_image":{"id":32259199270959,"product_id":7155761217583,"position":1,"created_at":"2022-10-10T01:50:03+05:30","updated_at":"2024-12-29T14:37:02+05:30","alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","width":1000,"height":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","variant_ids":[41355411750959,41355411783727,41355411816495,41355411849263]},"available":false,"name":"Luna Embellished Blouse (Black) - L","public_title":"L","options":["L"],"price":175000,"weight":200,"compare_at_price":319800,"inventory_management":"shopify","barcode":null,"featured_media":{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854053423,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222"}},"requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_196fb0ff-efe9-48b9-b31c-c36f63c7e1ca.jpg?v=1735463222","\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_7b728bc7-39ee-4da6-89ab-057cfa394fbb.jpg?v=1735463223","\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_ad81c7f4-5fa8-48f2-9746-439034c6f3b8.jpg?v=1735463223"],"featured_image":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","options":["Size"],"media":[{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854053423,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_583c3111-2c0e-48cc-b1ff-5b76a647d67d.jpg?v=1735463222","width":1000},{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854086191,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_196fb0ff-efe9-48b9-b31c-c36f63c7e1ca.jpg?v=1735463222"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_196fb0ff-efe9-48b9-b31c-c36f63c7e1ca.jpg?v=1735463222","width":1000},{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854381103,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_7b728bc7-39ee-4da6-89ab-057cfa394fbb.jpg?v=1735463223"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_7b728bc7-39ee-4da6-89ab-057cfa394fbb.jpg?v=1735463223","width":1000},{"alt":"Luna Embellished Blouse (Black) - Alamode By Akanksha","id":24715854905391,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_ad81c7f4-5fa8-48f2-9746-439034c6f3b8.jpg?v=1735463223"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/www.alamodelabel.in\/cdn\/shop\/products\/image_ad81c7f4-5fa8-48f2-9746-439034c6f3b8.jpg?v=1735463223","width":1000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cp\u003eMaterial : Cotton Blend ( Embellished )\u003c\/p\u003e"}