[solved] Points ratio not working

More
7 years 11 months ago - 7 years 11 months ago #33099 by cpaschen
I've just purchased the buy points with hikashop plugin.

I've followed the instructions on the plugin page and everything is 'working', except the ratio is not working.

My Hikashop item is $1 for 1 point - so I set the ration to "1".

It works for 1 point.
However, if a user purchases more, the ratio doesn't work properly.

- Purchase 1 - Get 1
- Purchase 10 - Get 10
- Purchase 35 - Get 32 (loss of 3)
- Purchase 50 - Get 46 (loss of 4)
- Purchase 100 - Get 91 (loss of 9)

I adjusted the ratio to 1.09 and it works as long as we don't go over 100. Going over 100 (like to 500) gives wrong points again.

I'm running v0.9 of the plugin
AltaUserPoints - 1.1.3
Joomla 3.5.1
PHP 7
Last edit: 7 years 11 months ago by nordmograph.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago - 7 years 11 months ago #33101 by nordmograph
It must be becuse of a tax somehow. Please check.
The calculation includes the tax.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.
Last edit: 7 years 11 months ago by nordmograph.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #33104 by nordmograph
Here is the calculation rule on line 63
$pts2credit = (($item->order_product_price + $item->order_product_tax )/$currency_rate)* $item->order_product_quantity * $ratio;

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #33108 by cpaschen
Replied by cpaschen on topic Points ratio not working
Hmmm ... there are no taxes on any of our items.

We do have a 'transaction fee' added - which is different depending on the payment method you choose (one for PayPal, a different one for Stripe,etc.).

However, I have been testing with Check Payment checkout, which doesn't have any charges applied.

Also, from that calculation it doesn't appear that it takes into any payment processing fees (or shipping fees).

My question is what is the "$currency_rate" in that calculation? Is that from hikashop. If so, I'm wondering if that is where the formula is getting 'off'.
Do you know where that comes from?

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #33109 by cpaschen
Replied by cpaschen on topic Points ratio not working
It was the currency rate that was effecting this.

For those in the US (or other non-EU countries), the way HS handles currency rates causes a potential problem with this plugin.
That is because even when you select your own currency as the 'main' currency in HS, the EU is the 'benchmark' currency (i.e. given an index of "1.000"). So if your currency is anything other than "1.000" in HS currency controls, it will make your point conversion messed up.

The only way that I was able to resolve this (and I think the only way it could be resolved) is to just
- disable all alternate currency functions in HS
- set your currency rate to "1.000"
- disable the HS auto currency update plugin ("HikaShop rates auto update plugin")
- make sure the front-end currency change module is disabled

This definitely isn't a solution for sites that work across multiple currencies, but it solved our need (which is only for local currency).

If anyone else has some idea how to resolve this and keep multiple currencies active please jump in.

(I'm also going to post this on the HS forum to see if anyone knows how to get your own local currency to be 1.000).

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #33110 by cpaschen
Replied by cpaschen on topic Points ratio not working
[Sorry for not testing ALL the options before posting ... my brain is on weekend mode: -( ]
It turns out you must manually refresh rates for the rates to change (unless you have enabled the rates update cron job on your site).

There is a solution.
In Hikashop:
1. Set the default currency to your local currency
2. Click the little ">" icon to the right of the currency selector (to go to the currency rate page)
3. Click the UPDATE RATES button (top left)
4. Agree that it will change your rates

The rate for your local currency should now be set to 1.00 and all other currencies should be relative to your own currency.

And the 'buy points' plugin should properly adjust the points to match.

As usually ... great coding here ... just bad user ! :whistle:

Please Log in or Create an account to join the conversation.

Time to create page: 0.320 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.