404 error when on Category access is Customonised

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
2 years 11 months ago #331613

-- url of the page with the problem -- : staging.blazeyuniforms.co.nz/copthorne
-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.25
-- PHP version -- : 7.4.15
-- Browser(s) name and version -- : Firefox

Hello, for this page staging.blazeyuniforms.co.nz/copthorne when access is full, I can see the single product in this Brand (category?). However, when I chnage the Access from All to all but Public and Guest, the page comes up 404. I would have expected a 'you cannot access this page , please login message' and not a 404 error. If the front-end user is already logged in then the product is shown as you'd expect.

Is there a way to fix this?

Last edit: 2 years 11 months ago by triotech.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
2 years 11 months ago #331619

Hi,

No that's normal. If you don't have access to a product / category / brand, then you don't see it in the products / categories / brands listing, and thus you don't know the URL of the product / category / brand and if you try to access it directly you get a 404 error.

Now I suppose that you created the URL staging.blazeyuniforms.co.nz/copthorne with a menu item with the alias "copthorne" linked to this brand. What you actually want to do to redirect the users to the login form when they try to access that menu item is to set the "access" setting of the menu item.

Finally, if you really want to do it with the brand access level for some reason, it's not impossible, but it requires changing the line:
throw new Exception(JText::_('CATEGORY_NOT_FOUND'), 404);
in the files components/com_hikashop/views/product/view.html.php or components/com_hikashop/views/category/view.html.php (depending on the type of your menu item), with something like that:
JFactory::getApplication()->enqueueMessage('you cannot access this page , please login message');
JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_users&view=login'));

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

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
2 years 11 months ago #331682

thanks, my fall-back idea was using a menu access and not Brand access which does get me what I want. I just thought it was weird that it was a 404 page rather than a rendered theme page. Thanks

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

Time to create page: 0.059 seconds
Powered by Kunena Forum