WOOCS - WooCommerce Para Birimi Değiştirici


WooCommerce Ürün Eklentileri (WooCommerce tarafından)

Eklenti URL'si: https://woocommerce.com/products/product-add-ons/

  • Dosyada \plugins\woocommerce-product-addons\include\class-product-addon-cart.php sonraki kodu ekle:
    if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $carrrent = $WOOCS->current_currency; if ($carrrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $oran = $para birimleri[$carrrent]['oran']; //$fiyat = $fiyat / $oran; } } }

  • VE bu kodu ekleyin:
    $fiyat_temp = $eklenti['fiyat']; if (class_exists('WOOCS')) { global $WOOCS; $carrrent = $WOOCS->current_currency; if ($carrrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) { $currencies = $WOOCS->get_currencies(); $oran = $para birimleri[$carrrent]['oran']; $fiyat_temp = $fiyat_temp * $oran; } }

  • VE kodu değiştir:
    if ($addon['fiyat'] && 'percentage_based' !== $price_type && class_exists('WOOCS')) { global $WOOCS; $carrrent = $WOOCS->current_currency; if ($carrrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) { $currencies = $WOOCS->get_currencies(); $oran = $para birimleri[$carrrent]['oran']; $addon['fiyat'] = $addon['fiyat'] * $oran; } }

  • Dosyada \wp-content\plugins\woocommerce-product-addons\includes\class-product-addon-display.php kod ekle:
    $sonek = ''; //woocs düzeltmesi $woocs_is_multiple = 0; if (class_exists('WOOCS')) { global $WOOCS; $woocs_is_multiple = $WOOCS->is_multiple_allowed; }
  • VE kodu ekleyin: 'woocs_is_multiple' => $woocs_is_multiple
  • dosyada eklentiler\woocommerce-product-addons\assets\js\addons.js kod ekle:
        var woocs_exists = true; deneyin { if (woocs_current_currency) woocs_exists = true; } catch (e) { woocs_exists = false; } if (woocs_exists) { if (woocs_current_currency != undefined && woocs_current_currency['rate'] != undefined && woocommerce_addons_params.woocs_is_multiple == 0) { product_price = product_price * woocs_current_currency; } }

  • VE bu kodu ekleyin:
        var woocs_exists = true; deneyin { if (woocs_current_currency) woocs_exists = true; } catch (e) { woocs_exists = false; } if (woocs_exists) { if (woocs_current_currency != tanımsız && woocs_current_currency['oran'] != tanımsız && addon_cost != tanımsız) { addon_data.cost = addon_data.cost * woocs_current_currency['oran']; addon_data.cost_raw = addon_data.cost_raw * woocs_current_currency['oran']; } }

  • Mevcut wordpress temanızın function functions.php dosyasına kod ekleyin:
    add_filter('woocommerce_product_addons_option_price', 'woocs_compatib_woopd', 99990, 4); add_filter('woocommerce_product_addons_price', 'woocs_compatib_woopd', 99990, 4); function woocs_compatib_woopd($fiyat, $option, $i, $type) { if ($option['fiyat'] > 0 AND class_exists('WOOCS')) { global $WOOCS; $carrrent = $WOOCS->current_currency; if ($carrrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) { $currencies = $WOOCS->get_currencies(); $oran = $para birimleri[$carrrent]['oran']; $fiyat = '(' .wc_price(WC_Product_Addons_Helper::get_product_addon_price_for_display($seçenek['fiyat'] * $oran)) .')'; } } dönüş $fiyat; }