$
USD
accordion
//www.thepakij.com/cdn/shop/files/Happy1.jpg?v=1729896364&width=2000
Build your own gift!
#ffffff
#000000
on
on
40
14
on
on
on
on
on
off
#ffffff
#121212
#000000
#ffffff
console.log(window.location.pathname);
if ( window.location.pathname == "/pages/select-box" ) {
var sizes_array = [];
var sizeDivs = $(".boxbag_sizes_main .boxbag_size");
sizeDivs.each(function(idx, div) {
var sizeName = $(this).attr('data-size-name');
var sizeMinimum = $(this).attr('data-size-minimum');
var sizeMaximum = $(this).attr('data-size-maximum');
var boxProductHandle = $(this).attr('data-box-product-handle');
var bagProductHandle = $(this).attr('data-bag-product-handle');
var holidayboxProductHandle = $(this).attr('data-holidaybox-product-handle');
var sizeValue = {};
sizeValue['size_name'] = sizeName;
sizeValue['size_minimum'] = sizeMinimum;
sizeValue['size_maximum'] = sizeMaximum;
sizeValue['box_product_handle'] = boxProductHandle;
sizeValue['bag_product_handle'] = bagProductHandle;
sizeValue['holiday_box_product_handle'] = holidayboxProductHandle;
sizes_array.push(sizeValue);
});
console.log("sizes_array", sizes_array);
var timesRun = 0;
var interval = setInterval(function(){
timesRun += 1;
if(timesRun === 20){
clearInterval(interval);
}
$('.product_select[data_step_index="1"] .product_box').hide();
$('.product_select[data_step_index="1"] .product_box[data-product-id="8595337117948"]').show();
$('.product_select[data_step_index="1"] .product_box[data-product-id="8588369068284"]').show();
$('.product_select[data_step_index="1"] .product_box[data-product-id="8773510299900"]').show();
// $('.product_select[data_step_index="1"] .product_box[data-product-id="8773510299900"]').show();
// $('.product_select[data_step_index="1"] .product_box[data-product-id="8555257561340"]').show();
// $('.product_select[data_step_index="1"] .product_box[data-product-id="8555319558396"]').show();
$('.loadmore_product_btn[data_step_index="1"]').hide();
$('.filter_options_step[data_step_index="1"]').hide();
$('.product_select[data_step_index="1"] .product_box .product_price_text, .loadmore_product_btn[data_step_index="1"]').addClass('hide');
$('.form_select[data_step_index="3"] .form_btn').text('Next');
}, 500);
function previewStepUiModify(){
$('.preview-top-step-section').addClass('hide');
$('.preview-information-section[data-node-index="1"]').removeClass('hide');
$('.preview-information-section[data-node-index="2"]').removeClass('hide');
}
$(document).on("click", ".panel_bg > a", function () {
previewStepUiModify();
});
$(document).on("click", ".back_and_next_btn .summary_backnext_btn, .nav-tabs-top .top-step-arrow", function () {
previewStepUiModify();
});
function addToCart(productHandle) {
console.log("productHandle", productHandle);
fetch(window.Shopify.routes.root + 'products/'+productHandle+'.js').then(response =>
response.json().then(data => ({
data: data, status: response.status
})
).then(res => {
var productJson = res.data;
var product_variants = (productJson.variants) ? productJson.variants : [];
if(product_variants.length > 0){
var product_first_variant = (product_variants[0]) ? product_variants[0] : '';
var current_index = Number(1);
var product_id = productJson.id;
var product_variant_id = product_first_variant.id;
var product_variant_price = product_first_variant.price;
var product_variant_title = product_first_variant.title;
var data_prd_img = productJson.featured_image;
var data_prd_name = productJson.title;
var current_product_qty = Number(1);
var data_prd_weight = Number(0);
var step_object = {};
var current_step_object = storage_object['step_1'];
var box_obj_array = ( current_step_object && current_step_object.products ) ? current_step_object.products : [];
var searchBoxProductResult = box_obj_array.some(item => { return item.product_id == Number(product_id) });
if(searchBoxProductResult==false){
$('.panel_bg[data_step_index="1"] .accordion_img_main img').attr('src', data_prd_img);
$('.panel_bg[data_step_index="1"] .accordion_img_main .accordion_img_remove').attr('data_prd_id', Number(product_id));
$('.panel_bg[data_step_index="1"] .accordion_img_main .accordion_img_remove').attr('data_prd_variant_id', Number(product_variant_id));
$('.panel_bg[data_step_index="1"] .accordion_img_main .accordion_img_remove').attr('data-title', data_prd_name);
$('.product_select[data_step_index="1"] .product_box[data-product-id="'+product_id+'"]').addClass('product_added_active_box');
var product_obj_array = [];
var product_obj = {};
product_obj['product_id'] = Number(product_id);
product_obj['product_image'] = (data_prd_img) ? data_prd_img : '';
product_obj['product_title'] = (data_prd_name) ? data_prd_name : '';
product_obj['product_price'] = Number(product_variant_price / 100);
product_obj['product_variant_id'] = Number(product_variant_id);
product_obj['product_variant_title'] = product_variant_title;
product_obj['product_quantity'] = current_product_qty;
product_obj['product_weight'] = data_prd_weight;
product_obj_array.push(product_obj);
step_object['products'] = product_obj_array;
storage_object['step_1'] = step_object;
setTimeout( function(){
sweetAlertPopup('success', 'We are upgrading your box size to '+data_prd_name);
}, 2000);
}
}
}));
}
function hideShowBoxProducts(step_selected_products_length){
$('.product_select[data_step_index="1"] .product_box').hide().removeClass('product_added_active_box');
const myArrayFiltered = sizes_array.filter((el) => {
return step_selected_products_length >= el.size_minimum && step_selected_products_length <= el.size_maximum;
});
console.log("myArrayFiltered", myArrayFiltered);
if(myArrayFiltered.length > 0){
var boxProductHandle = myArrayFiltered[0].box_product_handle;
$('.product_select[data_step_index="1"] .product_box[data-product-handle="'+boxProductHandle+'"]').show();
var bagProductHandle = myArrayFiltered[0].bag_product_handle;
$('.product_select[data_step_index="1"] .product_box[data-product-handle="'+bagProductHandle+'"]').show();
var holidayboxProductHandle = myArrayFiltered[0].holiday_box_product_handle;
$('.product_select[data_step_index="1"] .product_box[data-product-handle="'+holidayboxProductHandle+'"]').show();
}
}
function checkBoxOrBagProducts(step_selected_products_length){
const myArrayFiltered = sizes_array.filter((el) => {
return step_selected_products_length >= el.size_minimum && step_selected_products_length <= el.size_maximum;
});
if(myArrayFiltered.length > 0){
var boxProductHandle = myArrayFiltered[0].box_product_handle;
var bagProductHandle = myArrayFiltered[0].bag_product_handle;
var holidayboxProductHandle = myArrayFiltered[0].holiday_box_product_handle;
var last_step_object = storage_object['step_1'];
var last_step_product_obj_array = ( last_step_object && last_step_object.products ) ? last_step_object.products : [];
var searchBox = 'Luxury Gift';
var searchBoxResult = last_step_product_obj_array.some(item => { return item.product_title.includes(searchBox) });
if(searchBoxResult==true){
addToCart(boxProductHandle);
}
var notSearchBag = 'Limited Holiday Gift Bags';
var notSearchBag2 = 'Limited Holiday Gold Starburst Gift Bag';
var searchBag = 'Gift Bag';
var searchBagResult = last_step_product_obj_array.some(item => {
return item.product_title.includes(searchBag) && !item.product_title.includes(notSearchBag) && !item.product_title.includes(notSearchBag2);
});
if (searchBagResult) {
addToCart(bagProductHandle);
}
var searchHolidayBag = 'Limited Holiday Gift Bags';
var searchHolidayBag2 = 'Limited Holiday Gold Starburst Gift Bag';
var searchHolidayBagResult = last_step_product_obj_array.some(item => { return item.product_title.includes(searchHolidayBag) || item.product_title.includes(searchHolidayBag2) });
if(searchHolidayBagResult==true){
console.log("searchHolidayBagResult");
addToCart(holidayboxProductHandle);
}
}
}
$(document).on("click", '.addtocart_btn, .accordion_img_remove, .preview_img_remove, .quantity_box_btn[data_step_type="plus"], .quantity_box_btn[data_step_type="minus"]', function () {
var current_index = $(this).attr('data_step_index');
var removeFlag = $(this).hasClass('accordion_img_remove');
var removeFlag_2 = $(this).hasClass('preview_img_remove');
console.log(removeFlag_2);
var removeFlag_3 = $(this).attr('data_step_type');
console.log(removeFlag_3);
if(current_index==2){
var current_step_object = storage_object['step_2'];
var step_selected_products = ( current_step_object && current_step_object.products ) ? current_step_object.products : [];
var step_selected_products_length = step_selected_products.reduce(function (s, a) { return s + a.product_quantity; }, 1);
if(removeFlag==true || removeFlag_2==true || removeFlag_3=='minus'){
var clicked_product_id = $(this).attr('data_prd_id');
var removeQty = $(this).attr('data-product-qty');
if(removeFlag_3=='minus'){
removeQty = $(this).parent('.quantity_box_grid_td_bg').find('.quantity_box_input').val();
}
console.log(removeQty);
step_selected_products_length = Number(step_selected_products_length)-Number(removeQty);
}
hideShowBoxProducts(step_selected_products_length);
checkBoxOrBagProducts(step_selected_products_length);
}
});
}
.modal_new{display: none; position: fixed; z-index: 9; padding-top: 23px; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4);}
.modal-content{background-color: #fefefe; margin: auto; padding:24px; border: 1px solid #888; width: 900px; position: relative; border-radius: 8px;}
.close_btns{color: #fff; font-size: 17px; font-weight: bold; position: absolute; top: -14px; right: -12px; background: #f00; width: 30px; text-align: center; height: 30px; border-radius: 100%; cursor: pointer; line-height:23px;}
.preview_box_popup{display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; text-align: left; max-height: 80vh; overflow: auto;}
.preview_box_popup .box_popup_item img{max-width: 100%; max-height: 300px; object-fit: contain;}
.preview_box_popup .box_popup_item{border: solid 1px #eaeaea; padding: 2px 2px 21px; box-shadow: 0 2px 6px #c9c9c97a; -webkit-box-shadow: 0 2px 6px #c9c9c97a; -moz-box-shadow: 0 2px 6px #c9c9c97a; text-align: center; position: relative; background: #fff; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; transition: all 0.3s cubic-bezier(.25,.8,.25,1); min-width:calc(50% - 15px);}
.preview_box_popup .box_popup_item .box_popup_item_content .title_pro{font-weight: 500; letter-spacing: 0; font-size: 16px; color: #000; margin: 7px 0 0 0; line-height: normal;}
.preview_box_popup .box_popup_item .box_popup_item_content .price_pro{display: inline-block; width: 100%; line-height: normal; font-size: 14px; color: #000; letter-spacing: 0; font-weight: 500;}
.preview_box_popup .box_popup_item .box_popup_item_content .popup_addtocart_btn{cursor: pointer; background: #212121; color: #fff; display: inline-block; text-transform: uppercase; font-size: 14px; font-weight: 500; padding: 6px 17px; margin: 9px 0 0 0; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; letter-spacing: 0px;}
.preview_box_popup .box_popup_item .box_popup_item_content{padding:0 7px;}
.checkout_btn_clone{background: #212121; color: #fff; border: none; outline: none; box-shadow: inherit; cursor: pointer; font-size: 14px; font-weight: 500; display: inline-block; padding: 12px 32px; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; text-transform: uppercase;}
body .product_select .product_box .product-title h4{display: inline-block; -webkit-line-clamp: inherit; overflow: inherit;}
.product_select .product_box .product_add_btn span,
.addtocart_btn,
.radio_size_variant_main .parent_checked span,
.radio_size_variant_main .size_list input[type="radio"]:checked + span {font-weight: 600; }
.tabs-top ul .active-step a b {border-color: gray;color: gray;background: gray url(https://www.qetail.com/apps/gbb2_0/images/builder/svg/active_top_tab_ic.svg) no-repeat center;}
.tabs-top ul .active-step:before{background: gray;}
.tabs-top ul .active-step a span{color: gray;}
@media only screen and (max-width:767px) {
.modal-content {padding: 14px; width: 95%;}
}
checkout