Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter msaidefe

    (@msaidefe)

    How did you get on with this?

    I apologize for the delayed response.

    The issue was indeed related to the thousands separator, as you mentioned. Since I didn’t want to spend too much time contacting the other plugin author, I decided to try my luck by making a minor modification to your plugin, and it worked. The change I made was as follows:

    In ‘artiss-currency-converter/includes/convert-currency.php’:

    Line 137:

    $result = number_format( round( $number * ( $to * ( 1 / $from ) ), $dp ), $dp, '.', ',' ); // The trailing comma was removed 

    After making this change, I achieved the desired result. You might consider updating the plugin in this manner. Nevertheless, I want to express my gratitude once again for your assistance.

    • This reply was modified 2 years, 9 months ago by msaidefe.
    Thread Starter msaidefe

    (@msaidefe)

    No thank you and please don’t offer these – it’s not good practise to offer up site access like this to people you don’t know (and the mods here will take a dim view of it!).

    Thank you for the warning; you being the developer of the plugin I’m interested in, I suppose I can trust you 🙂 Moreover, the information I’m going to send is for a test environment anyway 🙂 Still, I appreciate your kind reminder.

    Does this mean that the product price is being added to the converted currency?

    Yes, that’s absolutely right.

    Thread Starter msaidefe

    (@msaidefe)

    Hi,

    I’m using the shortcode directly within the ‘Extra Product Options & Add-Ons for WooCommerce’ plugin, as this plugin allows shortcode usage.

    The code I’m using within the ‘Height (Cm)’ input is structured as follows:

    if(({this.value} >= 60) && ({this.value} <= 100), [convert number=25 from="usd" to="try"]+{product_price}, if(({this.value} >= 101) && ({this.value} <= 150), [convert number=30 from="usd" to="try"]+{product_price}, if(({this.value} >= 151) && ({this.value} <= 200), [convert number=34 from="usd" to="try"]+{product_price}, if(({this.value} >= 201) && ({this.value} <= 250), [convert number=38 from="usd" to="try"]+{product_price}, if(({this.value} >= 251) && ({this.value} <= 310), [convert number=42 from="usd" to="try"]+{product_price}, if(({this.value} >= 311) && ({this.value} <= 350), [convert number=46 from="usd" to="try"]+{product_price}, {product_price}))))))

    This code block works well until the [convert number=34 from=”usd” to=”try”] step. The result stays below the value of 1000. For instance, 34 dollars convert to 924 Turkish Liras.

    However, once we move to the [convert number=38 from=”usd” to=”try”] step, 38 dollars convert to 1033 Turkish Liras. This is when the issue begins as the value exceeds 1000. Feel free to test it yourself.

    If you’d like, I can also provide administrator credentials to your email address.

    Thank you for your attention.

    • This reply was modified 2 years, 10 months ago by msaidefe.
    • This reply was modified 2 years, 10 months ago by msaidefe.
    Thread Starter msaidefe

    (@msaidefe)

    I apologize for not providing a fully detailed explanation earlier, and I’d like to show you a live example now.

    Click

    The link I’ve left above directs you to a testing environment. The calculations are based on the values entered in the ‘Height (cm)’ section of this product. It displays accurate results for values entered between 60 and 200 because the total is still below 1000 Turkish Liras. However, when values are entered between 201 and 350, I’m not obtaining the desired results. This is because the converted Turkish Lira value of the dollar amount I’m calculating is now exceeding 1000 TRY.

    To elaborate further, the calculations are correct up to a height of 200 cm, but for values beyond that range, the results become nonsensical.

    Initially, I suspected the issue was related to the Extra Product Options plugin I’m using in that area. However, it seems that’s not the case. I’ve tested with other currency conversion plugins, and they don’t encounter this calculation problem either. They also don’t work for me because they can’t calculate the total in the cart. Your provided plugin is perfect for my needs. However, due to this unresolved issue, I’m unable to achieve what I intend.

    How can we resolve this situation? Thank you for your attention.

Viewing 4 replies - 1 through 4 (of 4 total)