Change Css in virtuemart

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun Jan 12, 2014 3:52 am
Reply with quote
Report this post
Hi.

Id like to change a litlle css in virtuemart. If you see the next link:
http://www.biturls.com/kpzCv

I´d like to see "Preço sem desconto: 8,50 €" equal to "Preço de venda: 7,50 €" with a line trough" like you can see in the image.
price.JPG


I´d like also not to see "Preço sem desconto: 8,50 €" when the product doesn't have a discount.
As you can see in the next link, this product doesnt have discount, but the line appears always:
http://www.biturls.com/ZxyBv

Thanks in advance
User avatar
Expert Boarder

GK User
Sun Jan 12, 2014 11:14 am
Reply with quote
Report this post
Please edit: /templates/gk_storebox/css/override.css and add at its end:
Code: Select all
div.PricebasePriceWithTax {
background: #fff;
color: #000;
font-size: 28px;
padding: 12px 0 16px;
}
span.PricebasePriceWithTax {
color: #c12f3c;
font-weight: 600;
font-size: 28px !important;
text-decoration: line-through;
}

Remember to enable "CSS override" in template settings - advanced section.

If you would like to remove oryginal price if product doesn't have a discount, some template VM files need to be edited. Are you ok with that?
User avatar
Moderator

GK User
Mon Jan 13, 2014 2:48 am
Reply with quote
Report this post
It worked perfect. Thanks.
I'm ready to edit the VM files ;)

What do i need to do?

Thanks again
User avatar
Expert Boarder

GK User
Mon Jan 13, 2014 5:31 pm
Reply with quote
Report this post
We need to find out, why this prace shows - there is a code fragment that should prevent it, but somehow it isn't working.
Please edit file:
templates/gk_storebox/html/com_virtuemart/productdetails/default.php

and fine this block of code:
Code: Select all
            echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices);
            if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
            }
            echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
            if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices);
            }            

and modify it temporary to:
Code: Select all
            echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices);
            if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
            }
            
            echo 'salesPrice:'.$this->product->prices['salesPrice'].'; basePriceWithTax:'. $this->product->prices['basePriceWithTax'].'; Round data:'. $this->currency->_priceConfig['salesPrice'][1]. '; Rounded basePriceWithTax:'.round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]);
            
            echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
            if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices);
            }

It will modify your single product page.
Now reload both pages (with product that has discount, and one without), and note the additional info for both. It should look this way:
Code: Select all
salesPrice:45; basePriceWithTax:45; Round data:2; Rounded basePriceWithTax:45

I need this debug data both for product with different sales and base price, and for a product where both prices are same.
User avatar
Moderator

GK User
Tue Jan 14, 2014 6:45 pm
Reply with quote
Report this post
Hi

What i got for the product with discount was:
salesPrice:7.5000011; basePriceWithTax:8.5000011; Round data:2; Rounded basePriceWithTax:8.5

for the product without discount was:
salesPrice:75.0000003; basePriceWithTax:75.0000003; Round data:2; Rounded basePriceWithTax:75

its that it?

Thanks
User avatar
Expert Boarder

GK User
Wed Jan 15, 2014 8:47 am
Reply with quote
Report this post
This doesn't look good. Same test with this code:
Code: Select all
echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices);
            if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
            }
           
            echo 'salesPrice:'.$this->product->prices['salesPrice'].'; basePriceWithTax:'. $this->product->prices['basePriceWithTax'].'; Round data:'. $this->currency->_priceConfig['salesPrice'][1]. '; Rounded basePriceWithTax:'.round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]). '; Rounded salesPrice:'. round($this->product->prices['salesPrice'], $this->currency->_priceConfig['salesPrice'][1]) .'; Price Test:'. round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) == round($this->product->prices['salesPrice'], $this->currency->_priceConfig['salesPrice'][1]);
           
            echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
            if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices);
            }
User avatar
Moderator

GK User
Wed Jan 15, 2014 11:50 am
Reply with quote
Report this post
h. if i put this code it gets me an error on line 215.

Thanks
User avatar
Expert Boarder

GK User
Wed Jan 15, 2014 5:52 pm
Reply with quote
Report this post
There was missing semiclon, please try now.
User avatar
Moderator

GK User
Fri Jan 17, 2014 5:24 pm
Reply with quote
Report this post
Hi. i´ve put the code but nothing appears now...

what next?

thanks
User avatar
Expert Boarder

GK User
Fri Jan 17, 2014 11:00 pm
Reply with quote
Report this post
Please send me a PM with:
1. URL to your website
2. ftp data (host, user, password)
3. link to this thread
4. Url to single product with discount, and to one without discount.
User avatar
Moderator

GK User
Sat Jan 18, 2014 1:00 am
Reply with quote
Report this post
Hi
i can send you that, but my client does not permit the discount price to be on unless its showing perfectly.
So right now its on and i´ve beendoing tests in local host.

How do you wanna do this?

Thnaks for your disponibility...
User avatar
Expert Boarder

GK User
Sat Jan 18, 2014 9:38 am
Reply with quote
Report this post
Please pack this file:
templates/gk_storebox/html/com_virtuemart/productdetails/default.php
with use of system zip capability and attach it to this thread.
User avatar
Moderator

GK User
Sat Jan 18, 2014 11:41 pm
Reply with quote
Report this post
Allright
Here it goes.

Thanks
User avatar
Expert Boarder

GK User
Tue Jan 21, 2014 2:28 pm
Reply with quote
Report this post
Please try with this default.php - again tell me what it will write on a product with discount ant without discount.
default.php.zip
User avatar
Moderator

GK User
Wed Jan 22, 2014 12:54 am
Reply with quote
Report this post
Hi
It says, with discount:
salesPrice:7.5000011; basePriceWithTax:8.5000011; Round data:2; Rounded basePriceWithTax:8.5; Rounded salesPrice:7.5

Without discount:
salesPrice:50.0000043; basePriceWithTax:50.0000043; Round data:2; Rounded basePriceWithTax:50; Rounded salesPrice:50

Thanks
User avatar
Expert Boarder

GK User
Thu Jan 23, 2014 12:51 pm
Reply with quote
Report this post
Ok, please remove all changes made to default.php (reupload original file from the package), then find this line:
Code: Select all
            if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
               echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";

and replace it with:
Code: Select all
            echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices);
            if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != round($this->product->prices['salesPrice'],$this->currency->_priceConfig['salesPrice'][1])) {
               echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";            }


This should help, but if not, without an access to a live site where I can see working examples and access it with ftp - I cant help further.
User avatar
Moderator

GK User
Fri Jan 24, 2014 1:05 am
Reply with quote
Report this post
Hi. Nop. It gives me a blank page....
User avatar
Expert Boarder

GK User
Mon Jan 27, 2014 4:49 pm
Reply with quote
Report this post
Ok, we need to do it other way. Could you create a duplicate installation on client server (in subfolder or subdomain) with copy a of database and send me a PM with:
1. URL to copied website
2. login and password of user with admin/super-admin privileges (please create one for me)
3. link to this thread
?
User avatar
Moderator


cron