SQL Error on price filter

  • Posts: 73
  • Thank you received: 3
10 years 1 month ago #174241

-- HikaShop version -- : 3.3.3
-- Joomla version -- : 3.3.4
-- Error-message(debug-mod must be tuned on) -- : 1054 - Unknown column 'b.product_id' in 'on clause' SQL=SELECT DISTINCT b.product_id,b.compatibility, pprice.price_value FROM xzs4r_hikashop_product_category AS a LEFT JOIN (SELECT * FROM xzs4r_hikashop_product AS product1 LEFT JOIN xzs4r_hikashop_price AS price1 ON product1.product_id=price1.price_product_id LEFT JOIN xzs4r_hikashop_price AS pprice ON b.product_id=pprice.price_product_id WHERE (price1.price_access = 'all' OR price1.price_access LIKE '%,8,%' OR ISNULL(price1.price_access)) AND product1.product_type='main' GROUP BY product1.product_id ORDER BY price1.price_min_quantity ASC) AS b ON a.product_id=b.product_id LEFT JOIN xzs4r_hikashop_price AS pprice ON b.product_id=pprice.price_product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2) AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,8,%') AND ( ( case when b.price_currency_id IS NULL then 0 when b.price_currency_id = '1' then b.price_value when b.price_currency_id IS NULL then 0 when b.price_currency_id = '2' then (b.price_value/1) end ) >= 1 ) AND ( case when b.price_currency_id IS NULL then 0 when b.price_currency_id = '1' then b.price_value when b.price_currency_id IS NULL then 0 when b.price_currency_id = '2' then (b.price_value/1) end ) BETWEEN 0 AND 0 ORDER BY b.product_created DESC

Hi again
I'm using the filters and I have set a filter for Price, type cursor, min - max: 0 - 100
As soon as I choose apply on "Price", it gives me an error

1054 - Unknown column 'b.product_id' in 'on clause' SQL=SELECT DISTINCT b.product_id,b.compatibility, pprice.price_value FROM xzs4r_hikashop_product_category AS a LEFT JOIN (SELECT * FROM xzs4r_hikashop_product AS product1 LEFT JOIN xzs4r_hikashop_price AS price1 ON product1.product_id=price1.price_product_id LEFT JOIN xzs4r_hikashop_price AS pprice ON b.product_id=pprice.price_product_id WHERE (price1.price_access = 'all' OR price1.price_access LIKE '%,8,%' OR ISNULL(price1.price_access)) AND product1.product_type='main' GROUP BY product1.product_id ORDER BY price1.price_min_quantity ASC) AS b ON a.product_id=b.product_id LEFT JOIN xzs4r_hikashop_price AS pprice ON b.product_id=pprice.price_product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2) AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,8,%') AND ( ( case when b.price_currency_id IS NULL then 0 when b.price_currency_id = '1' then b.price_value when b.price_currency_id IS NULL then 0 when b.price_currency_id = '2' then (b.price_value/1) end ) >= 1 ) AND ( case when b.price_currency_id IS NULL then 0 when b.price_currency_id = '1' then b.price_value when b.price_currency_id IS NULL then 0 when b.price_currency_id = '2' then (b.price_value/1) end ) BETWEEN 0 AND 0 ORDER BY b.product_created DESC


If I set apply on "Weight", I don't have any error
Let me know if you want me to test something to debug
Regards
CEd

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 1 month ago #174244

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 73
  • Thank you received: 3
10 years 1 month ago #174278

I have taken the new file , replaced and it works for me.
Now I see that when I search, for example with no filter filled, it returns nothing. Or it should return all ? as no filter is set
for example :
- dropdown (version) - no value set, I leave the default text which is the filter name
- text, idem dropdown
- price :I set from 0 to 0 to have all items from all versions that are free.

This does not work. Am I missing or misunderstanding someting ?
CEd

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
10 years 1 month ago #174395

Hi,

It's probably just a matter of setting up the filters/the filter module properly.
You need to have a products listing menu item which lists all your products. Then, you need to enter that id in the options of your hikashop filter module with the "force redirect" option turned on. That way, when you use the filters displayed by the filter module, the system will redirect you to that products listing menu and filter the products of that menu with your selected filter(s). If you provide a wrong id to the module (if it's not a products listing with all the products), the system won't have anything to filter and thus you won't get any result.

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

  • Posts: 73
  • Thank you received: 3
10 years 1 month ago #174474

I have checked and the module option is set to my menu item "105" with force redirect
My item 105 is the main link item to "products listing"
Then I have tried to filter from 0 to 0 euros, >> no result. Then I delete the price filter and click on filter again and there is no more items to show. :(

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
10 years 1 month ago #174573

Hi,

Can you provide a link to the page so that we can see the issue ?

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

  • Posts: 73
  • Thank you received: 3
10 years 1 month ago #174584

themes(point)joomlack.fr

let me know when you have checked so that I can delete this url as it is a temporary website :)

Test procedure :
1/ select compatibility joomla3
>> 2 results, 1 free+1 paid

2/ set the price to 0-0
>> no result (should have 1)

3/ reset the price an compatibility (in the dropdown click on the word "compatibility")
>> no result (should return all)

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
10 years 1 month ago #174695

Hi,

Ah ok. I thought that the problem was that the products were not displaying at all when using the filters but apparently it's just in some specific cases. So the problem doesn't come from the menu item id option. It's something about the filtering query which doesn't take into account the products without prices.
Could you turn on the "debug mode" option of the Joomla configuration and provide the MySQL on the hikashop_product table that appears at the bottom of the page in the debug area in the results page ?
That would help us understand why this is happening.

Regarding the 3rd test case, that's something which should be fixed in next version and here is the thread about it:
www.hikashop.com/support/forum/filters-s...iltering.html#174257

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

  • Posts: 73
  • Thank you received: 3
10 years 1 month ago #174769

I have enabled the debug mode so you can check and find what you need :)

Regarding the 3rd test case, that's something which should be fixed in next version and here is the thread about it:
www.hikashop.com/support/forum/filters-s...iltering.html#174257

This fixed the issue !

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

Time to create page: 0.074 seconds
Powered by Kunena Forum