News:

Looking for documentation? Take a look on our wiki

Main Menu

Discounted price and final price inline (in a single line)

Started by tserts, October 07, 2014, 00:29:57 AM

Previous topic - Next topic

tserts

Hello guys, I have spent so many hours on this it's not even funny.

I'm building a site for a client and I have managed to iron out many major and minor things but I can't for the life of me fix this little tiny thing:

In Category view, I want my baseprice price (which, after some tweeking, now shows up only when it should, and has a line-through) and then without breaking line, the discount price. What I have now is this:

QuoteFrom: 8,50 €
7,50 €

I need:

QuoteFrom: 8,50 € 7,50 €

I thought it would be easy but I keep messing it up, if anyone can help I would appreciate it...

Joomla 2.5.27
VM 2.6.8

This is my /components/com_virtuemart/views/category/tmpl/default.php the pricing part:

<div class="product-price marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if ($product->prices['salesPrice']<=and VmConfig::get ('askprice'1) and  !$product->images[0]->file_is_downloadable) {
echo JText::('COM_VIRTUEMART_PRODUCT_ASKPRICE');
}
//todo add config settings
if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ('basePrice''COM_VIRTUEMART_PRODUCT_BASEPRICE'$product->prices);
echo $this->currency->createPriceDiv ('basePriceVariant''COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT'$product->prices);
}
echo $this->currency->createPriceDiv ('variantModification''COM_VIRTUEMART_PRODUCT_VARIANT_MOD'$product->prices);
if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
echo '<div class="price-crossed" >' $this->currency->createPriceDiv ('basePriceWithTax''COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX'$product->prices) . "</div>";
}
if (round($product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
echo $this->currency->createPriceDiv ('salesPriceWithDiscount''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT'$product->prices);
}
echo $this->currency->createPriceDiv ('salesPrice''COM_VIRTUEMART_PRODUCT_SALESPRICE'$product->prices);

$unitPriceDescription JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE'$product->product_unit);
echo $this->currency->createPriceDiv ('unitPrice'$unitPriceDescription$product->prices);
?>


</div>

tserts

Can anyone at least tell me if I'm looking at the right place for what I want?

jenkinhill

Maybe use css margins applied to the div containing the price you wish to move.  Test with Firebug.
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

GJC Web Design

live site would help

but make what ever is surrounding the prices (span?) inline  - if that doesn't work check the container is wide enough
or try float them
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

tserts

Thanks guys... I will try to find the relevant spans...

By the way, live url is http://kidzbooks.tserts.info/book/first-reading-level-1 the first product is on offer.

GJC Web Design

not easy - needs

.product-price {
  width: 80%;
}
.price-crossed {
  display: inline !important;
}
.PricebasePriceWithTax {
  display: inline !important;
}
.PricesalesPrice {
  display: inline !important;
  float: right;
  width: 50px;
}

might be easier to alter your html

[attachment cleanup by admin]
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation