VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: PRO on April 03, 2012, 20:58:22 pm

Title: $this-> VS $product->
Post by: PRO on April 03, 2012, 20:58:22 pm
When templating product page and category page.


$this->    Refers to the CURRENT object

The current Object is not hard to figure out. It is a VmView and usually defined in the url for example as &view=productdetails.  =>VmViewProductdetails

SO, in the category template. $this-> is going to call variables created in view.html.php for the category view.

In the product details template. $this->   is going to call variables from THAT view.

Product variables are called on the category page with   $product->


For example
On the category page

You call the product name like this
Code: [Select]
<?php echo $product->product_name ?>
Because you have a foreach loop before 
Code: [Select]
foreach ( $this->products as $product ) {Therefore you have $product and not $this->product

BUT: On the product page, you call the product name like this
Code: [Select]
<?php echo $this->product->product_name ?>because there is only one product available.

Title: Re: $this-> VS $product->
Post by: Mandala on June 06, 2012, 20:37:52 pm
Hi,

Following your example I tried to put the category name in the browse page.



<p class="prodcat"><?php echo $product->category_name; ?></p>



But nothing appears.

I'm working with J1.5.26 + V1.1.19

Could you please help me ?
Regards

Mike
Title: Re: $this-> VS $product->
Post by: PRO on June 06, 2012, 22:03:11 pm
<?php echo $product->category_name ?>

^^ that just worked for me
Title: Re: $this-> VS $product->
Post by: huegel-huepfer on July 19, 2012, 16:07:32 pm
I'm trying to show child's stock level in parent product details.

I work with a "VM Custom, stockable variants" plugin. In the parent product you can choose different child products with a drop down menu.
First try was to insert following code in the stockable.php

Code: [Select]

// Availability Stock Level
?><p></p><?php
$stato = "";
$statotip = "";
if ($field->child[$child_id]['in_stock'] < 1) {
$stato = "nostock";
$statotip = "Hurry! Very low items stock!";
} else {
if ($field->child[$child_id]['in_stock'] < 2) {
$stato = "lowstock";
$statotip = "Low items in stock!";
} else {
$stato = "normalstock";
$statotip = "Items in stock available!";
}
} ?>

<span class="vmicon vm2-<?php echo $stato ?>" title="<?php echo $statotip ?>"></span>
        <?php

Now I receive correct stock level of child products above category and product view, but no single stock level of the current chosen child within the parent view.

I'd welcome any help to get the result I wanted.

Thanks a lot,
Volker
Title: Re: $this-> VS $product->
Post by: ivus on July 21, 2012, 09:29:31 am
Hi Everyone,

If you want to check what available fields you can use, put this before your loop

Code: [Select]

    echo "<pre>"; print_r( $products ); echo "</pre>"; // CATEGORY PAGE

    echo "<pre>"; print_r( $this->products ); echo "</pre>"; // PRODUCTS PAGE


You can use this to see the contents of any array/variable/object, just put the name inside the "print_r( $HERE );" tags ...

 ;D
Title: Re: $this-> VS $product->
Post by: zavier56 on July 23, 2012, 12:18:27 pm
Hi everyone,
I'm very interested by this thread because I've a problem to display custom fields in the category page ... reccurent question ...

With the command print_r($products) I can see the differents properties I can use ... but there are the properties.
What happends with the methods ?
I want to use the command $product->customfieldsSorted['normal']. This command runs perfectly in the product page (with $this-> ) but not in the category page ...

A (good) idea to progress to find a solution ?
Thank's
Xavier
Title: Re: $this-> VS $product->
Post by: ivus on August 03, 2012, 18:43:29 pm
hi zavier56,

read the code in my previous post CAREFULLY.

Pay particular attention to the comments. It's not hard to figure out when the answer is given.
Title: Re: $this-> VS $product->
Post by: Karudi on September 04, 2012, 14:59:27 pm
Hello , i would like to display additionall product images , on my category page , here is the code i use for this :

Code: [Select]
<?php



 
if (!empty($product->images) and count ($product->images)>0) {
   

// List all Images

if (count($product->images) > 0) {

    foreach ($product->images as $image)
 {

echo '<div class="floatleft">' $image->displayMediaThumb('class="product-image"'true'class="modal"'truetrue) . '</div>'//'class="modal"'
 
    }

}


}

?>



My problem is it displays only the first image i added , ignoring all the other ones .
P.S.I make changes in ../category/default.php
Title: Re: $this-> VS $product->
Post by: ivus on September 04, 2012, 15:26:21 pm
Hi Karudi,

Firstly your code has some redundant checks...

<?php

   if (!empty($product->images) and count ($product->images)>0) { <-- CHECKS TO MAKE SURE THE ARRAY IS SET AND COUNT IS GREATER THAN 1... NOT REQUIRED AS THE ARRAY WILL ALWAYS BE SET AND CONTAIN AN IMAGE... YES EVEN THE "NO IMAGE" PLACEHOLDER IMAGE IF NONE IS DEFINED
      // List all Images
      if (count($product->images) > 0) { <-- RECHECKS THAT THE ARRAY COUNT IS GREATER THAN 1... AGAIN! ???
         foreach ($product->images as $image)
         {
            echo '<div class="floatleft">' . $image->displayMediaThumb('class="product-image"', true, 'class="modal"', true, true) . '</div>'; //'class="modal"' <-- USELESS COMMENT
         }
      }
   }
   
?>


Code: [Select]

// List all Images
foreach ($product->images as $image)
{
    echo '<div class="floatleft">' . $image->displayMediaThumb('class="product-image"', true, 'class="modal"', true, true) . '</div>';
}


The above code should now work... if the array returned MORE THAN 1 IMAGE...

Change "/components/com_virtuemart/views/category/view.html.php" @ line 171.

Code: [Select]

    // Load the products in the given category
    $products = $productModel->getProductsInCategory($categoryId);
    $productModel->addImages($products,1);
    $this->assignRef('products', $products);


change this line:

$productModel->addImages($products,1);

to

$productModel->addImages($products);

to output all images for each product to the product array.

SAVE. REFRESH. YAY!!!
Title: Re: $this-> VS $product->
Post by: k0walsky on November 28, 2012, 12:31:48 pm
hello if you want to hide the first picture below on additional image

   foreach ($product->images as $image)
   {   
   if (($product->images[0]->file_url_thumb) == ($image->file_url_thumb))
      {} else {
       echo '<div class="floatleft">' . $image->displayMediaThumb('class="product-image-small"', true, 'class="modal"', true, true);
      echo '</div>';}
   }
Title: Re: $this-> VS $product->
Post by: PRO on November 28, 2012, 19:08:03 pm
hello if you want to hide the first picture below on additional image

   foreach ($product->images as $image)
   {   
   if (($product->images[0]->file_url_thumb) == ($image->file_url_thumb))
      {} else {
       echo '<div class="floatleft">' . $image->displayMediaThumb('class="product-image-small"', true, 'class="modal"', true, true);
      echo '</div>';}
   }


if (($product->images[0]->file_url_thumb) == ($image->file_url_thumb))
      {continue;}
Title: Re: $this-> VS $product->
Post by: Th.Pilegaard on December 15, 2012, 18:34:26 pm
I want to create a list of child's and their names, availability and price

By adding some code to customfields.php I can read out the names, product_id and availability by reading the $child array. But I can't find an easy way to get the child's salesprice.

Of cause I can get this by an SQL-call, but it can't be true that this i necessary

isn't there an easier method
Title: Re: $this-> VS $product->
Post by: ThomasR on January 14, 2013, 12:18:21 pm
Great topic,

I am trying to get the parent category name into the category template
(public_html/templates/template/html/com_virtuemart/category/default.php)


Code: [Select]
<!-- Category title -->
<?php if( !empty($this->category->category_name) ) : ?>
<h1 class="vm-category-title"><?php echo $this->category->category_name?></h1>
<?php endif; ?>

The structure of the categories has got 3 levels.
It needs to be [LEVEL 2] [ $this->category->category_name (LEVEL 3)]| Website name... , so just one level up.
I've searched the forum but couldn't find any solution to get this one level up.

Is there something possible like $previous->category->category_name?

EDIT: Working with the latest version of Virtuemart (2.0.18a)
Title: Re: $this-> VS $product->
Post by: Rollin45 on April 22, 2013, 06:12:53 am
I was also little confuse about Custom field error in my site page, but now I found the way.. Thanks to being here with solution.  :)
Title: Re: $this-> VS $product->
Post by: tellur21 on April 28, 2013, 18:19:20 pm
Hi Ivus,
I read your answer to Karudi about additional images of product in category page. And I have exact problem. But I'm using Virtuemart 2.0.8c. I couldn't fine this lines

           
Code: [Select]
// Load the products in the given category
    $products = $productModel->getProductsInCategory($categoryId);
    $productModel->addImages($products,1);
    $this->assignRef('products', $products);

