Looking for documentation? Take a look on our wiki

Main Menu

Problems with images and SKU

Started by micropalla, September 29, 2016, 10:24:27 AM

Previous topic - Next topic


Hi guys. I have searched for two days in this forum but I can't find anything to solve my problems. I know that maybe they have been probably already posted but don't know where so be patient :)

1) How to add product SKU in category? I have add it only in product detail adding a php string.

2) Why the image in the popup is smaller than the one I have uploaded?

VM 3.01.16 on J 3.6.2


Product SKU to be added here:

Small image on popup for example here:

Thank you so much and have a nice day

GJC Web Design

SKU: <?php echo $product->product_sku; ?>

in the over ride templates\xxxxx\html\com_virtuemart\sublayouts\products.php

you have fixed sizes for the popup in your css

#facebox .content {
  background: #fff none repeat scroll 0 0;
  border-radius: 4px;
  display: table;
  padding: 10px;
  width: 370px;

change width:auto;
GJC Web Design
VirtueMart and Joomla Developers - php developers
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
Contact for any VirtueMart or Joomla development & customisation


Thank you for the quick reply!

1) Where?
 * sublayout products
 * @package VirtueMart
 * @author Max Milbers
 * @link
 * @copyright Copyright (c) 2014 VirtueMart Team. All rights reserved.
 * @license GNU/GPL2, see LICENSE.php
 * @version $Id: cart.php 7682 2014-02-26 17:07:20Z Milbo $

defined('_JEXEC') or die('Restricted access');
$products_per_row $viewData['products_per_row'];
$currency $viewData['currency'];
$showRating $viewData['showRating'];
$verticalseparator " vertical-separator";

$ItemidStr '';
$Itemid shopFunctionsF::getLastVisitedItemId();
$ItemidStr '&Itemid='.$Itemid;

foreach (
$viewData['products'] as $type => $products ) {

$rowsHeight shopFunctionsF::calculateProductRowsHeights($products,$currency,$products_per_row);

if(!empty($type) and count($products)>0){
$productTitle vmText::_('COM_VIRTUEMART_'.strtoupper($type).'_PRODUCT'); ?>

<div class="<?php echo $type ?>-view">
  <h4><?php echo $productTitle ?></h4>
<?php // Start the Output

// Calculating Products Per Row
$cellwidth ' width'.floor 100 $products_per_row );

$BrowseTotalProducts count($products);

$col 1;
$nb 1;
$row 1;

foreach ( $products as $product ) {

// Show the horizontal seperator
if ($col == && $nb $products_per_row) { ?>

<div class="horizontal-separator"></div>
<?php }

// this is an indicator wether a row needs to be opened or not
if ($col == 1) { ?>

<div class="row">
<?php }

// Show the vertical seperator
if ($nb == $products_per_row or $nb $products_per_row == 0) {
$show_vertical_separator ' ';
} else {
$show_vertical_separator $verticalseparator;

// Show Products ?>

<div class="product vm-col<?php echo ' vm-col-' $products_per_row $show_vertical_separator ?>">
<div class="spacer">
<div class="vm-product-media-container">

<a title="<?php echo $product->product_name ?>" href="<?php echo $product->link.$ItemidStr?>">
echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false);



<div class="vm-product-rating-container">
<?php echo shopFunctionsF::renderVmSubLayout('rating',array('showRating'=>$showRating'product'=>$product));
if ( VmConfig::get ('display_stock'1)) { ?>

<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<?php }
echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$product));


<div class="vm-product-descr-container-<?php echo $rowsHeight[$row]['product_s_desc'?>">
<h2><?php echo JHtml::link ($product->link.$ItemidStr$product->product_name); ?></h2>
<?php if(!empty($rowsHeight[$row]['product_s_desc'])){

<p class="product_s_desc">
<?php // Product Short Description
if (!empty($product->product_s_desc)) {
echo shopFunctionsF::limitStringByWord ($product->product_s_desc60' ...'?>

<?php ?>
<?php  ?>

<?php //echo $rowsHeight[$row]['price'] ?>
<div class="vm3pr-<?php echo $rowsHeight[$row]['price'?>"> <?php
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$product,'currency'=>$currency)); ?>

<div class="clear"></div>
<?php //echo $rowsHeight[$row]['customs'] ?>
<div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'?>"> <?php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop''addtocart'))); ?>


<div class="vm-details-button">
<?php // Product Details Button
$link = empty($product->link)? $product->canonical:$product->link;
echo JHtml::link($link.$ItemidStr,vmText::'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name'class' => 'product-details' ) );
//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 , FALSE), vmText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name, 'class' => 'product-details' ) );




// Do we need to close the current row now?
if ($col == $products_per_row || $nb>$BrowseTotalProducts) { ?>

    <div class="clear"></div>
$col 1;
    } else {
$col ++;

$type)and count($products)>0){
// Do we need a final closing row tag?
        //if ($col != 1) {

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

2) GREAT, It works! :)


Ok, line 90 becomes

<h2><?php echo JHtml::link ($product->link.$ItemidStr, $product->product_name); ?> - <?php echo $product->product_sku; ?></h2>

Thank you!!!



I just updated VM to last release and I have once again the problem with small images on popup.

In I have this:

#facebox .content {
  width: 370px;
  padding: 10px;
  background: #fff;

I changed 370px with auto as suggested above but this time nothing happens.

What's wrong?

Thank you!


It was just a stupid cache issue... :D