Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Product Detail, Products Blocks Same Category Rate Topic   - - - - -

 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 641 posts

Posted 04 July 2019 - 11:47 AM #1

Hi anyone know how to list block products in product detail only same categories?

for eg: best seller block in product detail. show protuct from all categories ?



 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 641 posts

Posted 04 July 2019 - 12:16 PM #2

maybe this help to someone.

in get_products_before_select hook

    if (AREA == C) {
        if (isset($_REQUEST['product_id'])) {
            $detail = array('newest', 'most_popular');
            if (isset($params['block_data']['content']['items']['filling']) && in_array($params['block_data']['content']['items']['filling'], $detail)) {
                $cid = db_get_field('SELECT category_id FROM ?:products_categories WHERE product_id = ?i AND link_type = ?s', $_REQUEST['product_id'], 'M');
                $params['cid'] = $cid;
            }
        }
    }