• Welcome to KonaKart Community Forum. Please login or sign up.
 

Konakart 2.2.06 & Multi-Currency

Started by innes, June 01, 2008, 11:21:11 pm

Previous topic - Next topic

innes

Hi

First of all...great job with the new version.

But...always a but :-)

Is there any way to customise the formatPrice methods in the com.konakart.al.KKAppEng class?

I have a requirement for USD, GBP & EUR depending on where the Customer lives.  I have implemented this using Customer Groups, Product Price Ids and mapping Country Ids to a Currency Id.  My Payment Gateways will use the Customer's Currency.

The last thing is to format the price displayed to reflect the Customer's Currency.  In version 2.2.0.4 I had created my own version of the KKAppEng class that had a defaultCurrency and an activeCurrency.  I had hoped that v2.2.0.6 would allow me to customise this in the same way as other methods.

Do you have any suggestions or should I continue with my alternative KKAppEng class?

Regards,

Innes

ps. This started as a feature request, but on reflection became a programming question.  Feel free to move if there is a more appropriate section.

ryan

Hi,

For the App eng, my advice for now is to continue in a similar way as you did before by creating your own version of KKAppEng that is a subclass of ours. In a future release we could make this easier to achieve, so that you don't have to customize the code in so many places.

innes


innes

Hi

I have continued developing the multi currency using Customer Groups.  Couple of points though:

1) I think I may have found a bug with how the Prices are used based on the Customer Group.  Sometimes the Price is displayed using the correct Price Group and sometimes the default price is used (random new).  I have attached a screenshot.  Can you provide some guidance for the best place to hook in so that the Customer groups are respected evevrywhere the Price is displayed?

2) How do Specials work with Customer Groups and Prices?  The special is a new Price rather than a discount, so if I have different Prices for each of my Customer Groups the Special only applies to the default Price group.

Thanks,

Innes

pete

Hi,

The special price is only valid for price id = 0 (the default price). The what's new tiles and special tiles use cached data for performance reasons reasons and so display the same price for everyone.

When using different prices for different groups, the best thing to do is to disable these tiles.


innes

Thanks for the reply.

Is there an API call to reset the cache on a per user (session)  basis or does it affect all users?

I have hooks in to set the Customer Group (and associated currency) when a Customer logs in/out and when they switch currency manually (similar to switching Language).  What would be the impact of clearing the cache for the Specials and What's New here?

cheers,

Innes

pete

At the moment, the random specials tile and random new products tile use a global cache which is why they display the same information for everyone. If you require a  cache per customer, it wouldn't be too difficult to implement your own cache which is read by the JSP tiles. For populating the specials cache you need to use the getAllSpecials() API call and the getAllProducts() API call with ORDER_BY_DATE_ADDED for the random new product cache.

When the customer logs in, you'd have to refresh the caches with new data since the prices may change once the customer group is known.

innes

Thanks.

The more I think about this, the more it seems that the functionality for Customer Groups is incomplete.

According to the FAQ:

"Groups may be used to:
    * Control what prices are displayed to customers.
          o Each group has a PriceId attribute which may have a value of 0 to 3. When set to 0, a customer belonging to that group will see the normal price of the product (i.e. the price attribute). When set to 1, the customer will see the price defined in the Price 1 attribute of the product and so on for 2 and 3.  This functionality for example,  allows you to display wholesale prices to wholesale customers and retail prices to retail customers. If a customer belongs to no groups, then the price from the normal price attribute is displayed. Note that in the Admin App you may change the price labels from Price1, Price2 etc. to a more meaningful description such as Wholesale price, MRP, Employee price etc.
    * Enable promotions.
          o Promotions may be enabled for customers belonging to a particular group. i.e. You may want to enable certain promotions just for your retail customers."

It seems to me that Customer groups is 80% there but needs to be extended to be be usable.  At the moment too much customisation is required.  The same code is used in all the JSPs to display prices, so it's a bit frustrating to have to figure out what is cached where and how to work around it :-(

Are there plans to close this gap or is this how Customer groups were supposed to behave?

Innes


pete

For the KonaKart Engine, the work is complete.

For the application, as far as we can tell the random tiles don't work properly mainly because they were designed to use a global cache for efficiency. As pointed out earlier it shouldn't be too difficult to modify this behaviour for your requirements. You could even forget the cache and do a server engine call each time to get a random product by passing it a random offset and telling it to return only one product.

I don't think that we'll be implementing a cache for each user mainly because it would use up a lot more resources and most people don't need it. Have you found other places where it isn't working the way you'd like it to work ?

rula

Hi konakarts,

I have not the expected number format for the currency amounts from the konakart client engine and the
according manager objects.
e.g. in EditCartBody.jsp kkEng.getBasketMgr().getBasketTotal() brings 10.00EUR and I expected $ 10.00
Quote
getBasketTotal() returns the total price of the basket as a formatted string so that it may be used directly in the UI

but this is not that what I expect. What have I to do, that the client engine always delivers the correct currency format e.g. according a currency pattern. (###,##0.00 \u20AC for de and \u0024 ###,##0.00 for en) ?
regards, rula

ryan

The formatting information for each currency is stored in the currencies table and can be edited through the Admin App ( Localizations>>Currencies ). It will format the price based on the default currency being used.

rula

Hi ryan,

You mean the prices will be formated only by the default currency in the admin app. When the default currency is $ and the locale in the client app is switched from en to de, the currency should be stay by $ and not change to €. One and the same currency and format in admin app and client app, no matter which locale is selected in the browser. So, I have understood it.
regards, rula

ryan

That's right. The currency is normally the currency of the country where your store is situated. You could implement a currency conversion facility to give people an indicative price in another currency, but you would have to warn them that the transaction will be performed in the default currency and that the exchange rate that they receive from their credit card provider will most probably be different to the one that you show.

rula

Hi ryan,

thank you, now the currency mystery is cleared for me. regards, rula