PluginUs.Net -WooCommerceとWordPressのビジネスツール

[あなたのアイデアを実現する-あなたの夢を実現させる]

サポートフォーラム

サポートへのリクエスト(トピック)を作成するには、ログインする必要があります

おおよその価格が一定していません

サポートは土曜日と日曜日には機能しないため、一部の金曜日のリクエストには月曜日に回答できます。
24〜36営業時間以内にメールが届かない場合は、まずスパムボックスをチェックし、サポートからのメールがない場合は、フォーラムに戻ってここで回答を読んでください。 しない] メールでの回答[noreply@pluginus.net]フォーラムから!! メールはあなたの情報のためだけのものであり、すべての回答はここでのみ公開する必要があります。
サポートは土曜日と日曜日には機能しないため、一部の金曜日のリクエストには月曜日に回答できます。

こんにちは

テストしてください

In  file - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - these  functions - https://share.stackovergo.com/image/i20220520133633.png

All the magic happens here - https://share.stackovergo.com/image/i20220520140024.png

こんにちは

So far everything seems to be good finally :D Thanks a lot

ohh I see where I can modify now, so basically I just need to add another filter inside the if of show approx info, but how do you find the name of the filters ?

And why the approx word in the cart widget is upper case ?

 

Another question (which is not technical), I just need to know your opinion, do you think using Approx is good from a customer perspective ? do you know any example of an e-commerce website using it ?

 

Another question please, have you changed other files other than the plugin's files ?

I tried to copy the plugin's files from staging to the main website, the apporx prices are shown everywhere which is good, however this inconsistency still in some places, but afterwards it works except in the wallet transactions! just like magic! I don't know why!

I tried to copy the files to the staging again to replicate the issue, but the inconsistency appears again!!

I was trying to know from where this comes from but in vain!

Could you please tell me how do you solve this inconsistency of prices!

こんにちは

 but how do you find the name of the filters ? - 残念ながら、私はあなたの質問を理解していませんでした。

And why the approx word in the cart widget is upper case ?  - Because the following string is added in the code - https://share.stackovergo.com/image/i20220523084736.png

I just need to know your opinion, do you think using Approx is good from a customer perspective ? - Unfortunately we didn't do any research. This functionality is a request from our users

have you changed other files other than the plugin's files ? - All changes are only in this file - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php

Could you please tell me how do you solve this inconsistency of prices! - Unfortunately, there is no universal way, for each case an investigation is needed.

こんにちは、

