View Issue Details

IDProjectCategoryView StatusLast Update
0002773OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2013-09-05 16:39
Reportertjungcl 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.5.0 revision 34568 
Target Version4.7.8 / 5.0.8Fixed in Version4.7.8 / 5.0.8 
Summary0002773: (price currency) --> (currency price) very hard to switch, although its standard in many other shops
DescriptionOxids templates show prices as <price> <curr>

Unfortunatelly the form <curr> <price> is also very common, it is used for example by amazon.de and ebay.de

In the templates the price is combined with currency as this:
[{ $_oBoxProduct->getFPrice() }] [{ $currency->sign}]

So to change it, you have to change two dozen templates and switch currency and price.

That is quite ugly thinking on oxid-updates and there is even one more problem:
For variant parents the getFPrice function returns "from 99,99"

The fact, that the "from" is included within getFPrice makes it impossible to put the currency before the number, like in "from € 99,99".

So a module a needed that adds the currency into the FPrice, and in all templates the <currency> would have to be removed.

Thats very much to change to just switch currency and price to something that could be thought of as the default way to display a price in germany.

I suggest a new function getFPriceAndCurrency() that returns the whole string. To switch price and currency, one would only have to overwrite that function. Or better: a flag in the admin could switch between the two formats.
Additional InformationI expect this issue will be closed and rejected as a feature request.

But please consider it for a moment:

I think of this as a flaw in the design of the v4x templates and had hoped that it would be fixed in 4.5

The suggested fix would have no compatibility issues, because the old FPrice function would still be the same, so all old templates would continue working just fine.
The required changes can be done with little effort in the source-code. And it would spare the shop-owners a lot of changes that are problematic to upgrade because 16 different tpls are affected.
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
MySQL Versionany

Activities

Linas Kukulskis

2013-09-05 16:39

reporter   ~0009037

added smarty plugin;
was:
[{ $_oBoxProduct->getFPrice() }] [{ $currency->sign}]

now:
[{ oxprice price=$_oBoxProduct->getPrice() currency=$currency }]

also to price can be passes simple float variable, instead of oxPrice object.
[{ oxprice price="7.17" currency=$currency }]


setup price format in admin:
[email protected] [email protected] ,@ [email protected] €@ 2
[email protected] [email protected] [email protected] @ [email protected] 2 @Front

@Front - will move price sign to front of price numbers

in next major version it will be used in templates (in patch we can change templates).