View Issue Details

IDProjectCategoryView StatusLast Update
0003050OXID eShop (all versions)4.07. Source code, Testpublic2012-12-10 13:44
Reportertjungcl 
PriorityurgentSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.5.0 revision 34568 
Target VersionFixed in Version4.5.1 revision 38045 
Summary0003050: formated delivery costs not returned when zero
Descriptionthe function getFDeliveryCosts() in oxbasket returns the delivery costs as formated string.
This does not contain the currency, which is therefore added in all tpls, where this function is called.

it returns false, when delivery costs are zero, so combining with the currency, it would result in something like "costs: €" instead "costs: 4,90€".

Because of this, the call to getFDeliveryCosts() is sometimes wrapped in an extra check (using getDeliveryCosts()).

But:

Often this is not checked at all, and some basic-tpls getFDeliveryCosts() is checked instead (which may be the reason, why getFDeliveryCosts returns false on zero).

The problem about it is, that the function can not be used to show, that a shipping is free of costs (which normally is something good).

It should just return the formated costs and if a template does not want to show zero shipping costs, it can check getDeliveryCosts() (without the "F")
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

birute_meilutyte

2011-07-13 09:52

reporter   ~0004854

@developers: check from source code side if such issue still exist

dainius.bigelis

2011-07-22 13:44

reporter   ~0004880

Reminder sent to: tjungcl

Hi,

To be sure, the issue is only in emails or you found also somewhere else?

Regards,

tjungcl

2011-07-22 13:53

reporter   ~0004881

true, is mainly in the email-templates, but the function is also used in azures payment.tpl:

[{if $oxcmp_basket->getDeliveryCosts() }]
<div id="shipSetCost">
[{ oxmultilang ident="PAGE_CHECKOUT_PAYMENT_CHARGE" }] [{ $oxcmp_basket->getFDeliveryCosts() }] [{ $currency->sign}]
</div>
[{/if}]

This works as it is, but:
If you want to say, that you charge 0,00 € for shipping costs instead of saying just nothing, you can not just remove the if-condition:

getFDeliveryCosts() returns false if zero, so without the if-condition the template write only "€" instead of "0,00 €"

Of course you can counteract that by adding and else block and so on, but it would be much cleaner, if getFDeliveryCosts() would just return the formated deliverycosts and not a boolean.

Arunas

2011-07-22 14:52

reporter   ~0004883

fixed, oxBasket::getFDeliveryCost() method now always returns a formated delivery price even when it's 0