Jump to content

[SOLVED] PHP Import Customers and Orders


Luigi Donato
 Share

Recommended Posts

Hi,
new question, new function .. I want to import orders and customer details at the time of creation.. 
Could you tell me the name of the class that adds the order and the name of the class that adds the customer details to the PS?
I want to export just when the order was paid
Edited by LuigiD (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


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

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