Page 1 of 1

[SOLVED]Error in product.tpl

Posted: Fri Feb 10, 2012 6:30 am
by jimaras
Hi,
In system->error logs i have this:

Code: Select all

PHP Notice:  Undefined variable: product in /usr/www/users/***/e-kreopoleio.com/vqmod/vqcache/vq2-catalog_view_theme_default_template_product_product.tpl on line 271
PHP Notice:  Undefined variable: product in /usr/www/users/***/e-kreopoleio.com/vqmod/vqcache/vq2-catalog_view_theme_default_template_product_product.tpl on line 272
Can someone tells me how to fix it?

In product.tpl 271,272:

Code: Select all

 </div>
  <div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>

Re: Error in product.tpl

Posted: Fri Feb 10, 2012 6:58 am
by victorj
install vqmod manager and deinstall the add on that creates the error.
When you post add the add on you installed so we know where to look

Re: Error in product.tpl

Posted: Fri Feb 10, 2012 7:19 am
by straightlight
The generated error does not come from product.tpl file but rather from vqcache/vq2-catalog_view_theme_default_template_product_product.tpl file. Would it be possible to post between line 265 and line 275 ? Looks like the associated product object is not validated momentarily.

Re: Error in product.tpl

Posted: Sat Feb 11, 2012 5:12 am
by jimaras
straightlight wrote:The generated error does not come from product.tpl file but rather from vqcache/vq2-catalog_view_theme_default_template_product_product.tpl file. Would it be possible to post between line 265 and line 275 ? Looks like the associated product object is not validated momentarily.
lines 254-285

Code: Select all

<!-- AddThis Button END -->
		   <div><!--code start-->
		  <?php if ($price) { ?>
		  <?php if (!$sold_out) { ?>	
		  <?php echo $text_qty; ?>
		 <?php echo $qtydescription; ?>
          <input type="text" name="quantity" size="4" value="<?php echo $minimum; ?>" />
          <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
          &nbsp;<a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a>
		  <?php } else { ?>
		  <a id="button-cart" class="button"><span><?php echo $button_soldout; ?></span></a>
		  <?php } ?>
		  <?php } else { ?>
		  <a id="button-cart" class="button"><span><?php echo $button_callforprice; ?></span></a>
		  <?php } ?>
		  <!--code end--></div>
        <div><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $text_or; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
      <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/wish_icon.png" title="<?php echo $button_wishlist; ?>" border="0" alt="" /></a></div> <div>&nbsp;&nbsp;&nbsp;</div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/compare_icon.png" title="<?php echo $button_compare; ?>" border="0" alt="" /></a></div>
        <?php if ($minimum > 1) { ?>
        <div class="minimum"><?php echo $text_minimum; ?></div>
        <?php } ?>
      </div>
      <?php if ($review_status) { ?>
      <div class="review">
        <div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>
        <div class="share">
        </div>
      </div>
      <?php } ?>
    </div>
  </div>
lines 271-272 are

Code: Select all

      <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/wish_icon.png" title="<?php echo $button_wishlist; ?>" border="0" alt="" /></a></div> <div>&nbsp;&nbsp;&nbsp;</div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/compare_icon.png" title="<?php echo $button_compare; ?>" border="0" alt="" /></a></div>

Re: Error in product.tpl

Posted: Sat Feb 11, 2012 5:23 am
by straightlight
Obviously, the position where the $product object is called in the template cannot be found since the $product_info array from the controller is what is rather used.

How about changing this part:

Code: Select all

<div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/wish_icon.png" title="<?php echo $button_wishlist; ?>" border="0" alt="" /></a></div> <div>&nbsp;&nbsp;&nbsp;</div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/compare_icon.png" title="<?php echo $button_compare; ?>" border="0" alt="" /></a></div>
into:

Code: Select all

<div class="wishlist"><a onclick="addToWishList('<?php echo $product_id; ?>');"><img src="catalog/view/theme/default/image/wish_icon.png" title="<?php echo $button_wishlist; ?>" border="0" alt="" /></a></div> <div>&nbsp;&nbsp;&nbsp;</div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product_id; ?>');"><img src="catalog/view/theme/default/image/compare_icon.png" title="<?php echo $button_compare; ?>" border="0" alt="" /></a></div>

Re: Error in product.tpl

Posted: Sat Feb 11, 2012 5:29 am
by jimaras
straightlight wrote:Obviously, the position where the $product object is called in the template cannot be found since the $product_info array from the controller is what is rather used.

How about changing this part:

Code: Select all

<div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/wish_icon.png" title="<?php echo $button_wishlist; ?>" border="0" alt="" /></a></div> <div>&nbsp;&nbsp;&nbsp;</div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><img src="catalog/view/theme/default/image/compare_icon.png" title="<?php echo $button_compare; ?>" border="0" alt="" /></a></div>
into:

Code: Select all

<div class="wishlist"><a onclick="addToWishList('<?php echo $product_id; ?>');"><img src="catalog/view/theme/default/image/wish_icon.png" title="<?php echo $button_wishlist; ?>" border="0" alt="" /></a></div> <div>&nbsp;&nbsp;&nbsp;</div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product_id; ?>');"><img src="catalog/view/theme/default/image/compare_icon.png" title="<?php echo $button_compare; ?>" border="0" alt="" /></a></div>

You are right!
Thank you very much!