variable products
$100.00 – $1,550.00Price range: $100.00 through $1,550.00
jQuery(document).ready(function($){
function ipc_update_summary() {
let price = parseFloat($(‘#ipc-product-price’).text().replace(/[^\d.]/g,”)) || 0;
let qty = parseInt($(‘#ipc-quantity’).val()) || 1;
let area = $(‘input[name=”shipping_area”]:checked’).val();
let shipping = 0;
if(area === ‘inside’){
shipping = parseFloat(ipc_ajax.inside_shipping);
} else {
shipping = parseFloat(ipc_ajax.outside_shipping);
}
let subtotal = price * qty;
let total = subtotal + shipping;
$(‘#ipc-summary-price’).text(‘৳’ + subtotal);
$(‘#ipc-summary-qty’).text(qty);
$(‘#ipc-summary-shipping’).text(‘৳’ + shipping);
$(‘#ipc-summary-total’).text(‘৳’ + total);
}
$(document).on(‘click’,’.ipc-buy-now-button’,function(){
let productID = $(this).data(‘product-id’);
let productName = $(this).data(‘product-name’);
let productPrice = $(this).data(‘product-price’);
let productImage = $(this).data(‘product-image’);
// চ্যাটজিপিটির নির্দেশিত ১ম কোড: প্রোডাক্ট টাইপ ডাটা ধরা
let productType = $(this).data(‘product-type’);
$(‘#ipc-product-id’).val(productID);
$(‘#ipc-product-name’).text(productName);
$(‘#ipc-product-price’).text(‘৳ ‘ + productPrice);
$(‘#ipc-product-image’).attr(‘src’, productImage);
// চ্যাটজিপিটির নির্দেশিত ২য় কোড: প্রোডাক্ট টাইপ অনুযায়ী কন্ডিশন চেক করা
if(productType === ‘variable’){
$(‘#ipc-variation-wrapper’).html(
‘
Variable Product Detected
‘
);
$(‘#ipc-variation-wrapper’).show();
} else {
$(‘#ipc-variation-wrapper’).hide();
$(‘#ipc-variation-id’).val(”);
}
ipc_update_summary();
$(‘#ipc-popup-overlay’).fadeIn();
});
$(document).on(‘click’,’#ipc-close-popup’,function(){
$(‘#ipc-popup-overlay’).fadeOut();
});
$(document).on(‘click’,’#ipc-plus’,function(){
let qty = parseInt($(‘#ipc-quantity’).val()) || 1;
$(‘#ipc-quantity’).val(qty + 1);
ipc_update_summary();
});
$(document).on(‘click’,’#ipc-minus’,function(){
let qty = parseInt($(‘#ipc-quantity’).val()) || 1;
if(qty > 1){
$(‘#ipc-quantity’).val(qty – 1);
}
ipc_update_summary();
});
$(document).on(‘change’,’input[name=”shipping_area”]’,function(){
ipc_update_summary();
});
$(document).on(‘submit’,’#ipc-checkout-form’,function(e){
e.preventDefault();
$.ajax({
url: ipc_ajax.ajax_url,
type: ‘POST’,
data: {
action: ‘ipc_submit_order’,
security: ipc_ajax.nonce,
product_id: $(‘#ipc-product-id’).val(),
quantity: $(‘#ipc-quantity’).val(),
customer_name: $(‘input[name=”customer_name”]’).val(),
phone: $(‘input[name=”phone”]’).val(),
address: $(‘textarea[name=”address”]’).val(),
shipping_area: $(‘input[name=”shipping_area”]:checked’).val()
},
success: function(response){
if(response.success){
// Facebook Pixel Purchase
if (typeof fbq !== ‘undefined’) {
fbq(‘track’, ‘Purchase’);
}
// Google Analytics Purchase
if (typeof gtag !== ‘undefined’) {
gtag(‘event’, ‘purchase’, {
transaction_id: response.data.order_id
});
}
$(‘#ipc-checkout-form’)[0].reset();
$(‘#ipc-quantity’).val(1);
$(‘#ipc-popup-overlay’).fadeOut();
if(
ipc_ajax.redirect_url &&
ipc_ajax.redirect_url.length > 0
){
window.location.href = ipc_ajax.redirect_url;
} else {
alert(ipc_ajax.success_message);
}
} else {
alert(response.data.message);
}
},
error: function(){
alert(‘অর্ডার সাবমিট করতে সমস্যা হয়েছে।’);
}
});
});
});
cvbjQuery(document).ready(function($){
function ipc_update_summary() {
let price = parseFloat($(‘#ipc-product-price’).text().replace(/[^\d.]/g,”)) || 0;
let qty = parseInt($(‘#ipc-quantity’).val()) || 1;
let area = $(‘input[name=”shipping_area”]:checked’).val();
let shipping = 0;
if(area === ‘inside’){
shipping = parseFloat(ipc_ajax.inside_shipping);
} else {
shipping = parseFloat(ipc_ajax.outside_shipping);
}
let subtotal = price * qty;
let total = subtotal + shipping;
$(‘#ipc-summary-price’).text(‘৳’ + subtotal);
$(‘#ipc-summary-qty’).text(qty);
$(‘#ipc-summary-shipping’).text(‘৳’ + shipping);
$(‘#ipc-summary-total’).text(‘৳’ + total);
}
$(document).on(‘click’,’.ipc-buy-now-button’,function(){
let productID = $(this).data(‘product-id’);
let productName = $(this).data(‘product-name’);
let productPrice = $(this).data(‘product-price’);
let productImage = $(this).data(‘product-image’);
// চ্যাটজিপিটির নির্দেশিত ১ম কোড: প্রোডাক্ট টাইপ ডাটা ধরা
let productType = $(this).data(‘product-type’);
$(‘#ipc-product-id’).val(productID);
$(‘#ipc-product-name’).text(productName);
$(‘#ipc-product-price’).text(‘৳ ‘ + productPrice);
$(‘#ipc-product-image’).attr(‘src’, productImage);
// চ্যাটজিপিটির নির্দেশিত ২য় কোড: প্রোডাক্ট টাইপ অনুযায়ী কন্ডিশন চেক করা
if(productType === ‘variable’){
$(‘#ipc-variation-wrapper’).html(
‘
Variable Product Detected
‘
);
$(‘#ipc-variation-wrapper’).show();
} else {
$(‘#ipc-variation-wrapper’).hide();
$(‘#ipc-variation-id’).val(”);
}
ipc_update_summary();
$(‘#ipc-popup-overlay’).fadeIn();
});
$(document).on(‘click’,’#ipc-close-popup’,function(){
$(‘#ipc-popup-overlay’).fadeOut();
});
$(document).on(‘click’,’#ipc-plus’,function(){
let qty = parseInt($(‘#ipc-quantity’).val()) || 1;
$(‘#ipc-quantity’).val(qty + 1);
ipc_update_summary();
});
$(document).on(‘click’,’#ipc-minus’,function(){
let qty = parseInt($(‘#ipc-quantity’).val()) || 1;
if(qty > 1){
$(‘#ipc-quantity’).val(qty – 1);
}
ipc_update_summary();
});
$(document).on(‘change’,’input[name=”shipping_area”]’,function(){
ipc_update_summary();
});
$(document).on(‘submit’,’#ipc-checkout-form’,function(e){
e.preventDefault();
$.ajax({
url: ipc_ajax.ajax_url,
type: ‘POST’,
data: {
action: ‘ipc_submit_order’,
security: ipc_ajax.nonce,
product_id: $(‘#ipc-product-id’).val(),
quantity: $(‘#ipc-quantity’).val(),
customer_name: $(‘input[name=”customer_name”]’).val(),
phone: $(‘input[name=”phone”]’).val(),
address: $(‘textarea[name=”address”]’).val(),
shipping_area: $(‘input[name=”shipping_area”]:checked’).val()
},
success: function(response){
if(response.success){
// Facebook Pixel Purchase
if (typeof fbq !== ‘undefined’) {
fbq(‘track’, ‘Purchase’);
}
// Google Analytics Purchase
if (typeof gtag !== ‘undefined’) {
gtag(‘event’, ‘purchase’, {
transaction_id: response.data.order_id
});
}
$(‘#ipc-checkout-form’)[0].reset();
$(‘#ipc-quantity’).val(1);
$(‘#ipc-popup-overlay’).fadeOut();
if(
ipc_ajax.redirect_url &&
ipc_ajax.redirect_url.length > 0
){
window.location.href = ipc_ajax.redirect_url;
} else {
alert(ipc_ajax.success_message);
}
} else {
alert(response.data.message);
}
},
error: function(){
alert(‘অর্ডার সাবমিট করতে সমস্যা হয়েছে।’);
}
});
});
});
| Color |
Red ,Green ,Blue |
|---|

Reviews
There are no reviews yet.