Jump to content

How to get attributes like ps_facetedsearch


Recommended Posts

6 minutes ago, ndiaga said:

Hi,

You  can  at  first  get  all  the  available  attributes  in  the  shop   and  then  filter  them by  comparing  ids  with the  ids  that  the products  in the  current category  have.

I thought of doing this, but since there are so many products, the queries I will write may be a bit cumbersome. ps_facetedsearch works very well in this regard.

I can use the structure found in the module (I've researched this but couldn't figure out exactly how it works) or I can try more simplified structures.

Link to comment
Share on other sites

19 hours ago, ndiaga said:

The  module  uses  the  default  search  class by  just  sending  and  getting data.

 

This query shows the features used in the specified category.

 

select pc.id_attribute,agl.id_attribute_group ,agl.name, al.name from ps_product_attribute as pa, 
ps_product as p, ps_product_attribute_combination as pc, 
ps_attribute_group as ag, ps_attribute_lang as al, 
ps_attribute as a, ps_attribute_group_lang as agl
WHERE 
pa.id_product = p.id_product AND 
pa.id_product_attribute = pc.id_product_attribute AND 
a.id_attribute = pc.id_attribute AND
a.id_attribute_group = ag.id_attribute_group AND 
a.id_attribute_group = agl.id_attribute_group AND
a.id_attribute = al.id_attribute AND 
al.id_lang = 1 AND 
p.id_category_default = 46 AND
a.id_attribute_group = 2
GROUP BY al.id_attribute ORDER BY agl.name ASC, al.name ASC

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...