New products not displaying under category

  • Posts: 250
  • Thank you received: 7
8 years 6 months ago #257542

-- url of the page with the problem -- : www.artistpapers.co.uk/shop/inkjet-and-l...athmore-inkjet-paper
-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 7.0.13

I am trying to add a new category of products to my site but whatever I do I can't get them to display on the front end in the same way as existing products The products appear correctly in the category on the back - end.

I am manually creating a menu structure on my main menu that reflects the shop category hierarchy, and have manually set canonical urls for categories and products.

I have used template over rides for the category and product listings.

The "new" products are inkjet papers
https://www.artistpapers.co.uk/shop/inkjet-and-laser-paper/strathmore-inkjet-paper

So far as I can tell I have set this up exactly the same as all the existing products eg
https://www.artistpapers.co.uk/shop/drawing-and-illustration-paper/newsprint-paper

But I'm not seeing the products listed in the category.

The only indication I get that anything is different is that if I go to enter the menu item for a category that works I get a warning that I have a template override



I can't delete the template over ride because it will break the layout of my site which is a custom design

For my new products I don't get this warning even though I have selected the same template over ride.

If I use the Hikashop content module the I can browse to the category and see the products but they are not on the canonical URL - I get the

The problem occurs whether I have SEF turned on or off.

Finally, I can see the products if I go to the URL
https://www.artistpapers.co.uk/shop/category/inkjet-paper
but this isn't the canonical URL I want to use ..
https://www.artistpapers.co.uk/shop/inkjet-and-laser-paper/inkjet-paper

I can't understand why this works for products I set up originally but doesn't work for new products.

Thank you for any help.

Ian

Attachments:

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257598

Hi,

With HikaShop 2.5.0, we introduced a new menus/modules system to HikaShop.
Before that, when you had a categories listing menu item, you had to have a products listing module attached to the menu item so that it would display the products of a category when clicking on a category.
After that, the products listing module settings were moved to the categories listing menu item and the module to display the products is now generated dynamically.
However, for menu items created before the update, still using the old way of doing things, we still use the old way of displaying the menu item so that it would still work for them.
The new system, dynamically generating the products listing module required a modification to the category/listing.php view file to work.
So when the system detects that you are editing a menu item which was made with the new system and that you have such override, it display that warning.
It doesn't mean that the override is the cause of your problem. It's just likely.

So the first thing to do is to check if that's the case. Rename that file in order to deactivate it and see if that works.
If it does, then it comes from that.
Then, check if your design is different without that view file override. If you don't see any change but it fixes the display for new menu items, then you can leave it renamed.
Otherwise, if it fixes the issue but it breaks the design, then you can add the code responsible for the dynamic module display in that view file:

$data = $this->params->get('data');
	if(isset($data->hk_product) && is_object($data->hk_product)){
		$js = '';
		$empty='';
		jimport('joomla.html.parameter');
		$params = new HikaParameter($empty);
		foreach($data->hk_product as $k => $v){
			$params->set($k,$v);
		}
		$main_div_name = 'hikashop_category_information_module_'.$params->get('id');
		$params->set('main_div_name',$main_div_name);
		echo '<div class="hikashop_submodules" style="clear:both">'.hikashop_getLayout('product', 'listing', $params, $js).'</div>';
	}
You can base yourself on the original view file to see how it is added there.

And if the category/listing.php view file being renamed doesn't fix the problem, then it comes from something else. It could be some of the settings of that menu item. We would need a screenshot of the categories options and the products options tabs to check on that.

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

  • Posts: 250
  • Thank you received: 7
8 years 6 months ago #257610

Hi Nicolas,

I have renamed the listing.php over ride and it all works fine now. I can't even remember why I made the over ride and the layout looks fine.

Thanks for your help,

Ian

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

Time to create page: 0.072 seconds
Powered by Kunena Forum