Product listing issue

  • Posts: 42
  • Thank you received: 3
1 year 9 months ago #343358

-- url of the page with the problem -- : eduquay.satumalaysiahosting.com/products

The products aren't appropriately displayed as I made some modifications as below.


$class[]= new stdClass();
$i=0;
foreach($this->rows as $row)
{
if(in_array((int)$row->product_vendor_id,$vendors))
{
$class[$i]=$row;
$i++;
}
}
$this->rows=$class;

The new rows are the filtered products from the original rows within the limit of 18. However, I would like to filter from all products rather than only 18 rows.

Is there any possible way to temporarily change the limit while selecting the rows?

Much appreciated for your help!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
1 year 8 months ago #343361

Hi,

Instead of that modification, you should develop a small plugin implementing the onBeforeProductListingLoad ( www.hikashop.com/support/documentation/6...reProductListingLoad ) event.
With it, you can add your condition on the product_vendor_id directly to the MySQL query loading the products on the listing.
You can see an example of this with this plugin which remove the products from the lisitngs when their sale end date is in the past or their sale start date is in the future:
www.hikashop.com/marketplace/product/222...-product-plugin.html

Please Log in or Create an account to join the conversation.

  • Posts: 42
  • Thank you received: 3
1 year 8 months ago #343372

Solved it based on your advice!:kiss:

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum