3 Month

add_action( ‘init’, ‘export_all_completed_orders_test’ ); function export_all_completed_orders_test() { if ( isset( $_GET[‘export_customers’] ) && $_GET[‘export_customers’] === ‘1’ ) { if ( ! current_user_can( ‘manage_options’ ) ) { wp_die( ‘Access denied’ ); } header( ‘Content-Type: text/csv; charset=utf-8’ ); header( ‘Content-Disposition: attachment; filename=all_completed_orders.csv’…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

Product Detail from External Source (copy)

function my_produkt_detail($ean, $field_path = ”, $default = ”) { static $cache = array(); try { if (empty($ean) || !is_string($ean)) { return $default; } if (!isset($cache[$ean])) { $detail_url = “https://db.ecoinform.de/ecodb.php/produktdetail?partner=2a3ea8f338618ff8&lang=DE&ean=” . urlencode($ean); $response = wp_remote_get($detail_url, array( ‘timeout’ => 30, ‘headers’ =>…Continue reading

Product Detail from External Source

function my_produkt_detail($ean, $field_path = ”, $default = ”) { static $cache = array(); try { if (empty($ean) || !is_string($ean)) { return $default; } if (!isset($cache[$ean])) { $detail_url = “https://db.ecoinform.de/ecodb.php/produktdetail?partner=2a3ea8f338618ff8&lang=DE&ean=” . urlencode($ean); $response = wp_remote_get($detail_url, array( ‘timeout’ => 30, ‘headers’ =>…Continue reading

Esraa Ahmed

<script id=”Microsoft_Omnichannel_LCWidget” src=”https://oc-cdn-public-eur.azureedge.net/livechatwidget/scripts/LiveChatBootstrapper.js”” onerror=”(function(el){el.parentNode.removeChild(el);var s=document.createElement(‘script’);s.src=’https://ocprodpubliceurgs.blob.core.windows.net/livechatwidget/scripts/LiveChatBootstrapper.js’;s.setAttribute(‘id’, ‘Microsoft_Omnichannel_LCWidget’);s.setAttribute(‘data-app-id’, ‘0ed30dad-2656-43ce-b290-e393b6a96d2f’);s.setAttribute(‘data-lcw-version’, ‘prod’);s.setAttribute(‘data-org-id’, ‘0b965a30-b361-f011-8ee5-000d3ab5d97a’);s.setAttribute(‘data-org-url’, ‘https://m-0b965a30-b361-f011-8ee5-000d3ab5d97a.eu.omnichannelengagementhub.com’);document.body.appendChild(s);})(this);” data-app-id=”0ed30dad-2656-43ce-b290-e393b6a96d2f” data-lcw-version=”prod” data-org-id=”0b965a30-b361-f011-8ee5-000d3ab5d97a” data-org-url=”https://m-0b965a30-b361-f011-8ee5-000d3ab5d97a.eu.omnichannelengagementhub.com” async></script>Continue reading

Untitled Snippet

const crypto = require(‘crypto’); const secret = ‘•••••••••’; // Your verification secret key const userId = current_user.id // A string UUID to identify your user const hash = crypto.createHmac(‘sha256’, secret).update(userId).digest(‘hex’);Continue reading

Add Product Listing Parameters to Google Product Feed

function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { $product_name = $product->get_name(); $label = $product_name . ‘ Shopping Product Card’; $feed_item->purchase_link .= ‘?utm_content=’ . rawurlencode( $label ); return $feed_item; } add_filter( ‘woocommerce_gpf_feed_item_google’, ‘lw_woocommerce_gpf_feed_item_google’, 10, 2 );Continue reading