// 1. Product Page par Lot Size aur Delivery Date box dikhane ke liye
add_action( 'woocommerce_before_add_to_cart_button', 'st_wholesale_fields_setup', 15 );
function st_wholesale_fields_setup() {
echo '
';
// Lot Quantity Field
echo '
';
// Delivery Date Field
echo '
';
echo '
';
}
// 2. Is data ko Cart aur Inquiry ke saath attach karne ke liye
add_filter( 'woocommerce_add_cart_item_data', 'st_save_wholesale_data_to_cart', 10, 2 );
function st_save_wholesale_data_to_cart( $cart_item_data, $product_id ) {
if ( isset( $_POST['wholesale_lot_qty'] ) ) {
$cart_item_data['wholesale_lot_qty'] = sanitize_text_field( $_POST['wholesale_lot_qty'] );
}
if ( isset( $_POST['wholesale_delivery_date'] ) ) {
$cart_item_data['wholesale_delivery_date'] = sanitize_text_field( $_POST['wholesale_delivery_date'] );
}
return $cart_item_data;
}
// 3. WhatsApp Inquiry Button (Order Number ke saath track karne ke liye)
add_action( 'woocommerce_single_product_summary', 'st_whatsapp_inquiry_with_tracking', 35 );
function st_whatsapp_inquiry_with_tracking() {
global $product;
$product_name = $product->get_name();
$product_url = get_permalink($product->get_id());
// Apna WhatsApp number 91 ke baad yahan dalein
$whatsapp_num = "91XXXXXXXXXX";
$message = "Hello, I am interested in " . $product_name . ". Can you tell me the status of my wholesale inquiry? Product Link: " . $product_url;
$url = "https://wa.me/" . $whatsapp_num . "?text=" . urlencode($message);
echo 'Chat for Status Update';
}
DES-2832 3MM GPO LACE – SAHAJANAND TEX
This is a demo store for testing purposes — no orders shall be fulfilled. Dismiss
Reviews
There are no reviews yet.