Create a filter for "Price with VAT"

  • Posts: 184
  • Thank you received: 4
12 years 3 months ago #58933

Finally I bought the Business Version of Hika!

I do not know if the behavior is intentional or a bug.

I created a radio button filter for the price.
I seems hika uses the price without VAT to filter the products. is it correct?

Is it possibile to use the price with VAT in the filter?
I sell almost completely in Italy and for the customers is normal to see the price with VAT included.

I have also another question.
I created 2 filters:
- one for the price
- the second one for the category
The filters select the right product if I use them separately, if I use them together there are no result. (see the attachment)

File Attachment:

File Name: Problemwithfilter.doc
File Size:320 KB



Thanks you!

Attachments:
Last edit: 12 years 3 months ago by Teto. Reason: add another question

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

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 3 months ago #58985

The filtering system bases itself on the price without vat. That is indeed correct.

Having it rely on the price with tax will require some modifications. I think that it's possible.
I've made some modifications to the filtering system so that it can handle prices with taxes. Can you try to replace the file administrator/components/com_hikashop/classes/filter.php with this one ?

Regarding the second issue, I wouldn't be able to tell. Could you give the query which is used for the listing of the products when both filters are set ? (you can get the queries on the page at the bottom of the page when the debug mode of the joomla configuration is turned on)

Attachments:

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

  • Posts: 184
  • Thank you received: 4
12 years 3 months ago #59021

Thank you nicolas

I enabled the debug mode.
When I select both the filters I receive an error:

500 - JDatabaseMySQL::query: 1054 - Unknown column 'p.product_id' in 'on clause' SQL=SELECT DISTINCT b.* FROM jos_hikashop_product_category AS a LEFT JOIN (SELECT * FROM jos_hikashop_product AS product1 LEFT JOIN jos_hikashop_price AS price1 ON product1.product_id=price1.price_product_id WHERE (price1.price_access = 'all' OR price1.price_access LIKE '%,2,%' OR price1.price_access LIKE '%,3,%' 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 INNER JOIN jos_hikashop_product_category AS caratteristiche1 ON caratteristiche1.product_id=p.product_id AND caratteristiche1.category_id IN (15) WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (14,15,12) AND (b.product_access = 'all' OR b.product_access LIKE '%,2,%' OR b.product_access LIKE '%,3,%') AND ( ( case when b.price_currency_id = '1' then b.price_value end ) BETWEEN 10 AND 20 ) ORDER BY b.product_sale_start ASC LIMIT 0, 20

** Update 12:30 CET *** in the meantime I added some other filters and modified the categories structure. Now I have no more problem. Honestly I don't know why but the problem is solved and the selection seems retrieve in the right way the products.

Then I copyed and tested the new filter file that you kindly sent me.
It seems to work perfectly, it selects in the right way the price with VAT included.

With the next release of Hika, will you insert this feature as standard?
If not, how can i mantain the customization?

If you need I can send you URL, username and passowrd to verify the filter error on the web site.

Last edit: 12 years 3 months ago by Teto.

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

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 3 months ago #59083

Thank you for the feedback.

We found that problem. It's actually not related to that modification but occurs because of the combination of filters that you were using. We'll add the modifications for next release as well as the fix for that error.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum