Jump to content

Problem with blocklayered and product sort


nahlin

Recommended Posts

Hi,

 

I have a problem with my product sort by since I installed blocklayered module. When you select an option to sort by it reloads the content like when you click on a filter of the layered navigation and sorts the product randomly. It works fine without blocklayered installed.

 

Anyone else notice this?

Link to comment
Share on other sites

  • 1 month later...

this is a bug in the blocklayered module...

 

i have it in PS 1.4.3 but have hardcoded it to always sort by cheapest price...

 

its actually just a "order by" in the sql query..

 

in blocklayered.php i have recoded it to this:

 

about startlineline: 387:

$sql = '
 SELECT p.id_product, p.out_of_stock, p.available_for_order, p.quantity, p.minimal_quantity, p.id_category_default, p.customizable, p.show_price, p.`weight`,
 p.ean13, pl.available_later, pl.description_short, pl.link_rewrite, pl.name, i.id_image, il.legend,  m.name manufacturer_name, p.condition, p.id_manufacturer,
 DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new
 FROM '._DB_PREFIX_.'product p
 LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product)
 LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)
 LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image AND il.id_lang = '.(int)($cookie->id_lang).')
 LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer)
 WHERE p.`active` = 1 AND pl.id_lang = '.(int)$cookie->id_lang.$queryFilters
 .' ORDER BY price LIMIT '.(((int)(Tools::getValue('p', 1)) - 1) * $n.','.$n);

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...