Jump to content

Edit History

vav_

vav_

1 hour ago, knacky said:

Ok, on the fly to enjoy the cannon 😄
So it will be better to use, respectively. copy the function from ps_emailalerts.php and modify it for your solution 😉

include_once('./modules/ps_emailerts/MailAlert.php');
include('./../../config/config.inc.php');
include('./../../init.php');

$customer_qty = (int) Configuration::get('MA_CUSTOMER_QTY');
$quantity = $diff_received;

...

if ($customer_qty && $quantity > 0) {
    MailAlert::sendCustomerAlert((int) $old_received['id_product'], (int) $old_received['id_product_attribute']);
}

 

It is really a great help that you offer me, I begin to understand more and more.

I will try to be even more explicit, to make sure that we have the same information to move things forward :

 

It is contained in a large PHP file that groups all the useful functions, like this one.

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));

...
}

But each of the functions has its own files: 

image.png.343eed25914fdcc7df09dc99f9826330.png

Do I make sense? 

There are paths, structures that block my progress.

 

<?php
    if((include_once './../ps_emailalerts/MailAlert.php') == TRUE){
        echo 'MailAlert is ok ! <br>';
    }
    if((include './../../config/config.inc.php') == TRUE){
        echo 'config is ok ! <br>';
    }
    if((include './../../init.php') == TRUE){
        echo 'init is ok ! <br>';
    }

    echo 'beginning<br>';

    $customer_qty = 1;
    $quantity = 1;

    $id = 495;
    $ida = 0;

    if ($customer_qty && $quantity > 0) {
        MailAlert::sendCustomerAlert((int) $id, (int) $ida);
    }
    
    echo 'end';
?>

I make a test, but MailAlert.php include return HTTP ERROR 500.

 

 

 

After correction, the email is sent :

<?php
    
    if((include './../../config/config.inc.php') == TRUE){
        echo 'config is ok ! <br>';
    }
    if((include './../../init.php') == TRUE){
        echo 'init is ok ! <br>';
    }
    if((include_once './../ps_emailalerts/MailAlert.php') == TRUE){
        echo 'MailAlert is ok ! <br>';
    }

    echo 'beginning<br>';

    $customer_qty = 1;
    $quantity = 1;

    $id = 495;
    $ida = 0;

    if ($customer_qty && $quantity > 0) {
        MailAlert::sendCustomerAlert((int) $id, (int) $ida);
    }
    
    echo 'end';

The orders of the calls

vav_

vav_

1 hour ago, knacky said:

Ok, on the fly to enjoy the cannon 😄
So it will be better to use, respectively. copy the function from ps_emailalerts.php and modify it for your solution 😉

include_once('./modules/ps_emailerts/MailAlert.php');
include('./../../config/config.inc.php');
include('./../../init.php');

$customer_qty = (int) Configuration::get('MA_CUSTOMER_QTY');
$quantity = $diff_received;

...

if ($customer_qty && $quantity > 0) {
    MailAlert::sendCustomerAlert((int) $old_received['id_product'], (int) $old_received['id_product_attribute']);
}

 

It is really a great help that you offer me, I begin to understand more and more.

I will try to be even more explicit, to make sure that we have the same information to move things forward :

 

It is contained in a large PHP file that groups all the useful functions, like this one.

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));

...
}

But each of the functions has its own files: 

image.png.343eed25914fdcc7df09dc99f9826330.png

Do I make sense? 

There are paths, structures that block my progress.

 

I make a test, but MailAlert.php include return HTTP ERROR 500 : 

<?php
    if((include_once './../ps_emailalerts/MailAlert.php') == TRUE){
        echo 'MailAlert is ok ! <br>';
    }
    if((include './../../config/config.inc.php') == TRUE){
        echo 'config is ok ! <br>';
    }
    if((include './../../init.php') == TRUE){
        echo 'init is ok ! <br>';
    }

    echo 'beginning<br>';

    $customer_qty = 1;
    $quantity = 1;

    $id = 495;
    $ida = 0;

    if ($customer_qty && $quantity > 0) {
        MailAlert::sendCustomerAlert((int) $id, (int) $ida);
    }
    
    echo 'end';
?>

 

vav_

vav_

30 minutes ago, knacky said:

Ok, on the fly to enjoy the cannon 😄
So it will be better to use, respectively. copy the function from ps_emailalerts.php and modify it for your solution 😉

include_once('./modules/ps_emailerts/MailAlert.php');
include('./../../config/config.inc.php');
include('./../../init.php');

$customer_qty = (int) Configuration::get('MA_CUSTOMER_QTY');
$quantity = $diff_received;

...

if ($customer_qty && $quantity > 0) {
    MailAlert::sendCustomerAlert((int) $old_received['id_product'], (int) $old_received['id_product_attribute']);
}

 

It is really a great help that you offer me, I begin to understand more and more.

I will try to be even more explicit, to make sure that we have the same information to move things forward :

 

It is contained in a large PHP file that groups all the useful functions, like this one.

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));

...
}

But each of the functions has its own files: 

image.png.343eed25914fdcc7df09dc99f9826330.png

Do I make sense? 

There are paths, structures that block my progress.

vav_

vav_

9 minutes ago, knacky said:

Ok, on the fly to enjoy the cannon 😄
So it will be better to use, respectively. copy the function from ps_emailalerts.php and modify it for your solution 😉

include_once('./modules/ps_emailerts/MailAlert.php');
include('./../../config/config.inc.php');
include('./../../init.php');

$customer_qty = (int) Configuration::get('MA_CUSTOMER_QTY');
$quantity = $diff_received;

...

if ($customer_qty && $quantity > 0) {
    MailAlert::sendCustomerAlert((int) $old_received['id_product'], (int) $old_received['id_product_attribute']);
}

 

It is really a great help that you offer me, I begin to understand more and more.

I will try to be even more explicit, to make sure that we have the same information to move things forward :

 

 

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));

...
}

It is contained in a large PHP file that groups all the useful functions, like this one.

 

image.png.343eed25914fdcc7df09dc99f9826330.png

 

×
×
  • Create New...