Using "points" (with no cash value)

  • Posts: 7
  • Thank you received: 0
11 years 6 days ago #133375

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.

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: 11 years 6 days ago by andylinde.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 6 days ago #133493

Hi,

In my HikaShop 2.2.2 package, line 734 is:

$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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 7
  • Thank you received: 0
11 years 5 days ago #133592

My line 734 is the same as yours:

$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: 11 years 5 days ago by andylinde.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 5 days ago #133596

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 7
  • Thank you received: 0
11 years 5 days ago #133627

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: 11 years 5 days ago by andylinde.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 5 days ago #133678

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum