Searching for products causes an error.

  • Posts: 36
  • Thank you received: 0
14 years 3 weeks ago #972

Hi,

I'm building a website with Joomla and the HikaShop plugin. I've added a search function to the site and I've activated the HikaShop product searching plugin, so that now I can use my search function to search for my products. However, I've run into a problem: if I search for some products, the search function successfully lists products as results, but if I click on these results to look at the products, I get an error that says:

Fatal error: Call to a member function get() on a non-object in /usr/share/joomla15/components/com_hikashop/views/product/tmpl/show.php on line 193

I know some HTML and CSS but I am not familiar with PHP, so could someone tell me what's going on here?

Thanks,
-Redeemer

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
14 years 3 weeks ago #974

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

  • Posts: 36
  • Thank you received: 0
14 years 3 weeks ago #981

Hi,

Thank you Nicolas, that package solved the error. However, clicking on a product in the search results now gives me an empty page with a blue notification: "Product not found". Note that the template is still visible, but there is no content on the page besides the notification.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
14 years 3 weeks ago #983

What is the URL of the link to that page ? What is the ID of the product in the back end listing of products ?

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

  • Posts: 36
  • Thank you received: 0
14 years 3 weeks ago #985

Here is the URL to the product as listed in the search results:
http://0.0.0.0/component/hikashop/product/show/name-ballandchainammo12guage/cid-Array

The ID as listed in the back end is 2, although perhaps you mean the code:
Ball_and_Chain_Ammo__12_guage

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
14 years 3 weeks ago #988

The problem is that the cid parameter in the URL is not properly generated. We need to be able to reproduce to problem in order to correct it. Please bare with us while we try to reproduce the problem on a test server.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
14 years 3 weeks ago #1012

Hi,

Could you try to change the code

$rows[$k]->href = hikashop::completeLink('product&task=show&name='.strtolower(preg_replace('#[^a-z0-9_-]#i','',$row->title)).'&cid[]='.$row->id.$item_id);
to
$rows[$k]->href = hikashop::completeLink('product&task=show&name='.strtolower(preg_replace('#[^a-z0-9_-]#i','',$row->title)).'&cid='.$row->id.$item_id);
in the file plugins/search/hikashop_products.php near line 150 and try again ?

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

  • Posts: 36
  • Thank you received: 0
14 years 3 weeks ago #1025

That solved the problem perfectly! Thank you.

I have one more question now:

I have set up my product categories section to display a list of products when a category is selected. However, when I search for a product category and select one from my list of search results, it doesn't take me to that category specifically, it takes me to a list of categories. And when I select a category after this, I cannot see any of my products. What can I do to solve this issue?

Thanks for your time,
-Redeemer

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
14 years 3 weeks ago #1029

You need to create a menu of type product listing layout. You can put it under a menu which is on a main menu not displayed on the front end so that your users don't see it. Note the ID of the menu. Then, in the options of the categories search plugin, you have a field for the itemid where you can enter this ID. Then, when you click on the links of categories you will see the listing of products. Finally, you can go to the HikaShop options of the menu to personalize the display of the products listing.

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

  • Posts: 36
  • Thank you received: 0
14 years 3 weeks ago #1045

I was unaware of that field you mentioned. I attached it to my pre-existing "Products Catagories" menu and it worked perfectly.

Thank you once again. These solutions solved my problems.
-Redeemer

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

Time to create page: 0.069 seconds
Powered by Kunena Forum