404 error in cart pop-up in some pages

  • Posts: 29
  • Thank you received: 2
11 years 9 months ago #89104

We currently have an issue with Hikashop 2.1.0 (but the same occured in 1.6 before we upgraded):

We have two main categories for products: Online Shop and Library. The Online shop is publicly accessible and the Library is accessible only to a registered users group called 'Members'.

We have the following settings configured in the Configuration -> Cart section:

  • After a product is added to the cart: stay and display a popup notice
  • Notice popup display time: 2000 ms

When a person adds something to their cart in the Online Shop area, the pop-up displays an error message:
"404 - Page not found : notice"

If we login and add a product to our cart in the Library section, the error does not appear.

So, we changed the Library menu item from 'Member' access to 'Public' access thinking that perhaps that would help - it didn't.
We also removed all customisations from the test site to ensure the code changes weren't causing an issue but that didn't help either.

Next we tried the SEO settings:

In backend -> global configuration -> site -> SEO settings and set

Search Engine Friendly URLs = No
Use URL rewriting = No

Now the cart pop-up works fine on all categories.

My developers investigated further and found that if we change the following code, it works OK with SEF settings on:

File Path : /administrator/components/com_hikashop/helpers/Cart.php

Original Code :
echo '<div style="display:none;">'.
 '<a rel="{handler: \'iframe\',size: {x: 480, y: 140}}" id="hikashop_notice_box_trigger_link" href="'.hikashop_completeLink('checkout&task=notice'.$url_itemid,true).'"></a>'.
	'<a rel="{handler: \'iframe\',size: {x: 480, y: 140}}" id="hikashop_notice_wishlist_box_trigger_link" href="'.hikashop_completeLink('checkout&task=notice&cart_type=wishlist'.$url_itemid,true).'"></a>'.
 '</div>';

Updated code :
echo '<div style="display:none;">'.
	'<a rel="{handler: \'iframe\',size: {x: 480, y: 140}}" id="hikashop_notice_box_trigger_link" href="/index.php?option=com_hikashop&ctrl=checkout&task=notice&tmpl=component"></a>'.
	'<a rel="{handler: \'iframe\',size: {x: 480, y: 140}}" id="hikashop_notice_wishlist_box_trigger_link" href="'.hikashop_completeLink('checkout&task=notice&cart_type=wishlist'.$url_itemid,true).'"></a>'.
'</div>';

Any thoughts on why this might be?

thanks,
B.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
11 years 9 months ago #89342

Hi,

That sounds like a SEF/menu issue.
The modification you made removes the Itemid from the popup page URL.
So the SEF system of Joomla will user the default menu as current menu to display the popup page while without the modification, it will display the popup with the current Itemid (menu).
If the current menu is not a HikaShop page based on your website/server SEF settings Joomla might not be able to know that it's a hikashop page and will display a 404 error.
So I suppose that you must be in that website/server SEF case and that the page from which you're adding the product is neither a product menu page, nor a products listing menu page nor a category listing menu page. So basically you're adding the product to the cart from a products listing module on a non Hikashop page or in a joomla article page or something like that.
Am I right ?

The solution in your case is easy, the problem is that it's quite complex to put in place by default as HikaShop cannot really guess which menu should be the one which should be used.

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

  • Posts: 29
  • Thank you received: 2
11 years 9 months ago #90527

Hi Nicolas,

No the page from which items are added to cart are normal Hikashop Product Listing pages i.e. we have published two menu items and both link to the 'Product Listing' menu type for the Hikashop component - the menu items just link to different categories.

Any further ideas?

thanks
Bianca

Last edit: 11 years 9 months ago by wirthconsulting. Reason: spelling error

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
11 years 9 months ago #90786

Hi,

Mmm, that sounded like a nice theory for your case.

What if you change :
"/index.php?option=com_hikashop&ctrl=checkout&task=notice&tmpl=component"

by:
"/index.php?option=com_hikashop&ctrl=checkout&task=notice&tmpl=component'.$url_itemid.'"

Does it work ?

Could you do a screenshot of the joomla options of your menu ?

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

Time to create page: 0.059 seconds
Powered by Kunena Forum