Jump to content

Why Db::getInstance()->executeS($sql) return empty array


IT City
 Share

Recommended Posts

I have a problems 
When I add a product to the order in the admin panel, I have to send it to the general warehouse, making a request to add a combination of goods to the order, getInstance()->executeS works for me every other time, I debug the request, I test it in phpmyadmin and it is completely correct , What can be wrong?



 

 

$sql = "select $return_products as quantity, o.product_reference, o.unit_price_tax_incl as price, pa.stock_article_id

from " . _DB_PREFIX_ . 'order_detail o

left join ' . _DB_PREFIX_ . 'product_attribute pa on pa.id_product_attribute = o.product_attribute_id

where o.product_attribute_id = ' . $product_attribute_id . ' and o.id_order = ' . $id_order;



$items = \Db::getInstance()->executeS($sql);

$this->shipment($items, 0, $order->total_discounts);

PrestaShopLogger::addLog(

'hookActionAdminOrdersControllerBefore->shipment->SQL2: ' . $sql . ' hookActionAdminOrdersControllerBefore->shipment->Items: ' . json_encode($items) . ' return_products ' . $return_products, 1

);

image.thumb.png.9a5c30e335024306a75bb26117321cd4.png

image.png

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More