Merge branch 'develop' of gitlab.antadis.fr:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
6512b4aaaa
@ -245,9 +245,9 @@ class AdminProducts extends AdminTab
|
||||
Tools::redirectAdmin($currentIndex.(Tools::getValue('id_category') ? '&id_category='.Tools::getValue('id_category') : '').'&token='.($token ? $token : $this->token));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('reorderproduct')) {
|
||||
if (Tools::isSubmit('reorderproduct') || Tools::isSubmit('reordersubproduct')) {
|
||||
global $cookie, $currentIndex;
|
||||
|
||||
|
||||
// Position mise à 0
|
||||
Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'category_product`
|
||||
@ -255,39 +255,53 @@ class AdminProducts extends AdminTab
|
||||
WHERE `id_category` = '.(int)$this->_category->id
|
||||
);
|
||||
|
||||
// Récupération de tous les produits de la catégorie ordonée
|
||||
// selon la position de la sous-catégorie puis de la position dans la sous catégorie et sinon par id_product
|
||||
$first_products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.id_parent = cp.id_category)
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp2 ON (cp2.id_category = c.id_category AND cp2.id_product=cp.id_product)
|
||||
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
|
||||
WHERE cp.id_category ='.(int)$this->_category->id.'
|
||||
AND cp2.id_product IS NOT NULL
|
||||
ORDER BY c.position, cp2.position
|
||||
');
|
||||
$second_products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
|
||||
WHERE cp.id_category ='.(int)$this->_category->id.'
|
||||
AND cp.id_product NOT IN
|
||||
(
|
||||
SELECT cp2.id_product
|
||||
FROM `'._DB_PREFIX_.'category_product` cp2
|
||||
WHERE cp2.id_category IN
|
||||
(
|
||||
SELECT id_category
|
||||
FROM `'._DB_PREFIX_.'category`
|
||||
WHERE id_parent ='.(int)$this->_category->id.'
|
||||
)
|
||||
)
|
||||
ORDER BY cp.id_product
|
||||
');
|
||||
if (Tools::isSubmit('reorderproduct')) {
|
||||
// Récupération de tous les produits de la catégorie ordonée
|
||||
// selon la position de la sous-catégorie puis de la position dans la sous catégorie et sinon par id_product
|
||||
$first_products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.id_parent = cp.id_category)
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp2 ON (cp2.id_category = c.id_category AND cp2.id_product=cp.id_product)
|
||||
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product=p.id_product AND pl.`id_lang` = 1)
|
||||
WHERE cp.id_category ='.(int)$this->_category->id.'
|
||||
AND cp2.id_product IS NOT NULL
|
||||
ORDER BY c.position, pl.`name`
|
||||
');
|
||||
$second_products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product=p.id_product AND pl.`id_lang` = 1)
|
||||
WHERE cp.id_category ='.(int)$this->_category->id.'
|
||||
AND cp.id_product NOT IN
|
||||
(
|
||||
SELECT cp2.id_product
|
||||
FROM `'._DB_PREFIX_.'category_product` cp2
|
||||
WHERE cp2.id_category IN
|
||||
(
|
||||
SELECT id_category
|
||||
FROM `'._DB_PREFIX_.'category`
|
||||
WHERE id_parent ='.(int)$this->_category->id.'
|
||||
)
|
||||
)
|
||||
ORDER BY pl.`name`
|
||||
');
|
||||
|
||||
$products = array_merge($first_products,$second_products);
|
||||
|
||||
} else {
|
||||
$products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product=p.id_product AND pl.`id_lang` = 1)
|
||||
WHERE cp.id_category ='.(int)$this->_category->id.'
|
||||
ORDER BY pl.`name`
|
||||
');
|
||||
}
|
||||
|
||||
$products = array_merge($first_products,$second_products);
|
||||
// Update des postions
|
||||
foreach ($products as $key => $product) {
|
||||
if ($key == 0){
|
||||
@ -296,7 +310,8 @@ class AdminProducts extends AdminTab
|
||||
Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'category_product`
|
||||
SET `position` = '. (int)($key) .'
|
||||
WHERE `id_product` = '.(int)($product['id_product'])
|
||||
WHERE `id_product` = '.(int)($product['id_product']).'
|
||||
AND `id_category`='.(int)$this->_category->id
|
||||
);
|
||||
}
|
||||
Tools::redirectAdmin($currentIndex.(Tools::getValue('id_category') ? '&id_category='.Tools::getValue('id_category') : '').'&token='.($token ? $token : $this->token));
|
||||
@ -1692,12 +1707,6 @@ class AdminProducts extends AdminTab
|
||||
if ($this->delete)
|
||||
echo '<p><input type="submit" class="button" name="submitDel'.$this->table.'" value="'.$this->l('Delete selection').'" onclick="return confirm(\''.$this->l('Delete selected items?', __CLASS__, TRUE, FALSE).'\');" /></p>';
|
||||
|
||||
if((int)$this->_category->id_parent == 1){
|
||||
echo '<hr>';
|
||||
echo '<h2>Ordonner les produits</h2>';
|
||||
echo '<p><input type="submit" class="button" name="reorder'.$this->table.'" value="'.$this->l('Order products').'" /></p>';
|
||||
}
|
||||
|
||||
echo '<hr>';
|
||||
$languages = Language::getLanguages(FALSE);
|
||||
|
||||
@ -1813,10 +1822,24 @@ class AdminProducts extends AdminTab
|
||||
echo ' </td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="token" value="'.($token ? $token : $this->token).'" />
|
||||
</form>';
|
||||
<input type="hidden" name="token" value="'.($token ? $token : $this->token).'" />';
|
||||
|
||||
if((int)$this->_category->id_parent == 1){
|
||||
echo '<hr>';
|
||||
echo '<h2>Ordonner les produits des braderies</h2>';
|
||||
echo '<p><input type="submit" class="button" name="reorder'.$this->table.'" value="'.$this->l('Order products').'" /></p>';
|
||||
echo '<p>'.$this->l('Order by sub category positions and product name').'</p>';
|
||||
} elseif ((int)$this->_category->id_parent > 1) {
|
||||
echo '<hr>';
|
||||
echo '<h2>Ordonner les produits des braderies</h2>';
|
||||
echo '<p><input type="submit" class="button" name="reordersub'.$this->table.'" value="'.$this->l('Order products').'" /></p>';
|
||||
echo '<p>'.$this->l('Order by product name').'</p>';
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
if (isset($this->_includeTab) AND sizeof($this->_includeTab))
|
||||
echo '<br /><br />';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ class AdminSearch extends AdminTab
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$this->_list['products'] = Product::searchByName((int)$cookie->id_lang, $query);
|
||||
$this->_list['products'] = Product::searchByName((int)$cookie->id_lang, $query, 'id_product', 'DESC');
|
||||
if (!empty($this->_list['products']))
|
||||
for ($i = 0; $i < count($this->_list['products']); $i++)
|
||||
$this->_list['products'][$i]['nameh'] = str_ireplace($query, '<span class="highlight">'.Tools::htmlentitiesUTF8($query).'</span>', $this->_list['products'][$i]['name']);
|
||||
@ -134,6 +134,7 @@ class AdminSearch extends AdminTab
|
||||
'manufacturer' => array('title' => $this->l('Manufacturer')),
|
||||
'reference' => array('title' => $this->l('Reference')),
|
||||
'name' => array('title' => $this->l('Name')),
|
||||
'main_category_id' => array('title' => $this->l('Category')),
|
||||
'price' => array('title' => $this->l('Price')),
|
||||
'stock' => array('title' => $this->l('Stock')),
|
||||
'status' => array('title' => $this->l('Status')),
|
||||
@ -245,6 +246,7 @@ class AdminSearch extends AdminTab
|
||||
<td align="center">'.($product['manufacturer_name'] != NULL ? stripslashes($product['manufacturer_name']) : '--').'</td>
|
||||
<td>'.$product['reference'].'</td>
|
||||
<td><a href="'.$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">'.stripslashes($product['nameh']).'</a></td>
|
||||
<td><a href="'.$currentIndex.'?tab=AdminCatalog&id_category='.$product['main_category_id'].'viewcategory&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">'.stripslashes($product['main_category_id']).'</a></td>
|
||||
<td>'.Tools::displayPrice($product['price'], $currency).'</td>
|
||||
<td align="center">'.$product['quantity'].'</td>
|
||||
<td align="center"><a href="'.$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">
|
||||
|
@ -157,8 +157,8 @@ if (!defined('_PS_CACHE_ENABLED_'))
|
||||
|
||||
/* Consumable */
|
||||
if (!defined('_SHOP_CATEGORYROOT'))
|
||||
define('_SHOP_CATEGORYROOT', 8711761);
|
||||
define('_SHOP_CATEGORYROOT', 8720307);
|
||||
if (!defined('_SHOP_CATEGORYENABLED'))
|
||||
define('_SHOP_CATEGORYENABLED', 1);
|
||||
if (!defined('_SHOP_PRIVATESALES_CONSUMABLE'))
|
||||
define('_SHOP_PRIVATESALES_CONSUMABLE', 3963);
|
||||
define('_SHOP_PRIVATESALES_CONSUMABLE', 5158);
|
||||
|
@ -109,14 +109,19 @@ class AdminBraderie extends AdminTab
|
||||
|
||||
$product_id = response.id_product;
|
||||
$attibute_id = response.id_product_attribute;
|
||||
$("#ean_from_product").empty().append(response.name);
|
||||
if (response.attribute_name) {
|
||||
$("#ean_from_product").empty().append(response.name+" - "+response.attribute_name);
|
||||
} else {
|
||||
$("#ean_from_product").empty().append(response.name);
|
||||
}
|
||||
if ($attibute_id) {
|
||||
$("#hidden_attribute_id").val($attibute_id);
|
||||
} else {
|
||||
$("#hidden_attribute_id").val(0);
|
||||
}
|
||||
$("#hidden_product_id").val($product_id);
|
||||
$("#error").empty()
|
||||
$("#error").empty();
|
||||
$("#input_storage").focus();
|
||||
},
|
||||
error: function(xhr) {
|
||||
$("#ean_from_product").empty();
|
||||
@ -141,6 +146,52 @@ class AdminBraderie extends AdminTab
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#input_storage").change(function(event) {
|
||||
event.preventDefault();
|
||||
if ($product_id == undefined || $product_id == 0) {
|
||||
$("#error").empty().append("'.$this->l('Aucun produit n\'a été trouvé. Vérifier le code EAN').'");
|
||||
return false;
|
||||
}
|
||||
|
||||
var emplacement = $("#input_storage").val();
|
||||
|
||||
if (emplacement.length == 0 || emplacement>205) {
|
||||
$("#error").empty().append("'.$this->l('L\'emplacement n\'est pas renseigné ou est mal renseigné').'");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($("#input_quantity").val().length == 0) {
|
||||
$("#error").empty().append("'.$this->l('La quantité n\'est pas renseignée').'");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#hidden_product_id").val($product_id);
|
||||
|
||||
$.ajax({
|
||||
type: \'POST\',
|
||||
url: \''._MODULE_DIR_.'braderie/ajax.php?action=addToSellout'.'\',
|
||||
dataType: \'json\',
|
||||
data: {
|
||||
parent_category: $("#sale").val(),
|
||||
category: $("#category").val(),
|
||||
storage: $("#input_storage").val(),
|
||||
product: $("#hidden_product_id").val(),
|
||||
quantity: $("#input_quantity").val(),
|
||||
attribute: $("#hidden_attribute_id").val()
|
||||
},
|
||||
success: function(response) {
|
||||
$("#error").empty().append(response);
|
||||
$("#input_ean, #input_storage").val("");
|
||||
$("#ean_from_product").empty();
|
||||
$("#input_ean").focus();
|
||||
},
|
||||
error: function(xhr) {
|
||||
$("#error").empty().append(JSON.parse(xhr.responseText));
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#add_button").click(function(event) {
|
||||
event.preventDefault();
|
||||
if ($product_id == undefined || $product_id == 0) {
|
||||
|
@ -69,7 +69,7 @@ function getProductId()
|
||||
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 `date_add` DESC
|
||||
ORDER BY `date_add` ASC
|
||||
');
|
||||
|
||||
if (empty($result)) {
|
||||
@ -80,14 +80,16 @@ function getProductId()
|
||||
$result[0]['reference'] = ($result[0]['reference']) ? $result[0]['reference'] : $tmp['reference'];*/
|
||||
|
||||
$result = Db::getInstance()->getRow('
|
||||
SELECT pa.*, pl.`name`, p.`reference` as product_reference
|
||||
SELECT pa.*, pl.`name`, p.`reference` as product_reference, al.`name` as attribute_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).'
|
||||
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
|
||||
ORDER BY pa.`id_product_attribute`
|
||||
DESC'
|
||||
ASC'
|
||||
);
|
||||
$result['reference'] = (!empty($result['reference'])) ? $result['reference'] : $result['product_reference'];
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@ class AdminEditFast extends AdminTab {
|
||||
$title = Tools::getValue('title');
|
||||
$short_description = Tools::getValue('short_description');
|
||||
$description = Tools::getValue('description');
|
||||
$reference = Tools::getValue('reference');
|
||||
$id_lang_fast = Tools::getValue('id_lang_fast');
|
||||
$nbProduct = 0;
|
||||
|
||||
@ -37,6 +38,9 @@ class AdminEditFast extends AdminTab {
|
||||
if(isset($description[$product->id])){
|
||||
$product->description[(int) $id_lang_fast] = $description[$product->id];
|
||||
}
|
||||
if(isset($reference[$product->id])){
|
||||
$product->reference = $reference[$product->id];
|
||||
}
|
||||
|
||||
if ($product->save()) {
|
||||
$nbProduct++;
|
||||
@ -117,6 +121,9 @@ class AdminEditFast extends AdminTab {
|
||||
$form .= '<label>Titre</label>';
|
||||
$form .= '<input type="text" name="title['.(int)$product->id.']" value="'.$product->name.'" size="70" />';
|
||||
$form .= '<br /><br />';
|
||||
$form .= '<label>Reference</label>';
|
||||
$form .= '<input type="text" name="reference['.(int)$product->id.']" value="'.$product->reference.'" size="70" />';
|
||||
$form .= '<br /><br />';
|
||||
$form .= '<label>Description courte</label>';
|
||||
$form .= '<textarea name="short_description['. (int) $product->id.']" class="rte" id="" cols="10" rows="10">'.$product->description_short.'</textarea>';
|
||||
$form .= '<br /><br />';
|
||||
|
@ -45,6 +45,7 @@ class CategoryImg extends Module {
|
||||
|
||||
$sale = Sale::getSaleFromCategory(Tools::getValue('id_category'));
|
||||
$smarty->assign('sale', $sale);
|
||||
$smarty->assign('consumable', ((int) _SHOP_PRIVATESALES_CONSUMABLE == (int) $sale->id)? true : false);
|
||||
$smarty->assign('category', $category);
|
||||
return $this->display(__FILE__, 'left_img.tpl');
|
||||
}
|
||||
|
@ -5,8 +5,10 @@
|
||||
<div class="logo_cat">
|
||||
<img src="{$base_dir_ssl}modules/privatesales/img/{$sale->id}/thumb_{$cookie->id_lang}.jpg" />
|
||||
</div>
|
||||
{if !$consumable}
|
||||
<div class="delivery_delay_left">
|
||||
{include file="./themes/site/delay.tpl" delivery_delay=$sale->delivery_delay}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
@ -13,8 +13,26 @@ class AdminLabelGenerate extends AdminTab {
|
||||
public function display() {
|
||||
global $cookie;
|
||||
|
||||
$rack = Tools::getValue('rack');
|
||||
$current_sale = Tools::getValue('id_sale');
|
||||
if ($current_sale && Tools::getValue('deleteEAN')) {
|
||||
if ($rack) {
|
||||
// button commenté en fin de page
|
||||
$barcode = new GenerateBarcode();
|
||||
$barcode->createRackFolder();
|
||||
$rackCodes = array();
|
||||
for ($i=0;$i<21;$i++) {
|
||||
for ($j=1;$j<6;$j++) {
|
||||
$name = $i.$j;
|
||||
$barcode->generateRack($name);
|
||||
$rackCodes[] = $name;
|
||||
}
|
||||
}
|
||||
$barcode->printRackPDF($rackCodes);
|
||||
|
||||
if (glob(_PS_MODULE_DIR_.'labelgenerate/img/rack/rack.pdf')) {
|
||||
$this->_html .= '<p class="conf">Rack générés : <a target="_blank" href="/modules/labelgenerate/img/rack/rack.pdf">Télécharger le PDF rack</a></p>';
|
||||
}
|
||||
} elseif ($current_sale && Tools::getValue('deleteEAN')) {
|
||||
$sale = new Sale((int)$current_sale);
|
||||
|
||||
if(!Validate::isLoadedObject($sale)) {
|
||||
@ -182,6 +200,14 @@ class AdminLabelGenerate extends AdminTab {
|
||||
</fieldset>
|
||||
<br /><br />';
|
||||
|
||||
/*$this->_html .='<fieldset>
|
||||
<legend>'.$this->l('Rack barcode').'</legend>
|
||||
<div class="margin-form">
|
||||
<button class="button" id="generateRack">'.$this->l('Generate rack').'</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
<br /><br />';*/
|
||||
|
||||
|
||||
$this->_html.= '<link type="text/css" rel="stylesheet" href="'._MODULE_DIR_.'bulkupdate/chosen.min.css" />';
|
||||
$this->_html.= '<script type="text/javascript" src="'._MODULE_DIR_.'bulkupdate/chosen.jquery.min.js"></script>';
|
||||
@ -215,6 +241,10 @@ class AdminLabelGenerate extends AdminTab {
|
||||
}
|
||||
});
|
||||
|
||||
$("#generateRack").click(function(){
|
||||
document.location.href=\'index.php?tab=AdminLabelGenerate&token='.Tools::getAdminTokenLite('AdminLabelGenerate').'&rack=1\';
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>';
|
||||
|
@ -18,6 +18,61 @@ class GenerateBarcode {
|
||||
}
|
||||
}
|
||||
|
||||
public function createRackFolder() {
|
||||
if (!(is_dir(self::$barcode_directory.'rack'))) {
|
||||
mkdir(self::$barcode_directory.'rack', 0775);
|
||||
}
|
||||
}
|
||||
|
||||
public function generateRack($name) {
|
||||
$width = 320;
|
||||
$height = 80;
|
||||
$im = imagecreatetruecolor($width, $height);
|
||||
$black = ImageColorAllocate($im, 0x00, 0x00, 0x00);
|
||||
$white = ImageColorAllocate($im, 0xff, 0xff, 0xff);
|
||||
imagefilledrectangle($im, 0, 0, $width, $height, $white);
|
||||
Barcode::gd($im, $black, $width / 2, $height / 2 - 10 , 0, "code128", $name, 3, 50);
|
||||
imagettftext($im, 11, 0, $width / 2 - (strlen('*'.$name.'*')* 4), $height - 10 , $black, dirname(__FILE__).'/arial.ttf', '*'.$name.'*' );
|
||||
|
||||
imagegif($im, self::$barcode_directory.'rack/img-'.$name.'.gif');
|
||||
}
|
||||
|
||||
public function printRackPDF($codes) {
|
||||
ob_start();
|
||||
$pdf = new FPDF('P', 'mm', 'A4');
|
||||
$nb_per_page = 0;
|
||||
$pdf->SetMargins(9,12,9);
|
||||
$pdf->SetAutoPageBreak(FALSE);
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Arial','',14);
|
||||
|
||||
$nb_line = ceil((count($codes)/4));
|
||||
for ($i=1; $i <= $nb_line; $i++) {
|
||||
$img_per_line = array_slice($codes, 0, 4);
|
||||
$codes = array_splice($codes, 4);
|
||||
|
||||
if($nb_per_page == self::_TOTAL_PER_PAGE_) {
|
||||
$pdf->addPage();
|
||||
$nb_per_page = 0;
|
||||
}
|
||||
foreach ($img_per_line as $key => $value) {
|
||||
$this->_printLabel($pdf, $value, 1);
|
||||
}
|
||||
$pdf->Ln(4);
|
||||
|
||||
foreach ($img_per_line as $key => $value) {
|
||||
$image = self::$barcode_directory.'rack/img-'.$value.'.gif';
|
||||
$this->_printEAN($pdf, $image, 1);
|
||||
}
|
||||
$pdf->Ln(13);
|
||||
|
||||
$nb_per_page += 1;
|
||||
}
|
||||
$pdf->Output(self::$barcode_directory.'rack/rack.pdf', 'F');
|
||||
ob_clean();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public function createFolder($name) {
|
||||
if (!(is_dir(self::$barcode_directory.$name))) {
|
||||
mkdir(self::$barcode_directory.$name, 0775);
|
||||
|
@ -22,6 +22,7 @@ class AdminLandingPages extends AdminTab {
|
||||
VALUES (
|
||||
DEFAULT,
|
||||
'.(int) (bool) Tools::getValue('enabled').',
|
||||
'.(int) (bool) Tools::getValue('connect_button').',
|
||||
"'.pSQL(Tools::str2url($name)).'",
|
||||
"'.pSQL(Tools::getValue('text1')).'",
|
||||
"'.pSQL(Tools::getValue('text2')).'",
|
||||
@ -74,9 +75,10 @@ class AdminLandingPages extends AdminTab {
|
||||
Db::getInstance()->ExecuteS('
|
||||
UPDATE `'._DB_PREFIX_.'landing_page`
|
||||
SET `enabled` = '.(int) (bool) Tools::getValue('enabled').',
|
||||
`connect_button` = '.(int) (bool) Tools::getValue('connect_button').',
|
||||
`name` = "'.pSQL(Tools::str2url($name)).'",
|
||||
`text1` = "'.pSQL(Tools::getValue('text1')).'",
|
||||
`text2` = "'.pSQL(Tools::getValue('text2')).'",
|
||||
`text2` = "'.pSQL(Tools::getValue('text2')).'",
|
||||
`tag` = "'.pSQL(Tools::getValue('tag'), true).'"
|
||||
WHERE `id_landing_page` = '.$id_landing_page.'
|
||||
');
|
||||
@ -147,6 +149,7 @@ class AdminLandingPages extends AdminTab {
|
||||
<th>'.$this->l('URL chunk').'</th>
|
||||
<th id="cust_sort">'.$this->l('Customers').'</th>
|
||||
<th style="width: 55px;">'.$this->l('Enabled').'</th>
|
||||
<th style="width: 55px;">'.$this->l('Connect').'</th>
|
||||
<th style="width: 35px;">'.$this->l('Actions').'</th>
|
||||
</tr>';
|
||||
|
||||
@ -157,6 +160,7 @@ class AdminLandingPages extends AdminTab {
|
||||
<td>http://'.$_SERVER['SERVER_NAME'].'/authentification?create_account=1&lp='.$page['name'].'</td>
|
||||
<td>'.(isset($counts[$page['id_landing_page']])? $counts[$page['id_landing_page']]: '0').'</td>
|
||||
<td>'.($page['enabled']? $this->l('Yes'): $this->l('No')).'</td>
|
||||
<td>'.($page['connect_button']? $this->l('Yes'): $this->l('No')).'</td>
|
||||
<td>
|
||||
<img style="cursor: pointer;" onclick="itemEdition('.$page['id_landing_page'].')" title="'.$this->l('Edit this landing page').'" alt="" src="../img/admin/edit.gif" />
|
||||
</td>
|
||||
@ -286,6 +290,15 @@ class AdminLandingPages extends AdminTab {
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
echo '<label>'.$this->l('Connect Button:').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="enabled" style="float: left;">
|
||||
<input name="connect_button" type="radio" value="0"'.($this->curlp? ($this->curlp['connect_button'] == 0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('No').' <input name="connect_button" type="radio" value="1"'.($this->curlp && $this->curlp['connect_button'] == 1? ' checked="checked"': '').' /> '.$this->l('Yes').'
|
||||
<sup> *</sup>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
echo '<label>'.$this->l('Text 1:').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="enabled" style="float: left;">
|
||||
|
26
modules/landingpages/authentication_bottom.tpl
Normal file
26
modules/landingpages/authentication_bottom.tpl
Normal file
@ -0,0 +1,26 @@
|
||||
{if $connect_button == 1}
|
||||
<style type="text/css">
|
||||
#authentication #center_column #account-creation_container p#account_form_bottom{
|
||||
padding: 6px 50px;
|
||||
width: inherit;
|
||||
text-align: right;
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if ($('#submitAccount').outerWidth() > $('a#SubmitLogin').outerWidth()) {
|
||||
$('a#SubmitLogin').css({
|
||||
width: $('#submitAccount').outerWidth()+'px'
|
||||
});
|
||||
} else {
|
||||
$('#submitAccount').css({
|
||||
width: $('a#SubmitLogin').outerWidth()+'px'
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<p class="cart_navigation" id="account_form_bottom">
|
||||
<a id="SubmitLogin" href="{$link->getPageLink('authentication.php')}">{l s='Already member' mod='landingpages'}</a>
|
||||
</p>
|
||||
{/if}
|
@ -68,6 +68,7 @@ class LandingPages extends Module {
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'landing_page` (
|
||||
`id_landing_page` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`enabled` BOOL NOT NULL,
|
||||
`connect_button` BOOL NOT NULL,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`text1` VARCHAR(255) NOT NULL,
|
||||
`text2` VARCHAR(255) NOT NULL,
|
||||
@ -93,6 +94,7 @@ class LandingPages extends Module {
|
||||
if(!parent::install()
|
||||
|| !$this->registerHook('adminCustomers')
|
||||
|| !$this->registerHook('createAccountForm')
|
||||
|| !$this->registerHook('createAccountFormBottom')
|
||||
|| !$this->registerHook('createAccount')) {
|
||||
return FALSE;
|
||||
}
|
||||
@ -224,4 +226,24 @@ class LandingPages extends Module {
|
||||
return $this->display(__FILE__, 'authentication.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookCreateAccountFormBottom($params) {
|
||||
global $smarty, $cookie;
|
||||
$connect_button = 0;
|
||||
if($name = Tools::getValue('lp')) {
|
||||
if($landing = Db::getInstance()->getRow('
|
||||
SELECT `connect_button`
|
||||
FROM `'._DB_PREFIX_.'landing_page`
|
||||
WHERE `enabled` = 1
|
||||
AND `name` = "'.pSQL($name).'"
|
||||
')) {
|
||||
$connect_button = $landing['connect_button'];
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign(array(
|
||||
'connect_button' => $connect_button,
|
||||
));
|
||||
return $this->display(__FILE__, 'authentication_bottom.tpl');
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
include_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php');
|
||||
|
||||
class AdminPrivateSalesSales extends AdminTab {
|
||||
|
||||
private $imagelist;
|
||||
|
||||
public function __construct() {
|
||||
@ -232,7 +231,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Public sale:').'</label>
|
||||
<div class="margin-form">
|
||||
@ -242,7 +241,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Braderie :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="public" style="float: left;">
|
||||
@ -273,10 +272,10 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Nouveau :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="new" style="float: left;">
|
||||
<div id="new" style="float: left;">
|
||||
<input name="new" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->new==0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('Non').' <input name="new" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->new==1?' checked="checked"': '').' /> '.$this->l('Oui').'
|
||||
<sup> *</sup>
|
||||
</div>
|
||||
@ -286,7 +285,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
|
||||
echo '<label>'.$this->l('Mise en avant newsletter :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="forward_news" style="float: left;">
|
||||
<div id="forward_news" style="float: left;">
|
||||
<input name="forward_news" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->forward_news==0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('Non').' <input name="forward_news" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->forward_news==1?' checked="checked"': '').' /> '.$this->l('Oui').'
|
||||
<sup> *</sup>
|
||||
</div>
|
||||
@ -428,19 +427,19 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
|
||||
// echo '<label>'.$this->l('Sale type:').'</label>
|
||||
// <div class="margin-form">
|
||||
// <div id="carriers" style="float: left;">
|
||||
// <div id="carriers" style="float: left;">
|
||||
// '.$this->l('SALETYPE1').' <input '. (isset($this->cursale->sale_type) && in_array(1,$this->cursale->sale_type) ? ' checked': '') .' type="checkbox" name="sale_type[]" value="1">
|
||||
// '.$this->l('SALETYPE2').' <input '. (isset($this->cursale->sale_type) && in_array(2,$this->cursale->sale_type) ? ' checked': '') .' type="checkbox" name="sale_type[]" value="2">
|
||||
// '.$this->l('SALETYPE3').' <input '. (isset($this->cursale->sale_type) && in_array(3,$this->cursale->sale_type) ? ' checked': '') .' type="checkbox" name="sale_type[]" value="3">
|
||||
// </div>
|
||||
// </div>';
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Description:').'</label>
|
||||
<div class="margin-form">';
|
||||
foreach($this->_languages as $language) {
|
||||
echo '<div id="description_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
|
||||
<textarea style="width: 500px; height: 150px;" name="description_'.$language['id_lang'].'">';
|
||||
if($this->cursale !== NULL) {
|
||||
if($this->cursale !== NULL) {
|
||||
echo htmlentities($this->cursale->description[$language['id_lang']]);
|
||||
// echo htmlentities(utf8_decode($this->cursale->description[$language['id_lang']]));
|
||||
}
|
||||
@ -480,7 +479,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
echo '<div class="clear"></div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
Module::hookExec('privatesales_edit', array('sale' => $this->cursale));
|
||||
|
||||
echo '<br class="clear" />
|
||||
@ -498,14 +497,14 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
global $cookie, $currentIndex;
|
||||
$this->cursale = NULL;
|
||||
if($id = Tools::getValue('id')) {
|
||||
$this->cursale = new Sale($id);
|
||||
$this->cursale = new Sale($id);
|
||||
if($this->cursale->id === NULL) {
|
||||
Tools::redirectAdmin($currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesSales'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// // ANTADIS INSERT TYPE
|
||||
// $ventes = Sale::getSales(NULL, NULL, NULL, NULL , FALSE, FALSE, 'position ASC');
|
||||
// $ventes = Sale::getSales(NULL, NULL, NULL, NULL , FALSE, FALSE, 'position ASC');
|
||||
// foreach ($ventes as $key => $vente) {
|
||||
// global $cookie;
|
||||
// if($cookie->id_employee == 1){
|
||||
@ -515,7 +514,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
// ), 'INSERT');
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
$this->displayForm();
|
||||
|
||||
$export = Module::isInstalled('exports');
|
||||
@ -527,7 +526,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
') as $row) {
|
||||
$employees[(int) $row['id_employee']] = $row['firstname'].' '.$row['lastname'];
|
||||
}
|
||||
|
||||
|
||||
//ANTADIS
|
||||
echo '<fieldset style="margin-top:15px">';
|
||||
echo '<legend>Tri des ventes</legend>';
|
||||
@ -535,7 +534,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
echo '<input type="submit" value="Ventes terminées" name="finished" class="tri button">';
|
||||
echo '<input type="submit" value="Toutes les ventes" name="all" class="tri button">';
|
||||
echo '</fieldset>';
|
||||
|
||||
|
||||
?>
|
||||
<script>
|
||||
jQuery( document ).ready(function( $ ) {
|
||||
@ -547,10 +546,10 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
button.removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.list_vente').empty();
|
||||
|
||||
|
||||
var loader = "<p class='text-align:center'><img src='../img/loader.gif' /></p>";
|
||||
$('.list_vente').html(loader);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "ajax_vp.php",
|
||||
type: 'GET',
|
||||
@ -564,10 +563,10 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
});
|
||||
|
||||
$(".updatePosition").live( "click", function(e) {
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
var position = $(this).attr('data-position');
|
||||
var way = $(this).attr('data-way');
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "ajax_vp.php",
|
||||
type: 'GET',
|
||||
@ -582,7 +581,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
$('.list_vente').empty();
|
||||
$('.list_vente').html(html);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -676,8 +675,8 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
$ids[] = $sale->id;
|
||||
}
|
||||
$extrafields = PrivateSales_ExtraFields::getFieldsForSale($ids);
|
||||
|
||||
foreach($sales as $key => $sale) {
|
||||
|
||||
foreach($sales as $key => $sale) {
|
||||
echo '<tr id="item_'.$sale->id. '" class="sale_'.($key%2).'">
|
||||
<td>'.$sale->id.'</td>
|
||||
<td><strong>'.$sale->title[intval($cookie->id_lang)].'</strong><br/><span style="color:#666; font-style:italic">'.$extrafields[$sale->id][1].'</span></td>
|
||||
@ -695,7 +694,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
else if($sale->new == 3){
|
||||
echo "<td>".$this->l('Non défini')."</td>";
|
||||
}
|
||||
|
||||
|
||||
echo '<td>'.((int) $sale->id_employee != 0? $employees[(int) $sale->id_employee]: '--').'</td>
|
||||
<td '.(in_array('fr', $sale->versions) ? 'class="green"' : 'class="red"').'>FR</td>
|
||||
<td '.(in_array('es', $sale->versions) ? 'class="green"' : 'class="red"').'>ES</td>
|
||||
@ -709,12 +708,12 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
if($key + 1 != count($sales)){
|
||||
echo '<a href="" class="updatePosition" data-way="1" data-position='. $sale->position .'><img title="Bas" alt="Bas" src="../img/admin/down.gif"></a>';
|
||||
}
|
||||
$category_link = Link::getCategoryLink($sale->id_category);
|
||||
$category_link = Link::getCategoryLink($sale->id_category);
|
||||
echo '</td>
|
||||
<td>
|
||||
'.($export? '<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'"><img style="cursor: pointer;" title="Exporter cette vente" alt="" src="../img/admin/export.gif"></a>': '').'
|
||||
<img style="cursor: pointer;" onclick="itemEdition('.$sale->id.')" title="Éditer cette vente" alt="" src="../img/admin/edit.gif">
|
||||
<img style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')" title="Supprimer cette vente" alt="" src="../img/admin/delete.gif">
|
||||
<img style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')" title="Supprimer cette vente" alt="" src="../img/admin/delete.gif">
|
||||
<a href="'.$category_link.'" target="_blank">
|
||||
<img style="cursor: pointer;" title="Voir cette vente" alt="" src="../img/admin/details.gif">
|
||||
</a>
|
||||
@ -754,7 +753,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
if (Sale::getSaleFromCategory(Tools::getValue('id_category'))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$sql_position = 'SELECT MAX(position) FROM '. _DB_PREFIX_.'privatesale';
|
||||
$position = Db::getInstance()->getValue($sql_position);
|
||||
|
||||
@ -777,7 +776,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
foreach(Tools::getValue('sale_type', array()) as $sale_type) {
|
||||
$sale->sale_type[] = (int) $sale_type;
|
||||
}
|
||||
|
||||
|
||||
foreach(Language::getLanguages(FALSE) as $language) {
|
||||
if($description = Tools::getValue('description_'.$language['id_lang'])) {
|
||||
$sale->description[$language['id_lang']] = $description;
|
||||
@ -809,7 +808,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
|
||||
$sale->save();
|
||||
$sale->buildCategoryCache();
|
||||
|
||||
|
||||
if( empty($sale->carriers)) {
|
||||
mail('valentin@bebeboutik.com', 'Vente sans transporteur',
|
||||
'La vente '. $sale->id.' est sans transporteur',
|
||||
@ -879,7 +878,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
echo '<div class="error alert">'.Tools::displayError($this->l('Impossible d\'éditer une vente sans transporteur.')).'</div>';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$sale->save();
|
||||
$sale->buildCategoryCache();
|
||||
|
||||
|
@ -411,7 +411,7 @@ class Sale {
|
||||
return $orders;
|
||||
}
|
||||
|
||||
public function getMultiForStats($orders = array(), $nb_sale, $strict = false)
|
||||
public function getMultiForStats($orders = array(), $nb_sale, $strict = false)
|
||||
{
|
||||
$products = $this->getProducts();
|
||||
|
||||
|
@ -88,7 +88,7 @@ class MakeStats {
|
||||
$arrayTmp = array();
|
||||
$g = 0;
|
||||
|
||||
if ($id_sale>2) {
|
||||
if ($id_sale && (int)$id_sale>2) {
|
||||
|
||||
$sale = new Sale((int) $id_sale);
|
||||
$id_products = $sale->getProducts();
|
||||
@ -153,7 +153,7 @@ class MakeStats {
|
||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['stock'] = $stock;
|
||||
}
|
||||
|
||||
if ($id_sale>2) {
|
||||
if ($id_sale && (int)$id_sale>2) {
|
||||
// multi (order contenant au moins 3 ventes differentes)
|
||||
if(!isset($arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi']) && in_array($line['id_order'], $all_multi)) {
|
||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi'] = $quantity;
|
||||
@ -177,6 +177,7 @@ class MakeStats {
|
||||
|
||||
// multi 1 + multi 2 (produit dans order contenant uniquement 1 vente et order contenant 2 ventes)
|
||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1_m2'] = $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1'] + $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m2'];
|
||||
$arrayTmp[$line['product_id']][$line['product_attribute_id']]['total_m'] = $arrayTmp[$line['product_id']][$line['product_attribute_id']]['m1_m2'] + $arrayTmp[$line['product_id']][$line['product_attribute_id']]['multi'];
|
||||
}
|
||||
}
|
||||
return $lines = $arrayTmp;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -403,4 +403,16 @@
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function getProductsWsSold($id)
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT cp.`id_product` as id
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`product_id` = cp.`id_product`)
|
||||
WHERE cp.`id_category` = '.(int)($id).'
|
||||
ORDER BY `position` ASC
|
||||
');
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,43 @@
|
||||
<?php
|
||||
class Product extends ProductCore
|
||||
{
|
||||
|
||||
/**
|
||||
* @Override
|
||||
* Admin panel product search
|
||||
*
|
||||
* @param integer $id_lang Language id
|
||||
* @param string $query Search query
|
||||
* @return array Matching products
|
||||
*/
|
||||
public static function searchByName($id_lang, $query, $orderBy = 'name', $order = 'ASC')
|
||||
{
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
SELECT p.`id_product`, pl.`name`, p.`active`, p.`reference`, m.`name` AS manufacturer_name,
|
||||
MIN(cp.`id_category`) AS `main_category_id`
|
||||
-- (SELECT name FROM ps_category_lang WHERE `id_category` = MIN(cp.`id_category`) AND `id_lang` = 1) AS `main_category`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).')
|
||||
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.`id_product` = p.`id_product`
|
||||
WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' OR pa.`reference` LIKE \'%'.pSQL($query).'%\'
|
||||
GROUP BY `id_product`
|
||||
ORDER BY pl.`'.$orderBy.'` '.$order);
|
||||
|
||||
if (!$result)
|
||||
return false;
|
||||
|
||||
$resultsArray = array();
|
||||
foreach ($result AS $row)
|
||||
{
|
||||
$row['price'] = Product::getPriceStatic($row['id_product'], true, NULL, 2);
|
||||
$row['quantity'] = Product::getQuantity($row['id_product']);
|
||||
$resultsArray[] = $row;
|
||||
}
|
||||
return $resultsArray;
|
||||
}
|
||||
|
||||
public static function getProductsProperties($id_lang, $query_result, $cached = true)
|
||||
{
|
||||
$resultsArray = array();
|
||||
|
@ -328,6 +328,7 @@ class AuthController extends AuthControllerCore {
|
||||
public function displayContent() {
|
||||
Tools::safePostVars();
|
||||
self::$smarty->assign('errors', $this->errors);
|
||||
self::$smarty->assign('HOOK_CREATE_ACCOUNT_FORM_BOTTOM', Module::hookExec('createAccountFormBottom', array()));
|
||||
self::$smarty->display(_PS_THEME_DIR_.'authentication.tpl');
|
||||
}
|
||||
|
||||
|
@ -431,6 +431,7 @@ $(function(){ldelim}
|
||||
<input type="submit" name="submitAccount" id="submitAccount" value="{l s='Register'}" class="exclusive" onclick="if($('#newsletter:checked').length == 0) { alert('{l s='Please accept our terms of use to continue' js=1}'); return false; }" />
|
||||
<span><sup>*</sup>{l s='Required field'}</span>
|
||||
</p>
|
||||
{$HOOK_CREATE_ACCOUNT_FORM_BOTTOM}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
@ -163,6 +163,16 @@
|
||||
{/if}
|
||||
<!-- End Facebook Pixel Code -->
|
||||
|
||||
<!-- crazyegg -->
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
setTimeout(function(){var a=document.createElement("script");
|
||||
var b=document.getElementsByTagName("script")[0];
|
||||
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0047/9841.js?"+Math.floor(new Date().getTime()/3600000);
|
||||
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
</head>
|
||||
|
||||
<body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{$bodyClass}{if $cookie->isLogged()} logged{/if}{if isset($smarty.get.content_only)} content_only{/if}{if isset($smarty.post.email_create) || isset($smarty.get.create_account)} create{/if} lang{$cookie->id_lang}">
|
||||
|
@ -1,6 +1,6 @@
|
||||
{if $sale}
|
||||
{if $consumable}
|
||||
<div id="sale_end"></div>
|
||||
<div id="sale_end" class="consumable"></div>
|
||||
{else}
|
||||
<div id="sale_end">
|
||||
{l s='This sale ends in' mod='privatesales_countdown'} <span id="countdown"></span>
|
||||
|
@ -462,6 +462,7 @@ $(document).ready(function() {
|
||||
<input type="submit" name="submitAccount" id="submitAccount" value="{l s='Register'}" class="exclusive" onclick="if($('#newsletter:checked').length == 0) { alert('{l s='Please accept our terms of use to continue' js=1}'); return false; }" />
|
||||
</div>
|
||||
</div>
|
||||
{$HOOK_CREATE_ACCOUNT_FORM_BOTTOM}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1565,6 +1565,11 @@ body#product div#sale_end{
|
||||
body#product div#sale_end #countdown{
|
||||
color: #e36ea2;
|
||||
}
|
||||
body#category #sale_end.consumable,
|
||||
body#product #sale_end.consumable{
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
body#category div.sale_img,
|
||||
body#product div.sale_img{
|
||||
margin:10px 0px;
|
||||
|
@ -125,8 +125,5 @@
|
||||
{/literal}-->
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -169,6 +169,16 @@
|
||||
{/if}
|
||||
{/if}
|
||||
<!-- End Facebook Pixel Code -->
|
||||
|
||||
<!-- crazyegg -->
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
setTimeout(function(){var a=document.createElement("script");
|
||||
var b=document.getElementsByTagName("script")[0];
|
||||
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0047/9841.js?"+Math.floor(new Date().getTime()/3600000);
|
||||
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
|
||||
</script>
|
||||
{/literal}
|
||||
</head>
|
||||
|
||||
<body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{$bodyClass}{if $cookie->isLogged()} logged{/if}">
|
||||
|
@ -0,0 +1,37 @@
|
||||
{if $connect_button == 1}
|
||||
<style type="text/css">
|
||||
#authentication #center_column #account-creation_container p#account_form_bottom{
|
||||
padding: 0px;
|
||||
width: inherit;
|
||||
text-align: right;
|
||||
margin-top: 10px;
|
||||
}
|
||||
#authentication #center_column #account-creation_container p#account_form_bottom a#SubmitLogin{
|
||||
height: 40px;
|
||||
padding: 0px 15px 0px 15px;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
border: 0px none;
|
||||
position: relative;
|
||||
right: 0px;
|
||||
border-radius: 0px !important;
|
||||
background: #565485;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if ($('#submitAccount').outerWidth() > $('a#SubmitLogin').outerWidth()) {
|
||||
$('a#SubmitLogin').css({
|
||||
width: $('#submitAccount').outerWidth()+'px'
|
||||
});
|
||||
} else {
|
||||
$('#submitAccount').css({
|
||||
width: $('a#SubmitLogin').outerWidth()+'px'
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<p class="cart_navigation" id="account_form_bottom">
|
||||
<a id="SubmitLogin" href="{$link->getPageLink('authentication.php')}">{l s='Already member' mod='landingpages'}</a>
|
||||
</p>
|
||||
{/if}
|
@ -1,14 +1,20 @@
|
||||
{if $sale}
|
||||
<div id="sale_end">
|
||||
{l s='This sale ends in' mod='privatesales_countdown'} <span id="countdown"></span>
|
||||
</div>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown.min.js"></script>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown-{$lang_iso}.js"></script>
|
||||
<script type="text/javascript">{literal}
|
||||
var endstring = "{/literal}{$sale->date_end}{literal}";
|
||||
var enddate = endstring.split(' ')[0].split('-');
|
||||
var endtime = endstring.split(' ')[1].split(':');
|
||||
var endofsale = new Date(enddate[0], enddate[1]-1, enddate[2], endtime[0], endtime[1], endtime[2]);
|
||||
$('#countdown').countdown({serverSync:function(){var d = new Date({/literal}{$smarty.now|date_format:'%Y, '}{$smarty.now|date_format:'%-m'} - 1{$smarty.now|date_format:', %-d, %-H, %-M, %-S'}{literal}); return d;}, until: endofsale, layout: '{d<}{dn} {dl} {d>} {hn} {hl}'});
|
||||
{/literal}</script>
|
||||
{if $consumable}
|
||||
<div id="sale_end" class="consumable">
|
||||
<img src="{$base_dir_ssl}modules/privatesales/img/{$sale->id}/thumb_{$cookie->id_lang}.jpg" height="50px"/>
|
||||
</div>
|
||||
{else}
|
||||
<div id="sale_end">
|
||||
{l s='This sale ends in' mod='privatesales_countdown'} <span id="countdown"></span>
|
||||
</div>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown.min.js"></script>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown-{$lang_iso}.js"></script>
|
||||
<script type="text/javascript">{literal}
|
||||
var endstring = "{/literal}{$sale->date_end}{literal}";
|
||||
var enddate = endstring.split(' ')[0].split('-');
|
||||
var endtime = endstring.split(' ')[1].split(':');
|
||||
var endofsale = new Date(enddate[0], enddate[1]-1, enddate[2], endtime[0], endtime[1], endtime[2]);
|
||||
$('#countdown').countdown({serverSync:function(){var d = new Date({/literal}{$smarty.now|date_format:'%Y, '}{$smarty.now|date_format:'%-m'} - 1{$smarty.now|date_format:', %-d, %-H, %-M, %-S'}{literal}); return d;}, until: endofsale, layout: '{d<}{dn} {dl} {d>} {hn} {hl}'});
|
||||
{/literal}</script>
|
||||
{/if}
|
||||
{/if}
|
||||
|
@ -1,14 +1,18 @@
|
||||
{if $sale}
|
||||
<div id="sale_end">
|
||||
{l s='This sale ends in' mod='privatesales_countdown'} <span id="countdown"></span>
|
||||
</div>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown.min.js"></script>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown-{$lang_iso}.js"></script>
|
||||
<script type="text/javascript">{literal}
|
||||
var endstring = "{/literal}{$sale->date_end}{literal}";
|
||||
var enddate = endstring.split(' ')[0].split('-');
|
||||
var endtime = endstring.split(' ')[1].split(':');
|
||||
var endofsale = new Date(enddate[0], enddate[1]-1, enddate[2], endtime[0], endtime[1], endtime[2]);
|
||||
$('#countdown').countdown({serverSync:function(){var d = new Date({/literal}{$smarty.now|date_format:'%Y, '}{$smarty.now|date_format:'%-m'} - 1{$smarty.now|date_format:', %-d, %-H, %-M, %-S'}{literal}); return d;}, until: endofsale, layout: '{d<}{dn} {dl} {d>} {hn} {hl}'});
|
||||
{/literal}</script>
|
||||
{if $consumable}
|
||||
<div id="sale_end" class="consumable"></div>
|
||||
{else}
|
||||
<div id="sale_end">
|
||||
{l s='This sale ends in' mod='privatesales_countdown'} <span id="countdown"></span>
|
||||
</div>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown.min.js"></script>
|
||||
<script type="text/javascript" src="{$base_dir_ssl}modules/privatesales_countdown/js/jquery.countdown-{$lang_iso}.js"></script>
|
||||
<script type="text/javascript">{literal}
|
||||
var endstring = "{/literal}{$sale->date_end}{literal}";
|
||||
var enddate = endstring.split(' ')[0].split('-');
|
||||
var endtime = endstring.split(' ')[1].split(':');
|
||||
var endofsale = new Date(enddate[0], enddate[1]-1, enddate[2], endtime[0], endtime[1], endtime[2]);
|
||||
$('#countdown').countdown({serverSync:function(){var d = new Date({/literal}{$smarty.now|date_format:'%Y, '}{$smarty.now|date_format:'%-m'} - 1{$smarty.now|date_format:', %-d, %-H, %-M, %-S'}{literal}); return d;}, until: endofsale, layout: '{d<}{dn} {dl} {d>} {hn} {hl}'});
|
||||
{/literal}</script>
|
||||
{/if}
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user