Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Auto (categories)
- Peugeot ===> 208 (sub categories)
- Color ===> black
- Material
- Plastic ===> Yes
- Cuir ===> Yes
- Auto
- Peugeot ===> 208
- Renault ===> 208 ==> no good value. it must not appear not included
- Color ===> black
- Color ===> black ==> no good value. it must not appear not included
- Materials
- Plastic ===> Yes
- Cuir ===> Yes
- $QSpecification = $this->db->prepare('select ag.specification_group_id,
- agd.name,
- pa.products_id
- from :table_products_specification pa,
- :table_specification a,
- :table_products_specification_group ag,
- :table_products_specification_group_description agd
- where pa.products_id = :products_id
- and agd.language_id = :language_id
- and pa.customers_group_id = :customers_group_id
- and pa.specification_group_id = a.specification_group_id
- and a.specification_group_id = ag.specification_group_id
- and ag.specification_group_id = agd.specification_group_id
- and pa.status = 1
- group by ag.specification_group_id
- order by ag.sort_order,
- agd.name
- ');
- $QSpecification->bindInt(':products_id', $products_id);
- $QSpecification->bindInt(':language_id', $this->lang->getId());
- $QSpecification->bindInt(':customers_group_id', $this->customer->getCustomersGroupID());
- $QSpecification->execute();
- $specification = $QSpecification->fetchAll();
- foreach ($specification as $product_specification_group) {
- $product_specification_data = [];
- $QproductsSpecification = $this->db->prepare('select pa.specification_group_id,
- a.specification_id,
- pa.id,
- ad.name,
- pad.text
- from :table_products_specification_description pad,
- :table_products_specification pa,
- :table_specification a,
- :table_specification_description ad
- where pa.products_id = :products_id
- and a.specification_group_id = :specification_group_id
- and a.specification_id = ad.specification_id
- and pa.specification_group_id = a.specification_group_id
- and ad.language_id = :language_id
- and pad.language_id = :language_id
- and pa.id = pad.id
- and (pa.customers_group_id = :customers_group_id or pa.customers_group_id = 99)
- and pa.status = 1
- order by pa.sort_order,
- ad.name
- ');
- $QproductsSpecification->bindInt(':specification_group_id', $product_specification_group['specification_group_id']);
- $QproductsSpecification->bindInt(':language_id', $this->lang->getId());
- $QproductsSpecification->bindInt(':products_id', $products_id);
- $QproductsSpecification->bindInt(':customers_group_id', $this->customer->getCustomersGroupID());
- $QproductsSpecification->execute();
- $product_specification_data[] = ['specification_id' => $QproductsSpecification->valueInt('specification_id'),
- 'name' => $QproductsSpecification->value('name'),
- 'text' => $QproductsSpecification->value('text')
- ];
- }
- }
- $product_specification_group_data[] = ['specification_group_id' => $product_specification_group['specification_group_id'],
- 'name' => $product_specification_group['name'],
- 'specification' => $product_specification_data
- ];
- }
- var_dump($product_specification_group_data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement