News:

Support the VirtueMart project and become a member

Main Menu

Modify and add new fields in module mod_virtuemart_product

Started by kernel, August 01, 2012, 14:49:43 PM

Previous topic - Next topic

kernel

Hi all!!

Ask the following questions to see if anyone can help, ok?
- Question 1:
Is possible can add a "class label" (to give individual style) in the image, the text of the product and its price in this module?

I need go from this:


to get this:


- Question 2:
Thanks to the user ivus get added (in the category page and product details page) a field called "Reference".
The code for the category page is this:

<div class="ref">
Ref: <?php echo $product->product_sku ?>
</div>


The code for the product details page is this:
echo "<div class='ref'>Ref: ". $this->product->product_sku ."</div>";

What should be the code for this module?


- Question 3:
How I can add the words "price with tax" to the price (like previous picture) of this module?


I will appreciate any help for ever

Thanks
Best Regards

kernel

In case it helps, the code in default.php (mod_virtuemart_product folder):

<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$col;
$pwidth' width'.floor 100 $products_per_row );
if (
$products_per_row 1) { $float"floatleft";}
else {
$float="center";}
?>

<div class="vmgroup<?php echo $params->get'moduleclass_sfx' ?>">

<?php if ($headerText) { ?>
<div class="vmheader"><?php echo $headerText ?></div>
<?php }
if (
$display_style =="div") { ?>

<div class="vmproduct<?php echo $params->get('moduleclass_sfx'); ?>">
<?php foreach ($products as $product) { ?>
<div class="<?php echo $pwidth ?> <?php echo $float ?>"><div class="spacer">
<?php
 
if (!empty($product->images[0]) )
 
$image $product->images[0]->displayMediaThumb('class="featuredProductImage" border="0"',false) ;
 else 
$image '';
 echo 
JHTML::_('link'JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$image,array('title' => $product->product_name) );
 echo 
'<div class="clear"></div>';
 
$url JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.
$product->virtuemart_category_id); ?>
<a href="<?php echo $url ?>"><?php echo $product->product_name ?></a> <?php echo '<div class="clear">
</div>';
 if ($show_price) {
 //  echo $currency->priceDisplay($product->prices['salesPrice']);
 if (!empty($product->prices['salesPrice'] ) ) echo $currency->createPriceDiv('salesPrice','',$product->prices,true);
 //  if ($product->prices['salesPriceWithDiscount']>0) echo $currency->priceDisplay($product->prices['salesPriceWithDiscount']);
 if (!empty($product->prices['salesPriceWithDiscount']) ) echo $currency->createPriceDiv('salesPriceWithDiscount','',$product->prices,true);
 }
 if ($show_addtocart) echo mod_virtuemart_product::addtocart($product);
 ?>

</div> </div>
<?php
if ($col == $products_per_row && $products_per_row && $col $totalProd ) {
echo " </div><div style='clear:both;'>";
$col;
} else {
$col++;
}
?>

</div>
<br style='clear:both;' />

<?php
} else {
$last count($products)-1;
?>


<ul class="vmproduct<?php echo $params->get('moduleclass_sfx'); ?>">
<?php foreach ($products as $product) : ?>
<li class="<?php echo $pwidth ?> <?php echo $float ?>">
<?php
 
if (!empty($product->images[0]) )
$image $product->images[0]->displayMediaThumb('class="featuredProductImage" border="0"',false) ;
else $image '';
echo JHTML::_('link'JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$image,array('title' => $product->product_name) );
echo '<div class="clear"></div>';
$url JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.
$product->virtuemart_category_id); ?>
<a href="<?php echo $url ?>"><?php echo $product->product_name ?></a> <?php echo '<div class="clear"></div>';

if ($show_price) {
echo $currency->createPriceDiv('salesPrice','',$product->prices,true);
if ($product->prices['salesPriceWithDiscount']>0) echo $currency->createPriceDiv('salesPriceWithDiscount','',$product->prices,true);
}
if ($show_addtocart) echo mod_virtuemart_product::addtocart($product);
?>

</li>
<?php
if (
$col == $products_per_row && $products_per_row && $last ) {
echo '
</ul><div class="clear"></div>
<ul  class="vmproduct'
.$params->get('moduleclass_sfx')  .'">';
$col;
} else {
$col++;
}
$last--;
endforeach; ?>

</ul><div class="clear"></div>

<?php }
if ($footerText) : ?>

<div class="vmfooter<?php echo $params->get'moduleclass_sfx' ?>">
<?php echo $footerText ?>
</div>
<?php endif; ?>
</div>


Thanks!
Kernel