News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

PHP Parse error: syntax error, unexpected '}' in default_products.php

Started by kernel, October 28, 2012, 22:45:11 PM

Previous topic - Next topic

kernel

Hi all!

Let's see if anyone can help me  :)

I've seen the error_log file I get the following error:
PHP Parse error:  syntax error, unexpected '}' in /home/***/public_html/templates/***/html/com_virtuemart/virtuemart/default_products.php on line 111

In these lines is only the following code:
<?php }
I've never modified this file. I updated to 2.0.6 VM to VM and VM 2.0.8 2.0.12f.

Why is this happening?

Thanks a lot!!
Kernel.

kernel

For if it is useful, let the complete code:
<?php defined('_JEXEC') or die('Restricted access');


// Separator
$verticalseparator = " vertical-separator";

foreach (
$this->products as $type => $productList ) {
// Calculating Products Per Row
$products_per_row = VmConfig::get ( $type.'_products_per_row', 3 ) ;
$cellwidth = ' width'.floor ( 100 / $products_per_row );

// Category and Columns Counter
$col = 1;
$nb = 1;

$productTitle = JText::_('COM_VIRTUEMART_'.$type.'_PRODUCT')

?>


<div class="<?php echo $type ?>-view">

<h4><?php echo $productTitle ?></h4>

<?php // Start the Output
foreach ( $productList as $product ) {

// Show the horizontal seperator
if ($col == 1 && $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 floatleft<?php echo $cellwidth . $show_vertical_separator ?>">
<div class="spacer">


<h3>
<?php // Product Name
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 ), $product->product_name, array ('title' => $product->product_name ) ); ?>

</h3>

<div>
<?php // Product 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 ), $product->images[0]->displayMediaThumb( 'class="featuredProductImage" border="0"',false,'class="modal"' ) );
}
?>

</div>


<div class="product-price">
<?php
if (VmConfig::get ( 'show_prices' ) == '1') {
// if( $featProduct->product_unit && VmConfig::get('vm_price_show_packaging_pricelabel')) {
// echo "<strong>". JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT').' ('.$featProduct->product_unit."):</strong>";
// } else echo "<strong>". JText::_('COM_VIRTUEMART_CART_PRICE'). ": </strong>";

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 );
echo $this->currency->createPriceDiv( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices );
echo $this->currency->createPriceDiv( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $product->prices );
echo $this->currency->createPriceDiv( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices );
echo $this->currency->createPriceDiv( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices );
echo $this->currency->createPriceDiv( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices );
echo $this->currency->createPriceDiv( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices );
} ?>

</div>

<div>
<?php // Product Details Button
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 ), JText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name, 'class' => 'product-details' ) );
?>

</div>
</div>
</div>
<?php
$nb ++;

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

<div class="clear"></div>
</div>
<?php
$col = 1;
} else {
$col ++;
}
}
// Do we need a final closing row tag?
if ($col != 1) { ?>

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

</div>
<?php }