Ahmed Ibrahim Posted December 25, 2022 Share Posted December 25, 2022 ``` $sql = 'SELECT p.id_product, p.reference, pl.name, IFNULL(( SELECT AVG(product_attribute_shop.wholesale_price) FROM ' . _DB_PREFIX_ . 'product_attribute pa ' . Shop::addSqlAssociation('product_attribute', 'pa') . ' WHERE p.id_product = pa.id_product AND product_attribute_shop.wholesale_price != 0 '; if (version_compare(_PS_VERSION_, '1.7.0.0', '>=')) { $sql .= 'AND p.state = ' . Product::STATE_SAVED . ' '; } $sql .= '), product_shop.wholesale_price) as wholesale_price, IFNULL(stock.quantity, 0) as quantity FROM ' . _DB_PREFIX_ . 'product p ' . Shop::addSqlAssociation('product', 'p') . ' INNER JOIN ' . _DB_PREFIX_ . 'warehouse_product_location wpl ON( wpl.id_product = p.id_product ' . $wherew .') INNER JOIN ' . _DB_PREFIX_ . 'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = ' . (int)$this->context->language->id . Shop::addSqlRestrictionOnLang('pl') . ') ' . Product::sqlStock('p', 0); if (version_compare(_PS_VERSION_, '1.7.0.0', '>=')) { $sql .= ' WHERE p.state = ' . Product::STATE_SAVED . ' '; } ``` Link to comment Share on other sites More sharing options...
Ahmed Ibrahim Posted December 25, 2022 Author Share Posted December 25, 2022 filter not run and i cope the query that should i edit it but need some change .......help? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now