Find Jobs
Hire Freelancers

edit prestashop hook

$10-30 CAD

Cancelled
Posted 6 months ago

$10-30 CAD

Paid on delivery
this prestashop hook give me only the first result even if the customer buy 2 items, public function hookDisplayAdminOrder($params) { $id_order = (int) Tools::getValue('id_order'); // Get all products associated with the order $sql = 'SELECT product_id FROM '._DB_PREFIX_.'order_detail WHERE id_order = '.(int) $id_order; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); $product_ids = array(); foreach ($result as $row) { $product_ids[] = $row['product_id']; } // Iterate over all products foreach ($product_ids as $product_id) { // Obter informações do produto $sql_product = 'SELECT url FROM '._DB_PREFIX_.'scrape_ali_info WHERE id_product='.(int) $product_id; $product_data = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql_product); // Do something with product information $this->context->smarty->assign(array( 'id_produto' => $product_id, 'ali_url' => $product_data['url'], 'id_order' => $id_order )); // Here you can make decisions about what to do with the data, or just display it echo $this->display(__FILE__, 'views/templates/admin/[login to view URL]'); } } when I try to do echo inside, its not working. someone can only edit this code to make it work.
Project ID: 37418774

About the project

Remote project
Active 6 mos ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of CANADA
Longueuil, Canada
4.0
16
Payment method verified
Member since Dec 22, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.