CROSSED PRICE IN CATEGORY AND PRODUCT DETAIL VM3

Support desk for Multipurpose Quark Theme
GK User
Thu Apr 28, 2016 10:46 pm
Hi. I've seen some post in the forum about how to get the crossed price effect. In the case of the "Quark" template, I have a question:

Exactly where you should add this code ?, in that line or code should be replaced ?, thanks, greetings ... :idea: :?:

The files with this are:

/html/com_virtuemart/category/default.php
/html/com_virtuemart/productdetails/default.php

Here is the code You need to add over the price into /html/com_virtuemart/category/default.php

CODE: SELECT ALL
if ( $product->prices['basePrice'] != $product->prices['salesPrice']) {
echo '<span class="price-crossed" style="text-decoration: line-through;">' . $this->currency->createPriceDiv ('basePrice', '', $product->prices) . "</span>";

--------------------

For product page this code worked:

CODE: SELECT ALL
if ( $this->product->prices['basePrice'] != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" style="text-decoration: line-through;">' . $this->currency->createPriceDiv ('basePrice', '', $this->product->prices) . "</span>";
}
User avatar
Platinum Boarder

teitbite
Mon May 02, 2016 11:04 am
Hi

Depending if You wish to have this price over or under the regular price put it over or under this code:

Code: Select all
               <?php
               if ($this->show_prices == '1') {
                  if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                     echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                  }
                  echo $this->currency->createPriceDiv ('salesPrice', '', $product->prices);
               } ?>
User avatar
Moderator

GK User
Tue Aug 23, 2016 12:38 am
Hi. Thanks for your reply and sorry for the delay in responding ... I find your code in the file default.php ... probably not quite understand. You tell me I should go to /www.mydomain.it/templates/gk_quark/html/com_virtuemart/productdetails and also to: /www.mydomain.it/templates/gk_quark/html/com_virtuemart/categories. Search the code segment: <php?
               if ($ this-> show_prices == '1') {
                  if ($ product-> prices [ 'salesPrice'] <= 0 and VmConfig :: get ( 'askprice', 1) and $ product-> images [0] -> file_is_downloadable) {
                     Echo JText :: _ ( 'COM_VIRTUEMART_PRODUCT_ASKPRICE');
                  }
                  echo $ this-> currency-> createPriceDiv ( 'salesPrice', '', $ product-> prices);
               }?>

and copy and paste this other code:

if ($ product-> prices [ 'basePrice']! = $ product-> prices [ 'salesPrice']) {
echo '<span class = "price-crossed" style = "text-decoration: line-through;">'. $ This-> currency-> createPriceDiv ( 'basePrice', '', $ product-> prices). "</ Span>";
 and this:

if ($ this-> product-> prices [ 'basePrice']! = $ this-> product-> prices [ 'salesPrice']) {
echo '<span class = "price-crossed" style = "text-decoration: line-through;">'. $ This-> currency-> createPriceDiv ( 'basePrice', '', $ this-> product-> prices). "</ Span>";
}

Above or below the first segment of code as it suits me?

Thank you, thank you very much, Greetings ...
User avatar
Platinum Boarder

teitbite
Thu Aug 25, 2016 12:12 pm
hi

Yes, that's basically it. But from what You've copied here I think You will miss "?>" which is PHP code ending sign. So just to be safe copy my code with this extra opening/closing tags, like:

Code: Select all
<?php
if ($product->prices[ 'basePrice']! = $product-> prices[ 'salesPrice']) {
echo '<span class = "price-crossed" style = "text-decoration: line-through;">'. $this-> currency-> createPriceDiv ( 'basePrice', '', $product->prices). "</ span>";
?>

<?php
if ($this->product->prices [ 'basePrice']! = $this->product->prices [ 'salesPrice']) {
echo '<span class = "price-crossed" style = "text-decoration: line-through;">'. $this->currency->createPriceDiv ( 'basePrice', '', $this->product->prices). "</span>";
}
?>
User avatar
Moderator

GK User
Thu Aug 25, 2016 7:58 pm
Hi. I tried to add the code in these files, even in different positions, but does not work, I sometimes returns a blank page. You could tell me where add your code must, in line ?, which is in the case file for that product category ?, thanks, greetings. René
User avatar
Platinum Boarder

teitbite
Sat Aug 27, 2016 1:38 pm
Hi

Please send me an FTP to Your site and url to the page with example page of where You need it. I just noticed that in last version of code You have copied there are some uppercased letters and spaces in code where it should not be, so I need to check if this code is correct first.
User avatar
Moderator

GK User
Sat Aug 27, 2016 3:17 pm
Okay. Submitted credentials in private, thanks, greetings ...
User avatar
Platinum Boarder

teitbite
Mon Aug 29, 2016 1:03 pm
Hi

Are all Your recent questions about the same website ? I could not locate a Virtuemart pages at Your site at all. Tell me the exact url to the example so I know where to make this changes.
User avatar
Moderator

GK User
Mon Aug 29, 2016 1:09 pm
Hi. Yes, this issue relates exactly to the website that send him privately, with the credentials, now sent it back, thanks ... greetings
User avatar
Platinum Boarder

GK User
Mon Aug 29, 2016 1:25 pm
The Barred Price must appear on all products with discount applied using the rules VirtueMart ... Thanks greetings...
User avatar
Platinum Boarder

teitbite
Tue Aug 30, 2016 1:59 pm
Hi

Ok. I got 2 url's from You to fest... and taint... was checking on the site You've sent more recently.

I've just checked and everything You did worked fine, we just forgot to add a class to actually cross through this price. I've added this to override.css

Code: Select all
.price-crossed {
    text-decoration:line-through;
}
User avatar
Moderator

GK User
Tue Aug 30, 2016 2:23 pm
Hi. Thank you for your answer, the correct URL is festxxxxx.it. Now I just go in, but the prices do not appear Barred ... You will be shown correctly ?, thanks, greetings ...
User avatar
Platinum Boarder

teitbite
Tue Aug 30, 2016 4:03 pm
Hi

Do not know why You cannot see it. It's showing for me.
User avatar
Moderator

GK User
Tue Sep 06, 2016 11:07 am
Hi. Just finished the test, you post shipment, because I have different problems with Barred prices ... thanks, greetings ...
User avatar
Platinum Boarder

teitbite
Fri Sep 09, 2016 8:01 am
NETsystem.tv wrote:Hi. Just finished the test, you post shipment, because I have different problems with Barred prices ... thanks, greetings ...


I do not understand. What shipment ? I have not been in VM configuration to change anything, I've been only working with prices and a code we have been talking about.

Please lets move back a little:

- tell me the url to the page where You need this price crossed
- tell me what price should be crossed
User avatar
Moderator

GK User
Mon Sep 12, 2016 7:51 pm
Hi. Thanks for your reply. I will try to explain in the best possible way ...

1) Normally a matter of conversion, it is recommended not to have all Barred prices, but only some, this in order to point to the end customer convenience ... For this reason, besides a general rule settings VM3, it is necessary to define whether to see or not the price barred in a specific product, the case VM3 the possibility exists, but in my case it does not work, because whether or not I select the rule in the specific product, even so prices they are barred ...

2) Should be Barred only the price, not the text and price. For the text should be able to read well ...

