Custom module: ' product listing layout' not display with perticular product ids

  • Posts: 1
  • Thank you received: 0
8 years 2 months ago #267405

Hi,

I have created a custom module for display product listing layout with selected product using following code:
<?php
$js = '';
$params = '';
$productId = array(8,11);
JRequest::setVar('cid', $productId);
echo hikashop_getLayout('product', 'listing', $js, $params);
?>
Output display blank.

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

  • Posts: 83989
  • Thank you received: 13604
  • MODERATOR
8 years 2 months ago #267425

Hi,

That's normal. In $params you're supposed to set all the parameters to configure how the listing of products should be displayed (number of rows, number of columns, etc, etc. Basically all the settings that you have under the "hikashop options" tab of a HikaShop content module). Also, the system can indeed base itself on the parameter cid, however, it expects you to give ids of categories in there, not ids of products. So what you want to do won't work.
The only way is to set the recently_viewed variable in the session with your array of product ids and force the recently viewed parameter to 1 in params.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum