Currency sign

  • babylon5
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
11 years 7 months ago #29823 by babylon5
Currency sign was created by babylon5
Hello,

I need to have the currency sign at the right side of the sales price and the sales price with two decimals.

NOT: 5,5
BUT: 5,50 €


What do I have to change within the helper.php?

Kind Regards

Babylon5

Please Log in to join the conversation.

More
11 years 7 months ago #29827 by ivan.milic
Replied by ivan.milic on topic Currency sign
This code:
Code:
$db->setQuery("SELECT REPLACE(REPLACE(C.currency_positive_style,'{symbol}',C.currency_symbol ),'{number}',cast(P.product_price as decimal(19,2))) As pricetext FROM #__virtuemart_product_prices as P LEFT JOIN #__virtuemart_currencies as C on C.virtuemart_currency_id = P.product_currency WHERE P.virtuemart_product_id = '" . $product_id . "' LIMIT 1 "); $price_object = $db->loadObject(); //$price = $pr->prices['salesPrice']; $price = '<div class="productPrice">'.$price_object->pricetext.'</div>';

It should be with 2 decimals because in SQL you have:

,cast(P.product_price as decimal(19,2))) As pricetext

maybe this will do the job:

,cast(cast(P.product_price as decimal(19,2))) As nvarchar(50)) pricetext

Please Log in to join the conversation.

  • babylon5
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
11 years 7 months ago #29829 by babylon5
Replied by babylon5 on topic Currency sign
Perfect...now I have the currency sign, but instead the sales price the price without tax is shown. My customer needs the sales price including tax.

This code I used before:
$price = '<div class="productPrice">'.round($pr->prices,2).'

I need this, together with the currency sign

Thank you in advance

Please Log in to join the conversation.

More
11 years 7 months ago #29840 by ivan.milic
Replied by ivan.milic on topic Currency sign
you can use database read to get currency sign. Filed name is "C.currency_symbol"

Please Log in to join the conversation.

Time to create page: 0.157 seconds
Powered by Kunena Forum