Recently viewed items

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #292261

Hi,

Does hikashop has some easy code to get recently viewed items number? Or this would require some query? I am looking to add it to cart.php view.

If yes, could someone please give example?

Thank you

Last edit: 5 years 10 months ago by kyratn.

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

  • Posts: 81363
  • Thank you received: 13037
  • MODERATOR
5 years 10 months ago #292278

Hi,

If you want to display a listing of recently viewed products somewhere, HikaShop already has a "recently viewed products" module that you can enable via the Joomla modules manager (it's actually an instance of the HikaShop content module configured to display recently viewed products). And you can configure the module to display on the checkout.
Now if you want some code to get the product code of the recently viewed products, there is no easy to use function for that.

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #292291

Hi,

I do have such module and it works well but I also would like to show a number of how many recently viewed items. So that's why asking if is there a way to get that number?

Thank you

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

  • Posts: 81363
  • Thank you received: 13037
  • MODERATOR
5 years 10 months ago #292294

If it's just the display of the number of recently viewed products, it's quite easy.
You can use such code:

<?php echo @count($_SESSION['hikashop_viewed_products']); ?>

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

Time to create page: 0.061 seconds
Powered by Kunena Forum