News:

Support the VirtueMart project and become a member

Main Menu

No strikethrough on "Price" on featured items on the front page

Started by ffh4500, February 24, 2013, 11:14:30 AM

Previous topic - Next topic

ffh4500

Hi all,

Been working on this for most of the day. I have been able to get the pricing how I want it. Currently have Price with a strikethrough through it and an Our Price with the selling price underneath.
You can see examples here: http://purelycases.com/shop

The problem I have is when using latest, featured, top ten or recent on the front page of the website, the strikethrough does not show.
You can see examples here: http://purelycases.com/

Any help with this would be greatly appreciated. Here is what I am running:

Joomla 2.5.8
VM 2.0.18a

Cheers,

FFH

ffh4500

OK so I have created a template over ride by copying default.php from modules/mod_virtuemart_product/tmpl to /templates/MYTEMPLATE/html/mod_virtuemart_product/

I believe this should effect the over ride. Now the only issue I have is how to get a strikethrough on the Price display. If someone could give me a hand with that it will be all done.

Cheers,

FFH.

ffh4500

Quote from: ffh4500 on February 25, 2013, 10:12:32 AM
OK so I have created a template over ride by copying default.php from modules/mod_virtuemart_product/tmpl to /templates/MYTEMPLATE/html/mod_virtuemart_product/

I believe this should effect the over ride. Now the only issue I have is how to get a strikethrough on the Price display. If someone could give me a hand with that it will be all done.

Cheers,

FFH.

Well that didn't work, surely there is a solution for this??

ffh4500

Been looking for a solution for this for 4 days now, I can't believe there is no solution and/or no one out there knows of a solution.   :(

This is very frustrating.

Peter Pillen

which price display are you referring to? I see the ones on your featured display (home page) does not show the strike-trough... is it that one?

ffh4500

Quote from: P2 Peter on February 28, 2013, 17:48:12 PM
which price display are you referring to? I see the ones on your featured display (home page) does not show the strike-trough... is it that one?

Yes Peter, that is the one. 

Just for the record, I have tried all the default Joomla templates with no change so I thought it was a core VM system fault rather than template, hence I originally posted in "Administration & Configuration VM 2". Thank you to the Mod who has moved this here, particularly if I get a solution.   :D

Peter Pillen

try this ... go to file administrator/components/com_virtuemart/helpers/currencydisplay.php

look for if($forceNoLabel) ... some around line 380

you can see how I integrated it below... I added the part START MODIFICATION to END MODIFICATION

on my website you can see the code in action

<?php if($forceNoLabel) {
return '<div class="Price'.$name.'" style="display : '.$vis.';" ><span class="Price'.$name.'" >'.$priceFormatted.'</span></div>';
}
$descr = '';
if($this->_priceConfig[$name][2]) $descr = JText::_($description);
//  vmdebug('createPriceDiv $name '.$name.' '.$product_price[$name]);
// ==
// START MODIFICATION
// ==

// Checks if there is a discount.
if ($name == "discountAmount" && $vis == "none")
{
// If discount is empty (discountAmount) (display: none) it gives you an empty string instead of <div>
return "";
}

// If you have an discount and want to show the Price with Tax
if ($name == "basePriceWithTax")
{
// Checks if there is a discount.
if(!empty($product_price['discountAmount']))
{
 // Discount exist: Show Price with Tax and with an extended CSS class
 $css = "red";
 return '<div class="Price'.$name.'" style="display : '.$vis.';" >'.$descr.'<span class="Price'.$name.$css.'" >'.$priceFormatted.'</span></div>';
}
}

// ==
// END MODIFICATION
// ==
if(!$switchSequel){
?>

ffh4500

Quote from: P2 Peter on March 01, 2013, 15:27:32 PM
try this ... go to file administrator/components/com_virtuemart/helpers/currencydisplay.php

look for if($forceNoLabel) ... some around line 380

you can see how I integrated it below... I added the part START MODIFICATION to END MODIFICATION

on my website you can see the code in action

Thanks for that Peter, That didn't give me the results I was after. I am not trying to lose the strikethrough, I want it. But I want it to display on my featured items on my home page as well. Everything I have tried just simply won't work.

Any thoughts?

Cheers.

ffh4500

Ok, seeing as though no one seems to know how to get the strikethrough to happen on "Featured" items, least of all me. Does anyone know how to completely remove that pricing from the "Featured" items page? The "Price" field is COM_VIRTUEMART_ORDER_PRINT_PRICE.

Having nothing there is better than not having a strikethrough. Any help with this is greatly appreciated.

Cheers.

jenkinhill

QuoteThe "Price" field is COM_VIRTUEMART_ORDER_PRINT_PRICE.
Nope. That is for printing the price in the invoice/order.

To add strikethough to featured products etc can be done simply:
Open joomla_root/components/com_virtuemart/views/virtuemart/tmpl/default_products.php

Find:

echo $this->currency->createPriceDiv( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices );


replace with

echo '<span class="price-crossed" >' . $this->currency->createPriceDiv( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices ) . "</span>";


Save the file and use as a template override.  See http://www.ostraining.com/blog/joomla/overrides  and  http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

ffh4500

Quote from: jenkinhill on March 10, 2013, 15:07:53 PM
QuoteThe "Price" field is COM_VIRTUEMART_ORDER_PRINT_PRICE.
Nope. That is for printing the price in the invoice/order.

To add strikethough to featured products etc can be done simply:
Open joomla_root/components/com_virtuemart/views/virtuemart/tmpl/default_products.php

Wooohoooo, Thank you so much Jenkinhill. That's exactly what I was trying to achieve. Much Kudo's to you.   ;D

FFH