//===============================================================
// (Phase1)Revamp web purchase
// Upgrade button inside cart (12-month by default)
// Event delegation to handle dynamically loaded content
// console.log("Cart Button Clicked: " + buttonId);
// Debug log
// Determine the target class based on button ID
// Wait for content to be available
// Hide all content sections
// Show only the target class
// console.log("Target Class Displayed: " + targetClass);
// Preselect active month
// Remove existing 'selected' class
// Add 'selected' class to the matching card
// console.log("Matching Card Class: " + matchingCard);
// Stop checking after 5 seconds to avoid infinite loops
// Plan page main selection (months)
// Event delegation to handle dynamically loaded content
// console.log("Button Clicked: " + buttonId); // Debug log
// Determine the target class based on button ID
// Wait for content to be available
// Hide all content sections
// Show only the target class
// Preselect active month
// Stop checking after 5 seconds to avoid infinite loops
// console.log('inside activeOption');
// console.log("Class list: " + classList);
// console.log("Active Class : " + activeClass);
// Remove existing 'selected' class
// Add 'selected' class to the matching card
// Plan page bottom part selection (months)
// Event delegation to handle dynamically loaded content
// Determine the target class based on button ID
// Wait for content to be available
// Hide all content sections
// Show only the target class
// console.log("Target Class Displayed: " + targetClass);
// Preselect active month
// Stop checking after 5 seconds to avoid infinite loops
// Get the active month in #price-options
// console.log("other preselect: " + activeClass);
// Remove existing 'selected' class
// Add 'selected' class to the matching card
// Popup Main Cards Selection Group
// Check if the selected card is in epik-50-cart
}, 300); // Duration matches your CSS transition
// Popup SIM Type Cards Selection Group
// add to cookies when side card selected was applied start
// console.log(`Selected card in ${cartClass}:`, selectedCard);
// console.log(`Selected card data-id in ${cartClass}:`, dataId);
// Custom function call
// Function to attach MutationObserver to a specific cart
// Initial check in case a card is already preselected
// Apply to all carts
// add to cookies when side card selected was applied end
// check if both section in the side cart was selected
// console.log("Both plan and SIM type are selected.");
proceedUrl = '/plan/checkout/?tt_purchase_pack=' + selectedPlanId + '&sim_type=' + selectedSimType; // or use the dynamic home_url if available
// console.log('eSIM is selected');
// console.log('eSIM is not selected');
// Show the popup (if triggered somewhere)
toggleProceedButton(); //toggle proceed for esim popup
// Toggle Proceed button state
// console.log('trigger toggle button');
// console.log('aware is checked');
// console.log('aware is not checked');
// Attach event listener to the radio button
// Close esim popup
//===============================================================
// (Phase2)Enhanced webpurchase from here
// Function to get URL parameters
// Check for utm parameter
// Set cookie named 'utm_src' with value 'insider' for 2 days
expiryDate.setTime(expiryDate.getTime() + (2 * 24 * 60 * 60 * 1000)); // 2 days
// Change button text to "Upgrade Now"
// $('.main-selection-plan .elementor-button-text').text('Upgrade Now');
// Uncomment to hide the element
// Uncomment to hide the element
// Format and validate on input
let raw = this.value.replace(/\D/g, ''); // Remove non-digits
// Format as 01X-XXXX-XXXX
$('#loading-message').hide(); // Hide spinner if shown
$button.addClass('disabled'); // Disable button during check
const raw = formatted.replace(/\D/g, ''); // formated hpnumber
// set dynamic url
Your Selected Plan
Uncapped Speed for 5G and 4GUp to 900 Mbps - Anyday, Anytime
Unlimited Calls with Hotspot
Exclusive Games and Drama AccessPlay, Watch & Earn Tune Talk Points
FREE Personal Accident InsuranceRM50,000 Coverage
FREEfoodpanda
pandapro SubscriptionUnlimited Free Delivery & Member Deals
Uncapped Speed for 5G and 4GUp to 900 Mbps - Anyday, Anytime
Unlimited Calls with Hotspot
Exclusive Games and Drama AccessPlay, Watch & Earn Tune Talk Points
FREE Personal Accident InsuranceRM50,000 Coverage
Uncapped Speed for 5G and 4GUp to 900 Mbps - Anyday, Anytime