in this path /components/com_virtuemart/views/category/view.html.php
Could you please provide solution for VM 2.0.8c. Because they use a different model of viewing. Thank you at advance.
Title: Re: $this-> VS $product->
Post by: Stonedfury on May 13, 2013, 02:52:16 am
How can I load the current product into a module? I tried
Code: [Select]
<?php echo $this->product->product_name ?> I get no error but I get no module text either. The module shows the title shows but it just doesn't load a product name. :(
Title: Re: $this-> VS $product->
Post by: PRO on May 13, 2013, 11:03:23 am
How can I load the current product into a module? I tried
Code: [Select]
<?php echo $this->product->product_name ?> I get no error but I get no module text either. The module shows the title shows but it just doesn't load a product name. :(


yopu cant without custom coding


what exactly do you want to do?

Title: Re: $this-> VS $product->
Post by: Stonedfury on May 13, 2013, 17:50:25 pm
I purchased a very crappy module that loads recently purchased products. I have been trying to clean it up and make it load better. I could truly use some help. I don't want to commandeer this post though. I was just checking to make sure I wasn't totally stupid. lol Ill start a new topic.
Title: Re: $this-> VS $product->
Post by: antonino78 on June 29, 2013, 15:38:40 pm
Hello,
I would show you a picture in the category when a product is not available.
I would use something like this:
Code: [Select]
<div style="padding:5px;">
<a><?php if ($this->product->product_in_stock == 0) {echo "<img src='http://mysite/images/red2.png' non disponibile' onclick=\"javascript:window.open('/legenda.html','legenda',')\"";} 
                
