/** * First Remove The Existing Pricing Filter So That It Will Be Available To All Users */ add_action(‘init’, ‘remove_existing_pricing_html’, 10); function remove_existing_pricing_html() { global $wc_wholesale_prices; remove_filter(‘woocommerce_get_price_html’, [$wc_wholesale_prices->wwp_for_non_wholesale_customer,’add_click_wholesale_price_for_non_wholesale_customers’], 10 ); } /** * Include Pricing HTML for all users */…Continue reading
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
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
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
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
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