15 hours ago, knacky said:I'm not at the computer anymore.
You can call the function differently.$alert = new MailAlert();
$alert->sendCustomerAlert(......);
Hi,
I tried this way but obviously I have to find another location.
I have the impression that the instantiation of a class in another class does not work.
My file :
<?php require_once __DIR__ . "/../../includes/php/initialize.php"; include './../../config/config.inc.php'; include './../../init.php'; class Manage_stock_service extends Initialize { public $resultat; public function __construct() { parent::__construct(); $this->resultat= []; } public function __destruct() { parent::__destruct(); } public function manage_stock_supply_order_detail_update() { $spathSQL_update_stock= $this->GLOBALS_INI["PATH_HOME"] . "files/manage_stock/sql/supply_list/manage_stock_UPDATE_supply_order_update_stock.sql"; $this->oBdd->getSelectDatas($spathSQL_update_stock, array( 'id_product' => $old_received['id_product'], 'id_attribute' => $old_received['id_product_attribute'], 'quantity' => $diff_received )); include_once './../ps_emailalerts/MailAlert.php'; $customer_qty = (int) Configuration::get('MA_CUSTOMER_QTY'); $quantity = $diff_received; if ($customer_qty && $quantity > 0) { $alert = new MailAlert(); $alert->sendCustomerAlert((int) $old_received['id_product'], (int) $old_received['id_product_attribute']); } } }
In this case I get a javascript error 500, but if I write a simple "echo 'hello';", it will return a error 200.