3) You may be Barred "red" color?

4) It is possible that the price resulting Barred HomePage ?, ie they can be displayed Barred undiscounted price and the final price with discount next?

5) The other problem is that in my case, in the menu: http: //www.festxxx.xx/shop.html, prices of products are not ... I do not know why.

6) In my case, price calculations are not accurate or do not understand: Totale: € 90.00
Prezzo Base with VAT: 100.00 €
Sconto: -10.00 €
VAT tax: 16.23 €

7) In my case, when I add the product to the shopping cart, I go to the cart to pay two prices appear to me one off and one without discount, the problem that no Barred and the client does not understand that means, besides this, do not give me accurate calculations ...

* I have tried different combinations of rules and ways to view, but not resolved ... Any ideas ?, are several points excuse me, and understand that it is a known problem, since there is no plugin or module that solves this problem in VM3.

Thanks, Greetings from Italy ...
User avatar
Platinum Boarder

teitbite
Thu Sep 15, 2016 11:54 am
Hi

I have changed css to:

Code: Select all
.price-crossed span.PricebasePriceWithTax {
    text-decoration: line-through;
}


to cross the price only, but I'm afraid rest of Your price issues I simply do not know how to fix. You need to talk to VM support about that.
User avatar
Moderator

GK User
Thu Sep 15, 2016 8:55 pm
Hi. Thanks for your reply. One question: You can add the red to the line, for example: color: red ?, thanks, greetings.
*The Forum VM3, hardly use it, because I think it is something left, thanks.
User avatar
Platinum Boarder

teitbite
Sun Sep 18, 2016 10:48 am
User avatar
Moderator

GK User
Sun Sep 18, 2016 5:35 pm
Hi. Thank you for your indication, very useful. Tell me the path and name of the .css file, where you add the code to try to change the color ?, thanks, greetings ...
User avatar
Platinum Boarder

teitbite
Tue Sep 20, 2016 4:55 pm
Hi

Any new css or override to existing css class should be placed in template's /css/override.css
User avatar
Moderator

GK User
Thu Sep 22, 2016 11:40 am
Hi. Worked Code:

.price-crossed span.PricebasePriceWithTax {

color: red; text-decoration: line-through;

}

Thank you, very much... Greetings for Italy. René
User avatar
Platinum Boarder

teitbite
Sun Sep 25, 2016 2:02 pm
Hi

Ok. Great to hear it. Closing this thread now.
User avatar
Moderator


cron