bebeboutik/modules/exports/exports.php

71 lines
1.6 KiB
PHP
Raw Normal View History

2016-01-04 12:49:26 +01:00
<?php
class Exports extends Module {
public function __construct() {
$this->name = 'exports';
$this->displayName = $this->l('Exports');
$this->description = $this->l('Adds an automated export feature to Prestashop');
$this->tab = 'administration';
$this->version = '1.0';
$this->author = 'Antadis';
parent::__construct();
}
public function install() {
if (!parent::install() OR !$this->registerHook('privatesales_end')) {
return FALSE;
}
return TRUE;
}
public function hookPrivateSales_End($params) {
include_once(dirname(__FILE__).'/exports/privatesales.php');
$e = new CronExport('privatesales', array(
'headers' => array(
'id_sale',
'sale_title',
'id_order',
'id_customer',
'gender',
'email',
'firstname',
'lastname',
'shipping_firstname',
'shipping_lastname',
'shipping_street',
'shipping_street2',
'shipping_postcode',
'shipping_city',
'shipping_phone',
'shipping_phone_mobile',
'other_info',
'shipping_country',
'id_product',
'id_product_attribute',
'order_product_name',
'product_quantity',
'product_price_base_wo_taxes',
'tax_rate',
'product_name',
'product_combination',
'product_price_wo_taxes',
'product_price',
'wholesale_price',
'combination_wholesale_price',
'supplier_reference',
'quantity_refunded',
'quantity_returned',
'total_shipping',
'date',
'invoice_number',
'payment_type',
'order_state',
),
'postfix' => '_'.$params['sale']->id.'_end',
'dest_path' => '/../extracts/sales',
'params' => $params,
));
$e->run();
}
}