Jump to content

[SOLVED] PHP Import Customers and Orders


Luigi Donato

Recommended Posts

To mention your prestashop version could be helpful. However, assuming classes do not change that much, the names are quite self-explanatory.

Order.php and Customer.php are the classes - valid for PS 1.6.xx. Note that classes are controlled by the corresponding controllers.

Link to comment
Share on other sites

Version 1.6, I'm trying to create a module, I have find the hook hookActionValidateOrder and this work when the order has completed, but I can not access specific values.
I have tried this code:

   public function hookActionValidateOrder($params)
    {
        $value = $params['customer']['firstname'];
        $fp = fopen("log.txt", "a+");
        fwrite($fp, "$value\r");
        fclose($fp);
    }

And this:

public function hookActionValidateOrder($params)
    {
        $value = $params->customer;
        $value = $values['firstname'];
        $fp = fopen("log.txt", "a+");
        fwrite($fp, "$value\r");
        fclose($fp);
    }

An array's print_r example result:

Array
(
    [cart] => Cart Object
        (
            [id] => 22
        )
    [customer] => Customer Object
        (
            [firstname] => John
        )
)
Edited by LuigiD (see edit history)
Link to comment
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
×
×
  • Create New...