News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Price view: add text after price value

Started by sallyit, June 28, 2012, 10:52:47 AM

Previous topic - Next topic

sallyit

Joomla 2.5.4 + Virtuemart 2.0.6.

Sorry for my bad english.
I'm configuring an italian e-commerce and I need to add text "+IVA" AFTER the "SALESPRICE_WITHOUT_TAX" value.
I simply want to view price like that:

Price: € 10,00 +IVA

I tried to modify the file vm.css  e default.php (in templates/mytemplate/html/com_virtuemart/productdetails/default.php) but the text is been wrapped, like that:
Price: € 10,00
+ IVA

Someone can help me? Thank you in advance.

srajca

I'm new to PHP but maybe you can try this code
in your productdetails/default_showprices.php find this code
echo $this->currency->createPriceDiv('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
and change it with this one
echo $this->currency->createPriceDiv('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices) . ' + IVA';
Let me know if it works.

sallyit

Thank you for your answer.

It does'nt work. Same problem: it is been wrapped, like that:

Price: € 10,00
+ IVA

I think the problem is in the "vm.css", in the FLOAT property... but I can't solve it..... :-\ .... are several days that I'm fighting with this part of code.

sallyit

....to be more precise I'm working on this file:
/templates/mytemplates/html/com_virtuemart/productdetails/default.php.

Other variation works good excluded this..... >:(

srajca

looking at it quickly now, what you could do is maybe the following. I can't guarantee that it will work.
Replace the code mentioned before with this one
echo $this->currency->createPriceDiv('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices, 'COM_VIRTUEMART_PRODUCT_PLUS_IVA');
and then go to your languages folder and add COM_VIRTUEMART_PRODUCT_PLUS_IVA=" + IVA" to your en-GB.com_virtuemart.ini or/and it-IT.com_virtuemart.ini

as I said this was a quick look at the code, I am no expert, hardly a beginner ;) but give it a try and let me know if it works.

sallyit

Thank you very much for your interesting and code, but unlikely it does'nt work.
... with a little bit modification it prints:

Prezzo: € 10,00
COM_VIRTUEMART_PRODUCT_PLUS_IVA

I repeat: I was able to set it to write "+ IVA" but the problem is that text "+IVA" is printed in a row below.  ???

I can't believe this customization is so hard...... I write in the italian Virtuemart forum too, but nothing.  :-\


srajca

yeah I doubted myself as well that the code should work. Well now that I think of it, you would have to find where can you edit the $this->product->prices, because it has to be done so that after every price display it inserts a </br> which has to be otherwise if you would have more than one price display it would all be in one line. That is my guess however. I don't know much of PHP or Virtuemart, I barely started ;) So maybe one of the developers should be able to help here.
So far what I can suggest is that you use price without IVA which is another way of saying $$$ + IVA.

srajca

#7
hey what if you try this

<?php  echo number_format($this->product->prices['costPrice'], 2, ',', ' ') . ' + IVA';  ?>

add it to your productdetails/default_showprices.php

let me know if it works

vmhabib

#8
Hello !
For me it is a very good result to get something like this:

Price: € 10,00
+ IVA
or
Price: € 10,00
per day
Please tell me what's the necessary to modify for it.

Kindy regards !

david_a

Hi this works for me, although it is a bit crude:

BACK EVERYTHING UP FIRST

In views\productdetails\tmpl\default_showprices.php find

echo $this->currency->createPriceDiv('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);

(or the code for whichever of the price options you wish to display) and add this line below putting in whatever text you require inside the <div> tags or call a language file if you prefer

echo '<div class="vatText">incl vat</div>';

then in vmsite-lts.css add the styles:

div.PricesalesPrice {
    min-width: 45px;
    padding-right: 5px;
    float: left;
}

to style the text itself use

div.vatText {
    font-size: 11px;
}

and style as you require

For the category browse page do the same in views\category\tmpl\default.php

Cheers  David





Cr3ativ3

Hi i know this topic has not been discussed for a long time but i thought i would share my solution that may help others who come across this potential problem:

Please see:
http://forum.virtuemart.net/index.php?topic=123405.0
Live to ride, ride to live!
J2.5.27
J3.4.1
VM2.6.10
VM3.09