Merge branch 'ticket-eanUpgrade' into develop
This commit is contained in:
commit
443b054b7e
@ -517,33 +517,33 @@ class AdminOrders extends AdminTab
|
||||
} else {
|
||||
$partial = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$partial) {
|
||||
global $cookie;
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_history`
|
||||
VALUES (
|
||||
DEFAULT,
|
||||
'.(int) $cookie->id_employee.',
|
||||
'.(int) $order->id.',
|
||||
'.Configuration::get('PS_OS_SHIPPING').',
|
||||
NOW()
|
||||
)
|
||||
');
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_state_current`
|
||||
VALUES (
|
||||
'.(int) $order->id.',
|
||||
'.Configuration::get('PS_OS_SHIPPING').',
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`id_order_state` = '.Configuration::get('PS_OS_SHIPPING').',
|
||||
`date_upd` = NOW()
|
||||
');
|
||||
$newOS = new OrderState((int)(Configuration::get('PS_OS_SHIPPING')), $order->id_lang);
|
||||
Module::hookExec('updateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id)));
|
||||
if(!$partial) {
|
||||
global $cookie;
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_history`
|
||||
VALUES (
|
||||
DEFAULT,
|
||||
'.(int) $cookie->id_employee.',
|
||||
'.(int) $order->id.',
|
||||
'.Configuration::get('PS_OS_SHIPPING').',
|
||||
NOW()
|
||||
)
|
||||
');
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_state_current`
|
||||
VALUES (
|
||||
'.(int) $order->id.',
|
||||
'.Configuration::get('PS_OS_SHIPPING').',
|
||||
NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`id_order_state` = '.Configuration::get('PS_OS_SHIPPING').',
|
||||
`date_upd` = NOW()
|
||||
');
|
||||
$newOS = new OrderState((int)(Configuration::get('PS_OS_SHIPPING')), $order->id_lang);
|
||||
Module::hookExec('updateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
91
css/custom_admin.css
Normal file
91
css/custom_admin.css
Normal file
@ -0,0 +1,91 @@
|
||||
.path_bar {
|
||||
background-color: #F1F1F1;
|
||||
border: 1px solid #565485;
|
||||
}
|
||||
h2 {
|
||||
color: #565485;
|
||||
}
|
||||
fieldset {
|
||||
background: #F1F1F1;
|
||||
border: 1px solid #565485;
|
||||
}
|
||||
legend {
|
||||
background: #565485;
|
||||
background: rgba(86,84,133,0.9);
|
||||
border: 1px solid #565485;
|
||||
color: #fff;
|
||||
}
|
||||
hr {
|
||||
height: 1px;
|
||||
color: #565485;
|
||||
background: rgba(86,84,133,0.9);
|
||||
}
|
||||
.table {
|
||||
border: 1px solid #565485;
|
||||
}
|
||||
.table tr th {
|
||||
background: #565485;
|
||||
background: rgba(86,84,133,0.9);
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
.table tr{
|
||||
background:#fff;
|
||||
}
|
||||
.table tr:nth-child(even){
|
||||
background:#F1F1F1;
|
||||
}
|
||||
.table tr:nth-child(even) td {
|
||||
border-left:1px solid #FFF;
|
||||
border-right:1px solid #FFF;
|
||||
}
|
||||
.table tr td {
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
color: #000;
|
||||
}
|
||||
.table tr td[id*=ART] p,
|
||||
.table tr td[id*=CDC] p{
|
||||
font-size:11px;
|
||||
}
|
||||
.table tr td label {
|
||||
font-size:13px;
|
||||
}
|
||||
input[type="text"], input[type="password"],
|
||||
input[type="file"], textarea, select {
|
||||
border: 1px solid #565485;
|
||||
}
|
||||
.button {
|
||||
background-color: rgba(86,84,133,0.7);
|
||||
border: 1px solid #565485;
|
||||
border-left: 1px solid rgba(86,84,133,0.6);
|
||||
border-top: 1px solid rgba(86,84,133,0.6);
|
||||
color: rgba(255,255,255,0.9);
|
||||
padding: 3px;
|
||||
}
|
||||
.button:hover {
|
||||
background-color: #565485;
|
||||
border: 1px solid rgba(86,84,133,0.6);
|
||||
border-left: 1px solid #565485;
|
||||
border-top: 1px solid #565485;
|
||||
color: #fff;
|
||||
padding: 3px;
|
||||
}
|
||||
.button:focus{
|
||||
background-color: rgba(86,84,133,0.6);
|
||||
}
|
||||
|
||||
/*** Philea ***/
|
||||
.div_report {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
padding: 15px;
|
||||
padding-top: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid;
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
color:#000;
|
||||
}
|
||||
.div_report h3 {text-align:center;}
|
@ -3,28 +3,32 @@ if(!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class AdminBraderie extends AdminTab
|
||||
class AdminBraderie extends AdminTab
|
||||
{
|
||||
private $_html = '';
|
||||
private $error = '';
|
||||
|
||||
public function display()
|
||||
public function display()
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$this->_html .= '<style type="text/css">
|
||||
@import "'.__PS_BASE_URI__.'css/custom_admin.css";
|
||||
</style>';
|
||||
|
||||
$id_category = Tools::getValue('id_category', 1);
|
||||
$id_product = Tools::getValue('id_product', false);
|
||||
|
||||
$db = Db::getInstance();
|
||||
/*$sql_category = '
|
||||
SELECT * FROM `'._DB_PREFIX_.'privatesale` ps
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ps.`id_category` = cl.`id_category`
|
||||
WHERE ps.`braderie` = 1
|
||||
SELECT * FROM `'._DB_PREFIX_.'privatesale` ps
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ps.`id_category` = cl.`id_category`
|
||||
WHERE ps.`braderie` = 1
|
||||
AND cl.`id_lang` = '.(int) $cookie->id_lang;*/
|
||||
$sql_category = '
|
||||
SELECT c.`id_category`, cl.`name` FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`
|
||||
WHERE c.`id_parent` = 1
|
||||
SELECT c.`id_category`, cl.`name` FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`
|
||||
WHERE c.`id_parent` = 1
|
||||
AND cl.`id_lang` = '.(int) $cookie->id_lang.'
|
||||
ORDER BY c.`id_category` DESC';
|
||||
$categories = $db->ExecuteS($sql_category);
|
||||
@ -38,8 +42,8 @@ class AdminBraderie extends AdminTab
|
||||
foreach (Db::getInstance()->executeS('
|
||||
SELECT ex.`value`, ps.`id_category`
|
||||
FROM `'._DB_PREFIX_.'privatesale_extrafield_sale` ex
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps on ex.`id_sale` = ps.`id_sale`
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c on c.`id_category` = ps.`id_category`
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps on ex.`id_sale` = ps.`id_sale`
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c on c.`id_category` = ps.`id_category`
|
||||
WHERE ex.`id_field` = 1
|
||||
AND ex.`id_lang` = '. (int) $cookie->id_lang.'
|
||||
AND c.`id_category` IN ('.implode(',', $ids_categories).')
|
||||
@ -53,8 +57,8 @@ class AdminBraderie extends AdminTab
|
||||
$this->_html .= '<script type="text/javascript" src="'._MODULE_DIR_.'bulkupdate/chosen.jquery.min.js"></script>';
|
||||
$this->_html .= '<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$(".chosen-select").chosen(
|
||||
|
||||
$(".chosen-select").chosen(
|
||||
{
|
||||
allow_single_deselect:true,
|
||||
placeholder_text_single : "Choisir une vente",
|
||||
@ -109,10 +113,16 @@ class AdminBraderie extends AdminTab
|
||||
|
||||
$product_id = response.id_product;
|
||||
$attibute_id = response.id_product_attribute;
|
||||
if (response.attribute_name) {
|
||||
$("#ean_from_product").empty().append(response.name+" - "+response.attribute_name);
|
||||
console.log(response);
|
||||
if (response.id_image == null) {
|
||||
image = \'\';
|
||||
} else {
|
||||
$("#ean_from_product").empty().append(response.name);
|
||||
image = \'<img src="'._THEME_PROD_DIR_.'\'+response.img_path+\'-small.jpg" />\';
|
||||
}
|
||||
if (response.attribute_name) {
|
||||
$("#ean_from_product").empty().append(image+"<p>"+response.name+" - "+response.attribute_name+"</p>");
|
||||
} else {
|
||||
$("#ean_from_product").empty().append(image+"<p>"+response.name+"</p>");
|
||||
}
|
||||
if ($attibute_id) {
|
||||
$("#hidden_attribute_id").val($attibute_id);
|
||||
@ -172,10 +182,10 @@ class AdminBraderie extends AdminTab
|
||||
url: \''._MODULE_DIR_.'braderie/ajax.php?action=addToSellout'.'\',
|
||||
dataType: \'json\',
|
||||
data: {
|
||||
parent_category: $("#sale").val(),
|
||||
category: $("#category").val(),
|
||||
ean: $("#input_ean").val(),
|
||||
storage: $("#input_storage").val(),
|
||||
parent_category: $("#sale").val(),
|
||||
category: $("#category").val(),
|
||||
ean: $("#input_ean").val(),
|
||||
storage: $("#input_storage").val(),
|
||||
product: $("#hidden_product_id").val(),
|
||||
quantity: $("#input_quantity").val(),
|
||||
attribute: $("#hidden_attribute_id").val()
|
||||
@ -221,10 +231,10 @@ class AdminBraderie extends AdminTab
|
||||
url: \''._MODULE_DIR_.'braderie/ajax.php?action=addToSellout'.'\',
|
||||
dataType: \'json\',
|
||||
data: {
|
||||
parent_category: $("#sale").val(),
|
||||
category: $("#category").val(),
|
||||
ean: $("#input_ean").val(),
|
||||
storage: $("#input_storage").val(),
|
||||
parent_category: $("#sale").val(),
|
||||
category: $("#category").val(),
|
||||
ean: $("#input_ean").val(),
|
||||
storage: $("#input_storage").val(),
|
||||
product: $("#hidden_product_id").val(),
|
||||
quantity: $("#input_quantity").val(),
|
||||
attribute: $("#hidden_attribute_id").val()
|
||||
@ -261,12 +271,23 @@ class AdminBraderie extends AdminTab
|
||||
global $cookie;
|
||||
|
||||
$token = Tools::getAdminToken('AdminBraderie'.(int)(Tab::getIdFromClassName('AdminBraderie')).(int)($cookie->id_employee));
|
||||
|
||||
|
||||
$html = '
|
||||
<style>
|
||||
.chosen-container { width: 315px !important; }
|
||||
<style>
|
||||
.chosen-container { width: 315px !important; }
|
||||
.button-container input { margin: 10px 25px; }
|
||||
#error, #ean_from_product { margin-left: 210px; }
|
||||
#ean_from_product {
|
||||
background-color: rgba(86,84,133,0.7);
|
||||
color:#fff;
|
||||
margin-top: 5px;
|
||||
}
|
||||
#ean_from_product p{width: 200px;text-align: center;}
|
||||
#ean_from_product p,#ean_from_product img{
|
||||
display:inline-block;
|
||||
vertical-align:middle;
|
||||
margin: 5px;
|
||||
}
|
||||
#error, #ean_from_product { margin-left: 210px; width: 312px;}
|
||||
#error { font-weight: bold; margin-bottom: 20px; color: #CC0000; }
|
||||
</style>
|
||||
<fieldset>
|
||||
@ -278,7 +299,7 @@ class AdminBraderie extends AdminTab
|
||||
}
|
||||
$html .= '<div class="margin-form">
|
||||
<label>'.$this->l('Ventes').' : </label>
|
||||
<select class="chosen-select" id="sale" name="sale">
|
||||
<select class="chosen-select" id="sale" name="sale">
|
||||
<option value=""></option>';
|
||||
|
||||
foreach ($categories as $key => $value) {
|
||||
@ -290,7 +311,7 @@ class AdminBraderie extends AdminTab
|
||||
<hr id="divider" style="display: none;">
|
||||
<div class="margin-form" id="category_input_group" style="display: none;">
|
||||
<label>'.$this->l('Catégories').' : </label>
|
||||
<select class="chosen-select" id="category" name="category">
|
||||
<select class="chosen-select" id="category" name="category">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
<input type="submit" class="button" id="show_current_category_button" value="'.$this->l('Voir cette catégorie').'" style="margin-left: 20px; display: none">
|
||||
@ -299,7 +320,7 @@ class AdminBraderie extends AdminTab
|
||||
<div class="margin-form" id="ean_input_group" style="display: none;">
|
||||
<label>'.$this->l('Code EAN').' : </label>
|
||||
<input type="text" name="ean" id="input_ean">
|
||||
<p id="ean_from_product"></p>
|
||||
<div id="ean_from_product"></div>
|
||||
</div>
|
||||
<div class="margin-form" id="storage_input_group" style="display: none;">
|
||||
<label>'.$this->l('Emplacement').' : </label>
|
||||
|
@ -17,7 +17,7 @@ switch (Tools::getValue('action')) {
|
||||
case 'addToSellout':
|
||||
die(json_encode(addToSellout()));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
http_response_code(418);
|
||||
die('I\'m a teapot');
|
||||
@ -35,10 +35,10 @@ function getCategories()
|
||||
}
|
||||
|
||||
return Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`
|
||||
WHERE c.`id_parent` = '.$id_sale.'
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`
|
||||
WHERE c.`id_parent` = '.$id_sale.'
|
||||
AND cl.`id_lang` = '.(int)$cookie->id_lang
|
||||
);
|
||||
}
|
||||
@ -59,37 +59,38 @@ function getProductId()
|
||||
}
|
||||
|
||||
$result = Db::getInstance()->getRow('
|
||||
SELECT p.`id_product`, p.`reference`, pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
SELECT p.`id_product`, p.`reference`, pl.`name`, i.`id_image`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
|
||||
WHERE p.`ean13` = '.pSQL($ean).'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
ORDER BY `date_add` DESC
|
||||
-- ORDER BY `date_add` ASC
|
||||
');
|
||||
|
||||
if (empty($result)) {
|
||||
$result = Db::getInstance()->getRow('
|
||||
SELECT pa.*, pl.`name`, p.`reference` as product_reference, al.`name` as attribute_name
|
||||
SELECT pa.*, pl.`name`, p.`reference` as product_reference, al.`name` as attribute_name, i.`id_image`
|
||||
FROM `'._DB_PREFIX_.'product_attribute` pa
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pa.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.`id_attribute` = pac.`id_attribute`)
|
||||
WHERE pa.`ean13` = '.pSQL($ean).'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` i ON (i.`id_product` = pa.`id_product`)
|
||||
WHERE pa.`ean13` = '.pSQL($ean).'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
ORDER BY pa.`id_product_attribute` DESC
|
||||
-- ORDER BY pa.`id_product_attribute` ASC'
|
||||
);
|
||||
$result['reference'] = (!empty($result['reference'])) ? $result['reference'] : $result['product_reference'];
|
||||
|
||||
}
|
||||
|
||||
/*$category_name = Db::getInstance()->getRow('
|
||||
SELECT cl.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pps.`id_product`)
|
||||
WHERE p.`ean13` = '.pSQL($ean).'
|
||||
AND cl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
@ -99,8 +100,8 @@ function getProductId()
|
||||
if(!isset($category_name) || empty($category_name)) {
|
||||
$category_name = Db::getInstance()->getRow('
|
||||
SELECT cl.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.`id_product` = pps.`id_product`)
|
||||
WHERE pa.`ean13` = '.pSQL($ean).' AND cl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
@ -111,9 +112,9 @@ function getProductId()
|
||||
$result['category_name'] = $category_name['name'];
|
||||
|
||||
$product_name = Db::getInstance()->getRow('
|
||||
SELECT pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
SELECT pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
WHERE p.`ean13` = '.pSQL($ean).'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
ORDER BY p.`date_add` ASC
|
||||
@ -121,13 +122,13 @@ function getProductId()
|
||||
|
||||
if(!isset($product_name) || empty($product_name)) {
|
||||
$product_name = Db::getInstance()->getRow('
|
||||
SELECT pl.`name`
|
||||
SELECT pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_attribute` pa
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pa.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.`id_attribute` = pac.`id_attribute`)
|
||||
WHERE pa.`ean13` = '.pSQL($ean).'
|
||||
WHERE pa.`ean13` = '.pSQL($ean).'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
ORDER BY p.`date_add` ASC
|
||||
');
|
||||
@ -135,6 +136,12 @@ function getProductId()
|
||||
$result['product_name'] = $product_name['name'];*/
|
||||
|
||||
if (!empty($result)) {
|
||||
if(isset($result['id_image'])){
|
||||
$image_obj = new Image((int)$result['id_image']);
|
||||
$result['img_path'] = (isset($image_obj)?$image_obj->getExistingImgPath():'');
|
||||
} else {
|
||||
$result['img_path'] = null;
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
http_response_code(500);
|
||||
@ -193,9 +200,9 @@ function addToSellout()
|
||||
/*if(!$category_name) {
|
||||
$category_name = Db::getInstance()->getRow('
|
||||
SELECT cl.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
WHERE pps.`id_product` = '.(int)$id_product_old.'
|
||||
AND cl.`id_lang` = '.(int)$language['id_lang']
|
||||
);
|
||||
@ -205,9 +212,9 @@ function addToSellout()
|
||||
// récupération de la catégorie originale (nom de la première catégorie)
|
||||
$category_name = Db::getInstance()->getRow('
|
||||
SELECT cl.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pps.`id_product`)
|
||||
WHERE p.`ean13` = '.pSQL($ean13).'
|
||||
AND cl.`id_lang` = '.(int)$language['id_lang'].'
|
||||
@ -217,8 +224,8 @@ function addToSellout()
|
||||
if(!isset($category_name) || empty($category_name)) {
|
||||
$category_name = Db::getInstance()->getRow('
|
||||
SELECT cl.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` ps ON (ps.`id_category` = cl.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` pps ON (pps.`id_sale` = ps.`id_sale`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.`id_product` = pps.`id_product`)
|
||||
WHERE pa.`ean13` = '.pSQL($ean13).' AND cl.`id_lang` = '.(int)$language['id_lang'].'
|
||||
@ -230,9 +237,9 @@ function addToSellout()
|
||||
if ($ean13) {
|
||||
// récupération du nom original (nom du premier produit ajouté)
|
||||
$product_name = Db::getInstance()->getRow('
|
||||
SELECT pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
SELECT pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
WHERE p.`ean13` = '.pSQL($ean13).'
|
||||
AND pl.`id_lang` = '.(int)$language['id_lang'].'
|
||||
ORDER BY p.`date_add` ASC
|
||||
@ -240,13 +247,13 @@ function addToSellout()
|
||||
|
||||
if(!isset($product_name) || empty($product_name)) {
|
||||
$product_name = Db::getInstance()->getRow('
|
||||
SELECT pl.`name`
|
||||
SELECT pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product_attribute` pa
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pa.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.`id_attribute` = pac.`id_attribute`)
|
||||
WHERE pa.`ean13` = '.pSQL($ean13).'
|
||||
WHERE pa.`ean13` = '.pSQL($ean13).'
|
||||
AND pl.`id_lang` = '.(int)$language['id_lang'].'
|
||||
ORDER BY p.`date_add` ASC
|
||||
');
|
||||
@ -256,7 +263,7 @@ function addToSellout()
|
||||
$name = (isset($product_name) && !empty($product_name))? $product_name['name'] : $product->name[(int)$language['id_lang']];
|
||||
$product->name[(int)$language['id_lang']] = $name.' - '.strtoupper($category_name['name']);
|
||||
}
|
||||
|
||||
|
||||
$product->id_category_default = (int)$category;
|
||||
|
||||
if ($product->add()) {
|
||||
@ -275,19 +282,19 @@ function addToSellout()
|
||||
$product->UpdateCategories(array((int)$category,(int)$parent_category));
|
||||
|
||||
/*$max_position = Db::getInstance()->getValue("SELECT MAX(cp.`position`) AS max FROM `"._DB_PREFIX_."category_product` cp WHERE cp.`id_category`=" . (int)$category);
|
||||
$add_category = Db::getInstance()->Execute("INSERT INTO `"._DB_PREFIX_."category_product` (`id_product`, `id_category`, `position`)
|
||||
$add_category = Db::getInstance()->Execute("INSERT INTO `"._DB_PREFIX_."category_product` (`id_product`, `id_category`, `position`)
|
||||
VALUES (
|
||||
'". $product->id ."',
|
||||
'". (int)$category ."',
|
||||
'". (int)($max_position + 1 ) ."'
|
||||
'". (int)($max_position + 1 ) ."'
|
||||
)");
|
||||
|
||||
$max_position_in_parent = Db::getInstance()->getValue("SELECT MAX(cp.`position`) AS max FROM `"._DB_PREFIX_."category_product` cp WHERE cp.`id_category`=" . (int)$parent_category);
|
||||
$add_parent_category = Db::getInstance()->Execute("INSERT INTO `"._DB_PREFIX_."category_product` (`id_product`, `id_category`, `position`)
|
||||
$add_parent_category = Db::getInstance()->Execute("INSERT INTO `"._DB_PREFIX_."category_product` (`id_product`, `id_category`, `position`)
|
||||
VALUES (
|
||||
'". $product->id ."',
|
||||
'". (int)$parent_category ."',
|
||||
'". (int)($max_position_in_parent + 1 ) ."'
|
||||
'". (int)($max_position_in_parent + 1 ) ."'
|
||||
)");*/
|
||||
|
||||
if ($product->hasAttributes())
|
||||
@ -310,19 +317,19 @@ function pSQLArray($data)
|
||||
return $data;
|
||||
}
|
||||
|
||||
function recurse_copy($src, $dst) {
|
||||
function recurse_copy($src, $dst) {
|
||||
if (is_dir($src) && is_dir($dst)) {
|
||||
$dir = opendir($src);
|
||||
mkdir($dst);
|
||||
while(false !== ( $file = readdir($dir)) ) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
if ( is_dir($src . '/' . $file) ) {
|
||||
recurse_copy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
else {
|
||||
copy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$dir = opendir($src);
|
||||
mkdir($dst);
|
||||
while(false !== ( $file = readdir($dir)) ) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
if ( is_dir($src . '/' . $file) ) {
|
||||
recurse_copy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
else {
|
||||
copy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
}
|
||||
legend {
|
||||
background: #565485;
|
||||
background: rgba(86,84,133,0.6);
|
||||
background: rgba(86,84,133,0.9);
|
||||
border: 1px solid #565485;
|
||||
color: #fff;
|
||||
}
|
||||
@ -226,7 +226,7 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
}
|
||||
.table tr th {
|
||||
background: #565485;
|
||||
background: rgba(86,84,133,0.6);
|
||||
background: rgba(86,84,133,0.9);
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
@ -256,7 +256,7 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
border: 1px solid #565485;
|
||||
}
|
||||
.button {
|
||||
background-color: rgba(86,84,133,0.6);
|
||||
background-color: rgba(86,84,133,0.7);
|
||||
border: 1px solid #565485;
|
||||
border-left: 1px solid rgba(86,84,133,0.6);
|
||||
border-top: 1px solid rgba(86,84,133,0.6);
|
||||
|
Loading…
Reference in New Issue
Block a user