Skip to main content

Using "points" (with no cash value)

More
12 years 10 months ago - 12 years 10 months ago #133375 by andylinde
Hello,

I'm setting up my store to use 3 kinds of products:
- products with a price (in USD)
- free products
- products that "cost" points (which have no cash value)

My shop is set up to use USD as the main currency. This also works for free products. However, I'm running into 2 issues with products in the third category:
- Product "prices" are displayed like "$0.00 (5 Points) each". I'd prefer to have the products displayed as "5 Points each".
- Recently, the page shows the following error on load. While it's an error that makes sense, I think it's only come up after upgrading Joomla to 3.2 (though I can't confirm that is the cause, I do know that it was not showing that error earlier). It seems to display it once for each product in the current category.
Code:
Warning: Division by zero in /var/www/vhosts/[redacted]/administrator/components/com_hikashop/classes/currency.php on line 734

Is there a way to only display these products in Points (not USD)?

-- HikaShop version -- : Business 2.2.2
-- Joomla version -- : 3.2.0
-- PHP version -- : 5.3.2
Last edit: 12 years 10 months ago by andylinde.

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

More
12 years 10 months ago #133493 by Jerome
Hi,

In my HikaShop 2.2.2 package, line 734 is:
Code:
$prices[$k2]->taxes[$k]->tax_amount= $prices[$k2]->taxes[$k]->tax_amount/floatval($srcCurrency->currency_rate);
So it should means that your currency rate is "0".
But I see a division by the currency rate just 2 lines before. So it looks strange.
What is your line 734 ?

How did you configured your HikaShop store to have such kind of system ?

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

More
12 years 10 months ago - 12 years 10 months ago #133592 by andylinde
My line 734 is the same as yours:
Code:
$prices[$k2]->taxes[$k]->tax_amount= $prices[$k2]->taxes[$k]->tax_amount/floatval($srcCurrency->currency_rate);

I haven't done any overrides for that file.

I only have the 2 currencies enabled: USD and Points (which is a custom currency). I have set the individual items as x points, and then let the system take care of the rest. Under system > configuration > currency, I have the main currency set as USD.

Thank you!
Last edit: 12 years 10 months ago by andylinde.

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

More
12 years 10 months ago #133596 by Jerome
Hi,

So it looks like your currency rate is set to "0", you have to change it.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

More
12 years 10 months ago - 12 years 10 months ago #133627 by andylinde
I'm sorry; I'm not sure I understand. It seems like you are saying to change my currency rate inside of HikaShop to something other than 0. Doing that does get rid of the divide by zero error, but that doesn't give me a way to have these items display in only the points currency--it instead shows an item as (for example) $5.00 (5 Points).

Is there something that I should change in currency.php?
Last edit: 12 years 10 months ago by andylinde.

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

More
12 years 10 months ago #133678 by Jerome
Hi,

It is not the good way to do it.
1 - HikaShop display one currency at the time.
2 - So you can't use two currencies in the same time (see point 1).
3 - A rate 0 is not authorized in HikaShop, when a product have a price for a currency, you have to be able to show this price in another currency (because you see one currency at the time).
4 - Points is not a real currency so it's not compatible with most of payment plugins.
5 - If you have one product in USD and one product in Points, one of them will be free for the other (see point 4)

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

Time to create page: 0.271 seconds
Powered by Kunena Forum