Compare commits

...

12 Commits

Author SHA1 Message Date
Michael RICOIS
4631bb5674 Merge branch 'fix/export' into develop 2018-01-08 11:17:05 +01:00
Michael RICOIS
d553fe9eb8 Change export 2018-01-08 11:15:51 +01:00
Michael RICOIS
0a7523f4e6 Merge remote-tracking branch 'origin/fix-price' 2017-11-29 09:53:14 +01:00
Michael RICOIS
5434e53cbb Merge branch 'fix-price' into develop 2017-11-28 16:58:44 +01:00
Michael RICOIS
5f902bd1a5 Options Price 2017-11-28 16:53:20 +01:00
Nolwenn J
3e27400e11 fix pb postcode 2017-11-28 16:37:05 +01:00
Michael RICOIS
7d07439047 Fix name howknowus 2017-11-14 10:56:01 +01:00
Michael RICOIS
caf254cc00 Merge remote-tracking branch 'origin/livre_dor' 2017-11-14 10:34:52 +01:00
Michael RICOIS
2dcfda48fb Fix date in future 2017-11-14 10:33:45 +01:00
Nolwenn J
058337cb57 log livre d or 2017-11-14 10:24:02 +01:00
Michael RICOIS
9334efa83e Fix base_dir_ssl 2017-11-13 09:55:49 +01:00
Michael RICOIS
a3e9682715 Fix https 2017-11-13 09:51:17 +01:00
11 changed files with 54 additions and 45 deletions

View File

