M
M
Maxim2019-09-18 16:21:09
CMS
Maxim, 2019-09-18 16:21:09

How to display viewed products in UMI?

How to display viewed products on umi.cms? There is no information anywhere

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2019-09-18
@atachrus

Look in the documentation for a special macro.
dev.docs.umi-cms.ru/spravochnik_makrosov_umicms/st...
If we are not talking about all pages, but with certain typePages, then there is a custom solution described here:
http://wiki.umisoft.ru/Viewed_products

L
lynnikvadim, 2019-09-18
@lynnikvadim

Maxim , on the product page you need to add the code

$this->macros('content', 'addRecentPage', array($variables['@pageId']));
, where $variables['@pageId'] is the id of the current page.
On the page where you need to display viewed products:
$productList = $this->macros('content', 'getRecentPages', array(null,null,null,null,'3')); // 3 - получить количество просмотренных товаров 
$hierarchy = umiHierarchy::getInstance();
$pageObject = $hierarchy->getElement($id);
 <? foreach($productListas['subnodes:items'] as $item): ?>
                    <?$pageObject = $hierarchy->getElement($item[@id]);?>
                    <?$pageObject->getValue('h1');?>
 <? endforeach; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question