Remove Specific Campaign Based on the Referral URL- v1

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(document.referrer.search.indexOf(‘google.com’) > 0) { // replace with the specific referral domain var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID-holder’); // replace CAMPAIGN_ID with the unique ID for your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove Specific Campaign Based on the Referral URL-v1

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(document.referrer.search.indexOf(‘google.com’) > 0) { // replace with the specific referral domain var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID’); // replace CAMPAIGN_ID with the unique ID for your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove Specific Campaign From Any URLs Containing a Specific URL Path-v1

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.search.indexOf(‘shopping-cart’) > -1) { // replace shopping-cart wtih your specific URL path var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID-holder’); // replace CAMPAIGN_ID with the unique ID of your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove Specific Campaign From a Specific URL-v1

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.href == ‘https://example.com/specific-page’) { // replace with your specific URL var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID-holder’); // replace CAMPAIGN_ID with your campaign’s unique ID optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove All Campaigns From a Specific URL-v1

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.href == ‘https://example.com/specific-page’) { // replace with your specific URL var optinCampaign = document.querySelector(‘#om-‘ + event.detail.Campaign.id + ‘-holder’); optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Add vendor’s details on customer’s order email

add_action(‘woocommerce_email_after_order_table’, ‘wcv_add_vendor_info_to_email’, 20, 4); function wcv_add_vendor_info_to_email($order, $sent_to_admin, $plain_text, $email) { if (!class_exists(‘WCV_Vendors’)) { return; // WC Vendors not active } // Collect vendor IDs from order items $vendor_ids = array(); foreach ($order->get_items() as $item) { $product_id = $item->get_product_id(); $vendor_id =…Continue reading

Allow Admin to Redeem Customer’s Loyalty Points to Store Credits

add_action(‘wp_ajax_migrate_loyalty_to_credits’, function() { // Only allow admin users if (!current_user_can(‘manage_options’)) { wp_send_json_error(‘Unauthorized access’, 403); } global $wpdb; $loyalty_table = $wpdb->prefix . ‘acfw_loyalprog_entries’; $credits_table = $wpdb->prefix . ‘acfw_store_credits’; // Get the points-to-store-credits conversion ratio $conversion_ratio = floatval(get_option(‘acfw_loyalprog_cost_points_ratio’, 1)); // Step 1:…Continue reading