Sales "price without tax" instead of "Sales price"

GK User
Thu Apr 04, 2013 6:34 pm
Hi everybody,
I am working hard on this template to get it like my client wants it to be, and I encounter a problem.
I would like to have the "sales price" replaced by the "price without tax".
I think I found where to work on it but I need help.
May be there : /templates/gk_esport/html/com_virtuemart/productdetails/default.php
(line 240)
Here is a picture of what it is according to the template, and how I want it to be (my comments being in green) :
price_problem.jpg


I hope you will be able to help.
Thanks.
Kris
User avatar
Expert Boarder

GK User
Fri Apr 05, 2013 7:23 am
This are VirtueMart modifications, of course the first file is correct. I'm not sure but at your second screen I can see 'default VM view' so you need to look at default.php file inside html/com_virtuemart directory.
User avatar
Platinum Boarder

GK User
Fri Apr 05, 2013 8:40 am
The problem is that when I change this line :
Code: Select all
echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);

by this line :
Code: Select all
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);

I get this layout (this is the french version), but that is not the way I want it to be, because as you see the "price without tax" ("Prix H.T." in french) is not at the right place and the style is not what I want.
Capture d’écran 2013-04-05 à 09.18.30.jpg

This must be linked to the css file located here : /templates/gk_esport/css/vm.css
What can I do ?
Can I get som help for that ?
User avatar
Expert Boarder

GK User
Tue Apr 09, 2013 7:58 am
Maybe I don't uderstand properly but now the problem is with text only ? This part is generated by VM translation file so you should look there.
User avatar
Platinum Boarder

GK User
Tue Apr 09, 2013 8:33 am
No,
I finally managed to change to what I wanted in the product page yesterday night.
I am not good in php and css but managed to understand how it was coded and I changed it (it took me 1 to 2 hours where you would have spent 5 minutes. Now it is ok. It remains for me to change the price in cart, and category.
I will publish my changes in order for other to know rapidly how to do it (and for me to find it later for another project).
User avatar
Expert Boarder

GK User
Tue Apr 09, 2013 4:56 pm
In order to have the price without tax in big in the product detail page, I changed some lines :
In the default.php file (/templates/gk_esport/html/com_virtuemart/productdetails/default.php) around line 235, I changed this code :
Code: Select all
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
echo $this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices);
echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices);
$unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);
echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $this->product->prices);
}
to this code :
Code: Select all
echo $this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices);
echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices);
$unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
}


As I wanted to have the price without tax in red and big in the category view, I also changed things :

In default.php (/templates/gk_esport/html/com_virtuemart/category/default.php) I changed things aournd lines 240,
Code: Select all
echo $this->currency->createPriceDiv('salesPrice','',$product->prices);


to this
Code: Select all
echo $this->currency->createPriceDiv('priceWithoutTax','',$product->prices);

And then you have to change in the css :

In vm.css (/templates/gk_esport/css/vm.css), I replaced this lines :
Code: Select all
div.PricesalesPrice {
   margin: 30px -20px -10px;
   padding: 30px 20px 20px;
   font-size: 22px;
   color: #333;
   background: #fff;
}
span.PricesalesPrice {
   color: #EA3C3C;
}

by theses lines :
Code: Select all
div.PricepriceWithoutTax {
   font-size: 22px;
   color: #333;
}
span.PricepriceWithoutTax {
   color: #EA3C3C;
}


I hope that this will help people that want to have the price without tax visible instead of total price with tax.
User avatar
Expert Boarder

GK User
Thu Apr 11, 2013 11:15 am
Thanks for posting solution, surely it will be helpful for other members.
User avatar
Platinum Boarder


cron