1- For example add_filter('woocommerce_cart_total, array($this, 'woocommerce_cart_total'), 9999, 1); how to know the name of the filter (or is it called hooks in wp I suppose ? ) here woocmmerce_cart_total ?

2- 3- OK thanks.

4- yeah, but where it comes from!!  basically the plugin should take the price, multiply by the rate and echo it! Could you please tell me how you are debugging it ? do you use any plugins for that ? Thanks in advance

 

 

 

こんにちは

Unfortunately I'm not a programming teacher

1 Please  read  this  - https://developer.wordpress.org/plugins/hooks/

4 For debugging I use FTP client.  find the desired function using Ctrl+F.  To display the desired information (for example, the price) I use the function  var_dump()

こんにちは、

Yeah I am just a beginner who wants to learn more, I am really sorry for my endless questions.

I will try to debug and see if I can know what is happening!  Thanks for the information.

Do you know if there is a way to test this functionality with different countries ? I tried a proxy to change the country but it does not work!

こんにちは

これを読んでください- https://currency-switcher.com/using-geolocation-causes-problems-doesnt-seem-to-work-for-me

こんにちは、

Thank you very much for the instructions.

The GeoIP seems to be working, Is there a way to set the store currency to USD and show the approx price always, unless the user change it manually on the woocs widget ?

Now the behavior is when a user -let's say from France- landed on the website, the currency will change to Euro and thereby the approx prices will not show!  I want to show the prices in USD for all countries and show the approx prices based on the GeoIP of the user ?

こんにちは

unfortunately the plugin does not have this feature.

コードをカスタマイズする必要があります。

In file - wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php -  find all functions that add"Approx" and change this code - https://share.stackovergo.com/image/i20220526094956.png

 

 

こんにちは、

その場合、 $user_currency 常になります USD , even if the user tries to change it manually, the function will get executed again (because the approx price is activated) and it will override the value  chosen by the user from the widget.

I will try to investigate it more, or if yo have any other hints please let me know.

ありがとうございます。

こんにちは

その場合、 $user_currency 常になります USD , even if the user tries to change it manually, the function will get executed again (because the approx price is activated) and it will override the value  chosen by the user from the widget. - Absolutely no! It does not affect the current currency

こんにちは、

But when I tried yesterday I ran into this issue. It worked, however when I wanted to change the currency manually from the widget, it keeps returning back to USD.

Anyways, I managed to get it to work, basically the logic was there, but maybe it is a bug or something.

So here is what I did, maybe it will help someone who wants to achieve the same workflow.


I found that there is a logic for Welcome user currency activation(ここに https://prnt.sc/3EQUSJ8n4M0O ) which is set to USD on the plugin settings, so basically on the first visit of the user the currency should be USD. But that's not the case, if the user is from a country which is defined on the GeoIP rules, the currency will be changed accordingly.

So after some investigation I noticed that the value you are getting inside the if condition woocs_first_unique_visit is never set up on the entire script, that's why this bloc of code will never run.

I found that you are setting a similar value inside function init_geo_currency() どちらである woocs_first_unique_geoip so I replaced the previous string with this one, and it worked.

 

However, the previous logic was also good, Maybe in the future, I will need the plugin to change the currency automatically based on the GeoIP rules.

So to not to loose both options, what I did is I added another option to the settings https://prnt.sc/2MHSmXuaTiSy and I added this condition inside the if ステートメント

最終的なコードは次のとおりです。

1- file ./views/plugin_options_2.php:  https://prnt.sc/R75yQlDRCWXu

<!-- another option to whether activate or not the welcome currency -->

<td data-title="<?php echo esc_html__('Option', 'woocommerce-currency-switcher') ?>">
<?php echo esc_html__('Activate welcome currency on first visit', 'woocommerce-currency-switcher') ?>
XNUMX:XNUMX-XNUMX:XNUMX
<td data-title="<?php echo esc_html__('Status', 'woocommerce-currency-switcher') ?>">
<div class="woocs__table-card">
<?php echo draw_switcher23('woocs_activate_welcome_currency', get_option('woocs_activate_welcome_currency', 0)); ?>

XNUMX:XNUMX-XNUMX:XNUMX
<td data-title="<?php echo esc_html__('Description', 'woocommerce-currency-switcher') ?>">
<div class="woocs__table-desc">
<div class="woocs__table-desc-body">
<?php echo esc_html__("If True, on the first visit of the user, the currency will be set to the welcome currency selected above until he change it manually. Leave it False if you want the plugin to change it automatically to the adequate currency based on the GeoIP rules.", 'woocommerce-currency-switcher') ?>


XNUMX:XNUMX-XNUMX:XNUMX

 

2- file ./classes/woocs.php  https://prnt.sc/u_rvOIrOXuj2

( note: there are two places with the same logic, I changed them both)

//ウェルカムユーザー通貨のアクティブ化
if (intval($this->storage->get_val('woocs_first_unique_geoip')) === 0 AND get_option('woocs_activate_welcome_currency', 0)) {
$ this-> is_first_unique_visit = true;
$ this-> set_currency($ this-> get_welcome_currency());
$ this-> storage-> set_val( 'woocs_first_unique_geoip'、1);
}

3- file ./classes/woocs.php https://prnt.sc/EWs0Xg7cMXvp

// activate welcome currency
update_option('woocs_activate_welcome_currency', 0);

4- file ./classes/woocs.php https://prnt.sc/WsxkSBI38UFu

// activate welcome currency
update_option('woocs_activate_welcome_currency', (int) $_POST['woocs_activate_welcome_currency']);


I don't know yet if there are any side effects to what I did, but it worked perfectly so far.

Please give me your feedback or correct me if I made a mistake.

ありがとうございます!

こんにちは

Thank  you for  your  cooperation!

こんにちは、

 

あなたは歓迎されています:)