I need to fix the code to display the different prices we have in my site http://negre.es/tienda/
When I have a discount price the product details displays the discounted price directly and down (before buy option), the discount amount. What about the original price? I need it to display the three options.
I've tried to modify this steps: http://forum.virtuemart.net/index.php?topic=96175.0
Here's the code I've found into my "product details" template
- Code: Select all
<div class="product-extra-information">
<script type="text/javascript">
jQuery(document).ready(function() {
if(jQuery('.pblock1').length){
}else{
jQuery('.pblock2').css({ 'width' : '100%', 'float' : 'none' });
}
});
</script>
<div class="product-pricetitle" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
<?php echo $this->currency->createPriceDiv ( 'salesPrice', '', $this->product->prices );?>
<?php echo '<div class="PricetaxAmount">'.$this->product->prices['VatTax'][1][0].'</div>'; ?>
</div>
<?php // Product custom_fields normal
if (!empty($this->product->customfieldsSorted['normal'])) { ?>
<div class="product-fields pblock1">
<?php foreach ($this->product->customfieldsSorted['normal'] as $field2) { ?>
<div class="product-field-type-<?php echo $field2->field_type ?>">
<label class="product-fields-title" ><?php echo JText::_($field2->custom_title) ?></label>
<span class="product-fields-value"><?php echo $field2->display ?></span>
</div>
<?php } ?>
</div>
<?php } ?>
<?php
$iManufacturer = $this->product;
JRequest::setVar('virtuemart_manufacturer_id',$iManufacturer->virtuemart_manufacturer_id,'GET');
$model = VmModel::getModel('manufacturer');
$manufacturerURL = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $iManufacturer->virtuemart_manufacturer_id);
if ($iManufacturer->virtuemart_manufacturer_id !=0 ) {
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer,1);
$manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image-product-page"',false);
} ?>
</div>
<div class="product-manufacturer-information">
<div class="pleft">
<div class="product-field-type-S">
<label class="product-fields-title" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DETAILS_MANUFACTURER_LBL') ?></label>
</div>
</div>
<div class="manufacturer-image pright">
<a title="<?php echo JText::_('TPL_GK_LANG_VIRTUEMART_PRODUCTS_DISPLAY_MANUFACTURER_PRODUCTS') ?><?php echo $iManufacturer->mf_name; ?>" href="<?php echo $manufacturerURL; ?>"><?php echo $manufacturerImage; ?></a>
</div>
</div>
<div class="clear"></div>
<div class="spacer-buy-area">
<?php
if (is_array($this->productDisplayShipments)) {
foreach ($this->productDisplayShipments as $productDisplayShipment) {
echo $productDisplayShipment . '<br />';
}
}
if (is_array($this->productDisplayPayments)) {
foreach ($this->productDisplayPayments as $productDisplayPayment) {
echo $productDisplayPayment . '<br />';
}
}
// Product Price
if ($this->show_prices) { ?>
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
<?php
if (!empty($this->product->prices['salesPrice'])) {
}
echo $this->currency->createPriceDiv ( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices );
//vmdebug('view productdetails layout default show prices, prices',$this->product);
if ($this->product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) { ?>
<a class="ask-a-question bold" href="<?php echo $this->askquestion_url ?>"><?php echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
<?php
} else {
if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices);
if (round($this->product->prices['basePrice'],$this->currency->_priceConfig['basePriceVariant'][1]) != $this->product->prices['basePriceVariant']) {
echo $this->currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices);
}
}
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);
}
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 ('unitPrice', $unitPriceDescription, $this->product->prices);
if (!empty($this->product->customfieldsSorted['ontop'])) {
$this->position='ontop';
echo $this->loadTemplate('customfields');
} // Product Custom ontop end
}
?>
</div>
Please let me know if you can fix the layout to display them.
Kind Regards,