@ -12,7 +12,7 @@ class AdvSiteReviewsDefaultModuleFrontController extends ModuleFrontController
public function __construct() public function __construct()
{ {
$this->auth = true; // $this->auth = true;
parent::__construct(); parent::__construct();
$this->context = Context::getContext(); $this->context = Context::getContext();
} }
@ -24,7 +24,6 @@ class AdvSiteReviewsDefaultModuleFrontController extends ModuleFrontController
{ {
parent::initContent(); parent::initContent();
$reviews = AdvSiteReview::getReviews(); $reviews = AdvSiteReview::getReviews();
if (!$reviews) { if (!$reviews) {

View File

@ -36,7 +36,7 @@ class AntadisConfiguratorUploadModuleFrontController extends ModuleFrontControll
if(!file_exists($path)) { if(!file_exists($path)) {
mkdir($path, 0755, true); mkdir($path, 0755, true);
} }
$url = _PS_BASE_URL_.'/upload/simu/'.$id_product.'/'.$reference; $url = Tools::getShopDomainSsl(true).'/upload/simu/'.$id_product.'/'.$reference;
$options = array( $options = array(
'upload_dir' => $path.'/', 'upload_dir' => $path.'/',

View File

@ -131,7 +131,7 @@
<div class="custom-file"> <div class="custom-file">
<input id="DOUBLECUBEIMAGE" class="configurator-opt-file-cube" name="files" data-field="optgroup-exclusif" <input id="DOUBLECUBEIMAGE" class="configurator-opt-file-cube" name="files" data-field="optgroup-exclusif"
data-url="/configurator/upload/{$id_product}/CUBE" data-url="/configurator/upload/{$id_product}/CUBE"
data-dl="{$base_dir}upload/simu/{$id_product}" type="file"> data-dl="{$base_dir_ssl}upload/simu/{$id_product}" type="file">
<span class="filename">{l s='Aucun fichier' mod='antadissimulator'}</span> <span class="filename">{l s='Aucun fichier' mod='antadissimulator'}</span>
<span class="action">{l s='Choisir un fichier' mod='antadissimulator'}</span></div> <span class="action">{l s='Choisir un fichier' mod='antadissimulator'}</span></div>
</div> </div>

View File

@ -141,7 +141,7 @@
<div class="custom-file"> <div class="custom-file">
<input id="DOUBLECUBEIMAGE" class="configurator-opt-file-pochette" name="files" data-field="optgroup-exclusif" <input id="DOUBLECUBEIMAGE" class="configurator-opt-file-pochette" name="files" data-field="optgroup-exclusif"
data-url="/configurator/upload/{$id_product}/POCHETTE" data-url="/configurator/upload/{$id_product}/POCHETTE"
data-dl="{$base_dir}upload/simu/{$id_product}" type="file"> data-dl="{$base_dir_ssl}upload/simu/{$id_product}" type="file">
<span class="filename">{l s='No file selected' mod='antadissimulator'}</span> <span class="filename">{l s='No file selected' mod='antadissimulator'}</span>
<span class="action">{l s='Choose File' mod='antadissimulator'}</span></div> <span class="action">{l s='Choose File' mod='antadissimulator'}</span></div>
</div> </div>

View File

@ -99,7 +99,7 @@
<div class="custom-file"> <div class="custom-file">
<input id="DOUBLECUBEIMAGE" class="configurator-opt-file-choco" name="files" data-field="optgroup-exclusif" <input id="DOUBLECUBEIMAGE" class="configurator-opt-file-choco" name="files" data-field="optgroup-exclusif"
data-url="/configurator/upload/{$id_product}" data-url="/configurator/upload/{$id_product}"
data-dl="{$base_dir}upload/simu/{$id_product}" type="file"> data-dl="{$base_dir_ssl}upload/simu/{$id_product}" type="file">
<span class="filename">{l s='No file selected' mod='antadissimulator'}</span> <span class="filename">{l s='No file selected' mod='antadissimulator'}</span>
<span class="action">{l s='Choose File' mod='antadissimulator'}</span></div></div> <span class="action">{l s='Choose File' mod='antadissimulator'}</span></div></div>
<span id="response-optgroup-exclusif"></span> <span id="response-optgroup-exclusif"></span>

View File

@ -98,7 +98,7 @@
<div class="custom-file"> <div class="custom-file">
<input id="DOUBLECUBEIMAGE" class="configurator-opt-file-choco" name="files" data-field="optgroup-exclusif" <input id="DOUBLECUBEIMAGE" class="configurator-opt-file-choco" name="files" data-field="optgroup-exclusif"
data-url="/configurator/upload/{$id_product}" data-url="/configurator/upload/{$id_product}"
data-dl="{$base_dir}upload/simu/{$id_product}" type="file"> data-dl="{$base_dir_ssl}upload/simu/{$id_product}" type="file">
<span class="filename">{l s='No file selected' mod='antadissimulator'}</span> <span class="filename">{l s='No file selected' mod='antadissimulator'}</span>
<span class="action">{l s='Choose File' mod='antadissimulator'}</span></div></div> <span class="action">{l s='Choose File' mod='antadissimulator'}</span></div></div>
<span id="response-optgroup-exclusif"></span> <span id="response-optgroup-exclusif"></span>

View File

@ -55,26 +55,8 @@ class Export
$result = Db::getInstance()->executeS($sql); $result = Db::getInstance()->executeS($sql);
if (count($result) > 0) { if (count($result) > 0) {
foreach($result as $k => $p) { foreach($result as $k => $p) {
$result[$k]['pelliculage'] = '';
$result[$k]['emballage'] = '';
$result[$k]['delivery_date'] = ''; $result[$k]['delivery_date'] = '';
if ($p['id_configurator'] != 0) {
$configList = ConfiguratorStorage::getOptProductFlatten($p['id_configurator']);
foreach ($configList as $config) {
if ($config['reference'] == 'PELLICULAGE') {
foreach($config['value'] as $v) {
$result[$k]['pelliculage']= $v;
}
}
if ($config['reference'] == 'EMBALLAGE') {
foreach($config['value'] as $v) {
$result[$k]['emballage']= $v;
}
}
}
}
// customer_thread (id_order), customer_message (id_customer_message) message // customer_thread (id_order), customer_message (id_customer_message) message
$sql = "SELECT message FROM ps_customer_message cm, ps_customer_thread ct $sql = "SELECT message FROM ps_customer_message cm, ps_customer_thread ct
WHERE ct.id_order=".$p['id_order']." AND ct.id_customer=".$p['id_customer']." AND cm.id_customer_thread=ct.id_customer_thread"; WHERE ct.id_order=".$p['id_order']." AND ct.id_customer=".$p['id_customer']." AND cm.id_customer_thread=ct.id_customer_thread";
@ -109,8 +91,6 @@ class Export
array('label' => 'code_pays_livr', 'col' => 'country',), array('label' => 'code_pays_livr', 'col' => 'country',),
array('label' => 'Date_livraison', 'col' => 'delivery_date'), // Message array('label' => 'Date_livraison', 'col' => 'delivery_date'), // Message
array('label' => 'Date_facturation', 'col' => 'invoice_date'), array('label' => 'Date_facturation', 'col' => 'invoice_date'),
array('label' => 'type papier', 'col' => 'emballage'),
array('label' => 'finition papier', 'col' => 'pelliculage'),
array('label' => 'Déduction_échantillon', 'col' => ''), array('label' => 'Déduction_échantillon', 'col' => ''),
array('label' => 'mode paiement', 'col' => 'payment'), array('label' => 'mode paiement', 'col' => 'payment'),
array('label' => 'Reference BC', 'col' => ''), array('label' => 'Reference BC', 'col' => ''),
@ -163,7 +143,7 @@ class Export
foreach ($configList as $config) { foreach ($configList as $config) {
if (substr($config['reference'],0,3) == 'NOM') { if (substr($config['reference'],0,3) == 'NOM') {
foreach($config['value'] as $v) { foreach($config['value'] as $v) {
if (empty( $result[$k]['prenoms'])) { if (empty($result[$k]['prenoms'])) {
$result[$k]['prenoms'] = $v; $result[$k]['prenoms'] = $v;
} else { } else {
$result[$k]['prenoms'].= ' '.$v; $result[$k]['prenoms'].= ' '.$v;
@ -248,10 +228,12 @@ class Export
$result[$k]['TXT'] = ''; $result[$k]['TXT'] = '';
$result[$k]['parfums1'] = ''; $result[$k]['parfums1'] = '';
$result[$k]['parfums2'] = ''; $result[$k]['parfums2'] = '';
$result[$k]['pelliculage'] = '';
$result[$k]['emballage'] = '';
if ($p['id_configurator'] != 0) { if ($p['id_configurator'] != 0) {
$configList = ConfiguratorStorage::getOptProductFlatten($p['id_configurator']); $configList = ConfiguratorStorage::getOptProductFlatten($p['id_configurator']);
foreach ($configList as $config) { foreach ($configList as $config) {
if (substr($config['reference'],0,7) == 'PARFUMS') { if (substr($config['reference'],0,7) == 'PARFUMS') {
$parfumCpt = 1; $parfumCpt = 1;
@ -260,7 +242,16 @@ class Export
$parfumCpt++; $parfumCpt++;
} }
} }
if ($config['reference'] == 'PELLICULAGE') {
foreach($config['value'] as $v) {
$result[$k]['pelliculage']= $v;
}
}
if ($config['reference'] == 'EMBALLAGE') {
foreach($config['value'] as $v) {
$result[$k]['emballage']= $v;
}
}
// Standard // Standard
if (!empty($result[$k]['TXT'])) { if (!empty($result[$k]['TXT'])) {
$result[$k]['TXT'].= "\n"; $result[$k]['TXT'].= "\n";
@ -276,13 +267,24 @@ class Export
} }
} }
} }
// Theme name
$result[$k]['theme']= '';
$themeName = Db::getInstance()->getValue("SELECT name FROM `"._DB_PREFIX_."simulator_theme` st
LEFT JOIN `"._DB_PREFIX_."product` p ON (p.`id_simulator_theme`=st.`id_simulator_theme`)
WHERE p.`id_product`=".$p['product_id']);
if (!empty($themeName)) {
$result[$k]['theme'] = $themeName;
}
} }
} }
$header = array( $header = array(
array('label' => 'ID_fact', 'col' => 'id_order'), array('label' => 'ID_fact', 'col' => 'id_order'),
array('label' => 'ref_article', 'col' => 'reference'), array('label' => 'ref_article', 'col' => 'reference'),
array('label' => 'Thème', 'col' => 'product_name'), array('label' => 'type papier', 'col' => 'emballage'),
array('label' => 'finition papier', 'col' => 'pelliculage'),
array('label' => 'Thème', 'col' => 'theme'),
array('label' => 'Qualité_1', 'col' => 'parfums1'), array('label' => 'Qualité_1', 'col' => 'parfums1'),
array('label' => 'Qualité_2', 'col' => 'parfums2'), array('label' => 'Qualité_2', 'col' => 'parfums2'),
array('label' => 'Quantité', 'col' => 'quantity'), array('label' => 'Quantité', 'col' => 'quantity'),

View File

@ -188,7 +188,7 @@ class AdminAntExportOrderController extends ModuleAdminController
$last = Db::getInstance()->getRow('SELECT DATE_FORMAT(`date_start`, "%Y-%m-%d") AS date_start, DATE_FORMAT(`date_end`, "%Y-%m-%d") AS date_end $last = Db::getInstance()->getRow('SELECT DATE_FORMAT(`date_start`, "%Y-%m-%d") AS date_start, DATE_FORMAT(`date_end`, "%Y-%m-%d") AS date_end
FROM `'._DB_PREFIX_.$this->table.'` ORDER BY `date_end` DESC'); FROM `'._DB_PREFIX_.$this->table.'` ORDER BY `date_end` DESC');
if ($last == null) { if ($last == null) {
$dateLast = new DateTime(); $dateLast = new DateTime();
$dateLast->sub(new DateInterval('P1D')); $dateLast->sub(new DateInterval('P1D'));
@ -196,10 +196,15 @@ class AdminAntExportOrderController extends ModuleAdminController
$dateLast = new DateTime($last['date_end']); $dateLast = new DateTime($last['date_end']);
$dateLast->add(new DateInterval('P1D')); $dateLast->add(new DateInterval('P1D'));
} }
$this->fields_value['date_start'] = $dateLast->format('Y-m-d');
$dateToday = new DateTime(); $dateToday = new DateTime();
$dateToday->setTime(0, 0);
if ($dateLast >= $dateToday) {
$this->errors[] = Tools::displayError('You can\'t generate export in the future');
return;
}
$this->fields_value['date_start'] = $dateLast->format('Y-m-d');
$this->fields_value['date_end'] = $dateToday->sub(new DateInterval('P1D'))->format('Y-m-d'); $this->fields_value['date_end'] = $dateToday->sub(new DateInterval('P1D'))->format('Y-m-d');
return parent::renderForm(); return parent::renderForm();

View File

@ -352,15 +352,8 @@ class Product extends ProductCore
// Prix de l'option // Prix de l'option
$flatrate = true; $flatrate = true;
$priceImpact = 0; $priceImpact = 0;
if ($id_configurator != null) { if ($id_configurator !== null) {
$sql = 'SELECT price FROM `'._DB_PREFIX_.'configurator_storage` WHERE id_configurator = '.(int)$id_configurator. $priceImpact = self::getConfiguratorSelectedPriceTotal($id_product, $id_configurator);
' AND id_product = '.(int)$id_product;
$priceResult = Db::getInstance()->executeS($sql);
if (count($priceResult) > 0) {
foreach($priceResult as $p) {
$priceImpact += $p['price'];
}
}
if ($flatrate === true) { if ($flatrate === true) {
$priceImpact = $priceImpact / $quantity; $priceImpact = $priceImpact / $quantity;
} }

View File

@ -163,7 +163,17 @@ $(document).ready(function() {
}); });
function owlCarousel(elem, nbElem0 = 2, nbElem480 = 3, nbElem767 = 4, nbElem990 = 4, nbElem1299 = 5, nbElem1499 = 6, stagePad = 30, navActivation = false, stagePadBig = 0){ function owlCarousel(elem, nbElem0, nbElem480, nbElem767, nbElem990, nbElem1299, nbElem1499, stagePad, navActivation, stagePadBig) {
nbElem0 = typeof nbElem0 !== 'undefined' ? nbElem0 : 2;
nbElem480 = typeof nbElem480 !== 'undefined' ? nbElem480 : 3;
nbElem767 = typeof nbElem767 !== 'undefined' ? nbElem767 : 4;
nbElem990 = typeof nbElem990 !== 'undefined' ? nbElem990 : 4;
nbElem1299 = typeof nbElem1299 !== 'undefined' ? nbElem1299 : 5;
nbElem1499 = typeof nbElem1499 !== 'undefined' ? nbElem1499 : 6;
stagePad = typeof stagePad !== 'undefined' ? stagePad : 30;
stagePadBig = typeof stagePad !== 'undefined' ? stagePad : 30;
navActivation = typeof navActivation !== 'undefined' ? navActivation : false;
/* copy col : owlCarousel(elem, 2, 3, 4, 4, 5, 6, 30, false, 30) */ /* copy col : owlCarousel(elem, 2, 3, 4, 4, 5, 6, 30, false, 30) */
$(elem).on('initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel', function (event) { $(elem).on('initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel', function (event) {
if (!event.namespace) return; if (!event.namespace) return;

View File

@ -103,7 +103,7 @@
<div class="box-content"> <div class="box-content">
<div class="row"> <div class="row">
<div class="sm6 form-group"> <div class="sm6 form-group">
<input type="text" class="form-control custom-input" value="" required> <input name="howknowus" type="text" class="form-control custom-input" value="" required>
</div> </div>
</div> </div>
</div> </div>