?>
</a>
</div>
I used this product in detail and it worked out great in the category but I do not know how to do.
can anyone help me please?  :'(
Title: Re: $this-> VS $product->
Post by: PRO on June 29, 2013, 16:48:47 pm
Hello,
I would show you a picture in the category when a product is not available.
I would use something like this:
Code: [Select]
<div style="padding:5px;">
<a><?php if ($this->product->product_in_stock == 0) {echo "<img src='http://mysite/images/red2.png' non disponibile' onclick=\"javascript:window.open('/legenda.html','legenda',')\"";} 
                
?>
</a>
</div>
I used this product in detail and it worked out great in the category but I do not know how to do.
can anyone help me please?  :'(


did you NOT read the first POST in this thread?

$this->    or    $product->

There is a place foreach one
Title: Re: $this-> VS $product->
Post by: antonino78 on June 29, 2013, 17:26:01 pm
Hello,
thanks for your answers.
Since I'm no expert I would be grateful if you could post the solution without sending me to other posts.
The code that I posted it found around ilo web and it worked perfectly for product details.
I simply would like to know how should I modify it to make it work aqnche products in the category.
Can you help me please? :-[
Title: Re: $this-> VS $product->
Post by: PRO on June 29, 2013, 20:28:01 pm
Hello,
thanks for your answers.
Since I'm no expert I would be grateful if you could post the solution without sending me to other posts.
The code that I posted it found around ilo web and it worked perfectly for product details.
I simply would like to know how should I modify it to make it work aqnche products in the category.
Can you help me please? :-[




Product variables are called on the category page with   $product-> and NOT    $this->

SO, CHANGE
 $this->   to $product->

Title: Re: $this-> VS $product->
Post by: maxispin on September 24, 2013, 05:07:22 am
Awesome thread! People like me can actually understand a bit more about coding now. Thanks for Pro for starting this and Ivus about great hints too!
Title: Re: $this-> VS $product->
Post by: poisom on September 26, 2013, 13:41:41 pm
Hello,

i am trying to show the stock_level inside a productdetails page bu i cant.

i am using this code:

Code: [Select]
<span class="vmicon vm2-<?php echo $this->product->stock_level?>" title="<?php echo $this->product->stock_tip?>"></span>
i copied this code from a category page and changed the $this to work inside a product page...any help??
Title: Re: $this-> VS $product->
Post by: Maxim Pishnyak on September 26, 2013, 14:54:35 pm
i copied this code from a category page
Which code?
Title: Re: $this-> VS $product->
Post by: poisom on September 27, 2013, 09:42:53 am
i copied this code from a category page
Which code?

Code: [Select]
<span class="vmicon vm2-<?php echo $this->product->stock_level?>" title="<?php echo $this->product->stock_tip?>"></span>
you don;t see the code tags??
Title: Re: $this-> VS $product->
Post by: Maxim Pishnyak on September 30, 2013, 06:20:33 am
Nope. I don't see original code. BTW the first pages of each of those two sticked threads about Template Overrides in this forum section could give you a hint.
Title: Re: $this-> VS $product->
Post by: isuv on October 02, 2013, 09:59:45 am
Hello,

I have Joomla 2.5.14 and VM 2.0.18b. I used this solution http://forum.virtuemart.net/index.php?topic=106732.0 to display related products prices on a product details page. But after I began to use different prices for registered and not registered users the prices of related products disappeared. There were "0" instead of prices. So, as I understand, I need to correct this code somehow:
$product = $model->getProductSingle($field->custom_value,false);
$price = $calculator -> getProductPrices($product);
echo $currency->priceDisplay($price['salesPrice']);
Can you help me with this?
Title: Re: $this-> VS $product->
Post by: Maxim Pishnyak on October 03, 2013, 16:22:55 pm
Version is outdated.
Title: Re: $this-> VS $product->
Post by: Robert_ITMan on November 07, 2013, 19:48:49 pm
you don;t see the code tags??

poisom - did you figure this out yet? I posted a solution here:  http://forum.virtuemart.net/index.php?topic=92756.msg409006#msg409006
Title: Re: $this-> VS $product->
Post by: lamcpp on February 07, 2014, 15:42:46 pm
How can I get to "billTotal" field in order_done.php?
I wrote: print_r($this->cart). Result:
Code: [Select]

VirtueMartCart Object ( [products] => Array ( ) [_inCheckOut] => [_dataValidated] => [_blockConfirm] => [_confirmDone] => [_redirect] => 1 [_redirect_disabled] => [_lastError] => [vendorId] => 1 [lastVisitedCategoryId] => 0 [virtuemart_shipmentmethod_id] => 0 [virtuemart_paymentmethod_id] => 0 [automaticSelectedShipment] => 1 [automaticSelectedPayment] => [BT] => Array ( [email] => tiko35@o2.pl [company] => Test [first_name] => test [last_name] => test [address_1] => ivan [address_2] => test [zip] => 55-333 [city] => test [phone_1] => ) [ST] => 0 [tosAccepted] => [customer_comment] => [couponCode] => [order_language] => [cartData] => Array ( [VatTax] => Array ( ) [duty] => 1 [payment] => 0 [paymentName] => Przy odbiorze [totalProduct] => 1 [DBTaxRulesBill] => Array ( ) [taxRulesBill] => Array ( ) [DATaxRulesBill] => Array ( ) [shipmentName] => Przy odbiorze  [vmVat] => 1 ) [lists] => Array ( [shipTo] => - domyślny (taki sam jak na rachunku)
Shipment
[billTo] => 2 [current_id] => 0 ) [order_number] => [customer_number] => TOfcd7d475a [pricesUnformatted] => Array ( [basePrice] => 75.834 [basePriceWithTax] => 0 [discountedPriceWithoutTax] => 75.834 [salesPrice] => 75.834 [taxAmount] => 0 [salesPriceWithDiscount] => 0 [discountAmount] => 0 [priceWithoutTax] => 75.834 [subTotalProducts] => 0 [23] => Array ( [costPrice] => 75.83400 [basePrice] => 75.834 [basePriceVariant] => 75.834 [basePriceWithTax] => 0 [discountedPriceWithoutTax] => 75.834 [priceBeforeTax] => 75.834 [salesPrice] => 75.834 [taxAmount] => 0 [salesPriceWithDiscount] => 0 [salesPriceTemp] => 75.834 [unitPrice] => 0 [discountAmount] => -0 [priceWithoutTax] => 75.834 [variantModification] => 0 [DBTax] => Array ( ) [Tax] => Array ( ) [VatTax] => Array ( ) [DATax] => Array ( ) [subtotal_with_tax] => 75.834 [subtotal_tax_amount] => 0 [subtotal_discount] => 0 [subtotal] => 75.834 ) [salesPriceDBT] => Array ( ) [taxRulesBill] => Array ( ) [DATaxRulesBill] => Array ( ) [shipmentValue] => 20 [shipmentTax] => 0 [salesPriceShipment] => 20 [shipment_calc_id] => 0 [cost] => 0 [salesPriceCoupon] => 0 [withTax] => 75.834 [paymentValue] => 0 [paymentTax] => 0 [paymentTotal] => 0 [salesPricePayment] => 0 [payment_calc_id] => 0 [billSub] => 95.834 [billDiscountAmount] => 0 [billTaxAmount] => 0 [billTotal] => 95.834 ) [pricesCurrency] => 114 [paymentCurrency] => 114 [STsameAsBT] => 1 [productParentOrderable] => 1 [_triesValidateCoupon] => Array ( ) [useSSL] => 0 [useXHTML] => [virtuemart_order_id] => 74 )

I try showing value of "billTotal" field. I write: echo $this->cart->billTotal; but this doesn't work. Why?
Title: Re: $this-> VS $product->
Post by: mfarooqi on February 11, 2014, 17:28:11 pm
hello if you want to hide the first picture below on additional image

   foreach ($product->images as $image)
   {   
   if (($product->images[0]->file_url_thumb) == ($image->file_url_thumb))
      {} else {
       echo '<div class="floatleft">' . $image->displayMediaThumb('class="product-image-small"', true, 'class="modal"', true, true);
      echo '</div>';}
   }


if (($product->images[0]->file_url_thumb) == ($image->file_url_thumb))
      {continue;}



Thank you very much :)
Title: Re: $this-> VS $product->
Post by: AntonioS28 on December 18, 2015, 18:04:09 pm
Hi sorry if i use this old post but i'm making some modifies on padded.php file of virtuemart 3!
My code is this, and i NEED to add the image of the product i added in the cart
Code: [Select]
<?php
/**
*
* Layout for the add to cart popup
*
* @package VirtueMart
* @subpackage Cart
* @author Max Milbers
*
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2013 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: cart.php 2551 2010-09-30 18:52:40Z milbo $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

echo 
'<a class="continue_link" href="' $this->continue_link '" >' vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
echo 
'<a class="showcart floatright" href="' $this->cart_link '">' vmText::_('COM_VIRTUEMART_CART_SHOW') . '</a>';
if(
$this->products){
foreach($this->products as $product){
if($product->quantity>0){
echo '<h4>'.vmText::sprintf('COM_VIRTUEMART_CART_PRODUCT_ADDED',$product->product_name,$product->quantity).'</h4>'
[
size=24pt]-------> NEED TO ADD THE IMAGE OF THE PRODUCT HERE <--------------[/size]
} else {
if(!empty($product->errorMsg)){
echo '<div>'.$product->errorMsg.'</div>';
}
}

}
}


if(
VmConfig::get('popup_rel',1)){
//VmConfig::$echoDebug=true;
if ($this->products and is_array($this->products) and count($this->products)>) {

$product reset($this->products);

$customFieldsModel VmModel::getModel('customfields');
$product->customfields $customFieldsModel->getCustomEmbeddedProductCustomFields($product->allIds,'R');

$customFieldsModel->displayProductCustomfieldFE($product,$product->customfields);
if(!empty($product->customfields)){
?>

<div class="product-related-products">
<h4><?php echo vmText::_('COM_VIRTUEMART_RELATED_PRODUCTS'); ?></h4>
<?php
}
foreach($product->customfields as $rFields){

if(!empty($rFields->display)){
?>
<div class="product-field product-field-type-<?php echo $rFields->field_type ?>">
<div class="product-field-display"><?php echo $rFields->display ?></div>
</div>
<?php }
?>

</div>
<?php
}
}

?>

<br style="clear:both">
<p style="background: #9eb618; border-radius:9px; font-weight:600; padding:"> SPEDIZIONE GRATUITA PER ORDINI SUPERIORI A 70€ !</p>
Title: Re: $this-> VS $product->
Post by: GJC Web Design on December 18, 2015, 18:12:50 pm
$product->images[0]->file_url  (url)

or perhaps

echo $product->images[0]->displayMediaFull("id='main-image'",true,"rel='vm-additional-images'");

for the full html
Title: Re: $this-> VS $product->
Post by: PRO on December 18, 2015, 18:19:01 pm
echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
Title: Re: $this-> VS $product->
Post by: AntonioS28 on December 18, 2015, 20:20:34 pm
i tried the three proposal but no one works!
The popup does not appear with your codes!
Title: Re: $this-> VS $product->
Post by: GJC Web Design on December 18, 2015, 20:26:45 pm
wrong file?

echo out $product

print 'Debug Line '.__LINE__.' $product <pre>'; print_r ($product); print "</pre><br />\n";
Title: Re: $this-> VS $product->
Post by: AntonioS28 on December 18, 2015, 20:36:27 pm
no the file is correct,
now appear
Code: [Select]
[virtuemart_product_id] => 6
    [virtuemart_vendor_id] => 1
    [product_parent_id] => 0
    [product_sku] =>
    [product_gtin] =>
    [product_mpn] =>
    [product_name] => prova2
    [slug] => prova-2-4-5
    [product_s_desc] =>
    [product_desc] =>
    [product_weight] =>
    [product_weight_uom] => KG
    [product_length] =>
    [product_width] =>
    [product_height] =>
    [product_lwh_uom] => M
    [product_url] =>
    [product_in_stock] => 100
    [product_ordered] => 1
no one remind the product image!
Title: Re: $this-> VS $product->
Post by: GJC Web Design on December 18, 2015, 22:24:15 pm
Ah .. the image object isn't passed to this view

perhaps

$productModel = VmModel::getModel('product');
$productModel->addImages($this->products, 1);

before the if loop?
Title: Re: $this-> VS $product->
Post by: avisbag on January 21, 2016, 20:02:22 pm
Virtuemart 2.6.22

I'm trying to put a script into my product details template. The code was given except the variable I needed to replace with product id (whatever I am referring to the product by in ShopperApproved). I've tried the following and it doesn't seem to be working. Also not quite sure if I put it in the right spot, but I put it in the div that holds the short description and such.

Code: [Select]
<script type="text/javascript"> var sa_products_count = 3; var sa_date_format = 'F j, Y'; var sa_product = '<?php echo $this->product->product_sku?>'; function saLoadScript(src) { var js = window.document.createElement("script"); js.src = src; js.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(js); } saLoadScript('//www.shopperapproved.com/product/20541/'+sa_product+'.js'); </script><div id="review_header"></div><div id="product_page"></div><div id="review_image"><a href="www.shopperapproved.com/reviews/Avisbag.com/" target="_blank" rel="nofollow"></a></div>
Title: Re: $this-> VS $product->
Post by: GJC Web Design on January 21, 2016, 23:12:51 pm
is it referred by sku?

or id? id is $this->product->virtuemart_product_id

what doesn't work?
Title: Re: $this-> VS $product->
Post by: avisbag on January 21, 2016, 23:54:30 pm
Sku. Their placeholder was [Product ID], which I replaced.

Can I basically put this anywhere on the page? Inside of the php tags?
Title: Re: $this-> VS $product->
Post by: GJC Web Design on January 22, 2016, 00:13:28 am
yes.. the $this is available throughout the view
Title: Re: $this-> VS $product->
Post by: rebelhn on May 10, 2016, 07:44:32 am
How can i get products by category id in VM 3.0.14? I changed code from sublayout of categories to show all products
$products = $productModel->getProductsInCategory($category_id); but nothing happen