error in Comparison page menu item

  • Posts: 133
  • Thank you received: 6
2 years 5 months ago #344561

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.1.5
-- PHP version -- : 7.4
-- Error-message(debug-mod must be tuned on) -- : Cannot access protected property Joomla\CMS\Menu\MenuItem::$params

Hi
What is the function of the comparison page menu?
The mentioned menu gives this error:
Cannot access protected property Joomla\CMS\Menu\MenuItem::$params
pleas see attached file.

Attachments:

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

  • Posts: 83338
  • Thank you received: 13476
  • MODERATOR
2 years 5 months ago #344569

Hi,

Thank you for the feedback.
Change the code:

jimport('joomla.html.parameter');
				$category_params = new HikaParameter( $menu->params );
				$cids = $category_params->get('product_id');
to:
if(method_exists($menu, 'getParams')) {
					$cids = $menu->getParams()->get('product_id');
				} else {
					jimport('joomla.html.parameter');
					$category_params = new HikaParameter( $menu->params );
					$cids = $category_params->get('product_id');
				}
in the file components/com_hikashop/views/product/view.html.php and it will fix the problem.
The compare view is mainly used with the compare setting of the HikaShop configuration. When activated, you'll be able to select products on frotend product listings to compare them on a comparison page using this view.
However, we also added the possibility to create a menu item for that page where you can directly select the products to compare in the settings of the menu item, in order to build a static compare page (for example, to do things like the comparison page of HikaShop editions). This is not used much though and no one found about the issue so far on Joomla 4.
We'll include the patch on our end.

The following user(s) said Thank You: levelup

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

  • Posts: 133
  • Thank you received: 6
2 years 5 months ago #344574

Hi
Thank you, I made the changes and the problem was solved. But when I compare the products, the results were not opened in the compare menu item.

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

  • Posts: 83338
  • Thank you received: 13476
  • MODERATOR
2 years 5 months ago #344576

Hi,

If you compare products from a listing, you'll stay on the same listing.
The menu item is there for you to force a comparison between products you pre selected in the settings of the menu item.

The following user(s) said Thank You: levelup

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

Time to create page: 0.057 seconds
Powered by Kunena Forum