URL's crashed after Business upgrade and Filter

  • Posts: 90
  • Thank you received: 2
11 years 8 months ago #98082

Hello,

After upgrade to business edition, I enabled the Filter Module.

My sidebar menu links all point to subcategories inside the main category Product Category.
I had no link to all the products.

But the filter module required one, so i created another menu that points to Product Category and entered it's ID inside the Filter Module.

Everything looks ok when you search, but now you cannot go to the page of any product. When you click on product, the URL it tries to open is:
tablouri-postere-oneart/1200155-tablou-canvas-poster-flori-flo00155

But the actual URL of the product is: 1200155-tablou-canvas-poster-flori-flo00155

The first part "tablouri-postere-oneart" is the alias of the meniu ID i entered in the filter module.

Also, if I don't use the Search Filter if I just go to a category and click on a product it gives an error:
Error: 1054 - Unknown column 'a.category_id' in 'field list' SQL=SELECT DISTINCT b.product_id,a.category_id FROM j8m5d_hikashop_product_related AS a LEFT JOIN j8m5d_hikashop_product AS b ON a.product_related_id=b.product_id WHERE b.product_published=1 AND a.product_related_type='related' AND a.product_id=100001 AND b.product_type = 'main' AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,1,%') ORDER BY a.product_related_ordering ASC

So now I can't access any page of any product.

Problem 2:
I've got two filters, one is the category and one is a keyword search text.
If i'm on the homepage and search for something it show me results from all categories.
If i'm inside a category and search for something it will only show the results from that current category , even if the category filter says "all".

Problem 3:
I can't see any type of search options. I've checked and saw that it searches keywords using "any word" and not "all words". I need "all words" - where and how do I change this?

Please help soon!

I'm sending by private message to Nicolas all the login details.

Thank you in advance.

p.s. i'll mention the title of this topic in the private message

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

  • Posts: 90
  • Thank you received: 2
11 years 8 months ago #98177

Guys, I need your help!!!! Please assist me in solving these issues.
I just upgraded to the business edition and my site is broken - please help!

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

  • Posts: 83025
  • Thank you received: 13404
  • MODERATOR
11 years 8 months ago #98185

Hi,

1. That comes from a mix between the related products module and the filters.
Change the line:
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0)){

to:
if(hikashop_level(2) && JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task','listing')!='show'){

in the file components/com_hikashop/views/product/view.html.php and that should avoid the problem.

2. In the options of your filter module, you need to force the redirect.

3. There is no option to change that.

You will have to change the code:

foreach($terms as $term){
					foreach($searchField as $column){
						$list[]=' b.'.$column.' LIKE \'%'.hikashop_getEscaped($term, true).'%\' ';
					}
				}
				$filters[]='('.implode(' OR ', $list).')';
to:
foreach($terms as $term){
					$array =array();
					foreach($searchField as $column){
						$array[]=' b.'.$column.' LIKE \'%'.hikashop_getEscaped($term, true).'%\' ';
					}
					$list[]='('.implode(' OR ', $array).')';
				}
				$filters[]='('.implode(' AND ', $list).')';
in the file administrator/components/com_hikashop/classes/filter.php

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

  • Posts: 90
  • Thank you received: 2
11 years 8 months ago #98188

I made all the changes you specified.

The errors are still there.

Of all the things you said only the change for the search type worked (instead of OR uses AND and it works).

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

  • Posts: 83025
  • Thank you received: 13404
  • MODERATOR
11 years 8 months ago #98343

Hi,

1. Ok, the error was on something else. I was able to debug it with the access your provided.

2. It's working fine as far as I can see.
For example, I'm on the "animale" category: www.nfx.ro/lumiere/animale
I enter "hatsune" in the filtering field and I see all the products with hatsune miku from the "anime" category.

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

  • Posts: 90
  • Thank you received: 2
11 years 8 months ago #98344

Thank you for the fix.

Please tell me, what can I do about the urls.

If you go directly to the category Anime and the first image the url will be:
www.nfx.ro/lumiere/anime/300001-tablou-c...oster-anime-ani00001

But if you search for "butterfly anime" (the same product will be the 1'st result) and click on the product the url will be:
www.nfx.ro/lumiere/tablouri-postere-onea...oster-anime-ani00001

It adds the alias of the Menu ID i entered in the Filter Module.

This is bad - I will have 2 different URLS for all my products - this is bad.

And the second problem, as you can see, in my side menu i have "Tablouri Postere OneArt" which is the menu i had to create for the Filter Module ID.

I don't want this menu.

I want to be able to filter, the URL's to reimain unchainged, the page layout to be the same as it is for each category and no extra menus that people shouldn't click (because it will load 150.000 products).

Please help!!

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

  • Posts: 83025
  • Thank you received: 13404
  • MODERATOR
11 years 8 months ago #98377

Why would it be bad to have another URL since that other URL will only be accessible via the search results and that the search engines won't be able to do any search and thus won't see it ? It won't impact page rank since the search engines won't know about the other URL.

If you really want to have the same URL, you would have to have the extra menu of the filter module as the parent menu of the other menus and the system will automatically use the URL of the sub menus based on the category of the product and the category of each menu so that you don't get doublons between the search results and the sub menus but again, I don't see the point in your case.

Regarding the extra menu that you created, you can simply edit it and set its parent to be the HikaShop hidden menu or any other main menu which isn't displayed on your frontend instead of your main menu.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum