Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
djfm
2013-11-04 16:58:17 +00:00
476 changed files with 13337 additions and 10621 deletions
+233
View File
@@ -0,0 +1,233 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
class AddShareThis extends Module
{
public function __construct()
{
$this->name = 'addsharethis';
$this->author = 'Custom';
$this->tab = 'front_office_features';
$this->need_instance = 0;
$this->_directory = dirname(__FILE__);
parent::__construct();
$this->displayName = $this->l('Add Sharethis');
$this->description = $this->l('Display social count button on the home page');
}
public function install()
{
return (
parent::install() &&
$this->registerHook('Extraright') &&
$this->registerHook('header') &&
$this->registerHook('actionObjectProductUpdateAfter') &&
$this->registerHook('actionObjectProductDeleteAfter') &&
$this->registerHook('actionObjectProductAddAfter') &&
Configuration::updateValue('CONF_ROW', 'ea22d519-9f98-4018-99a9-5b5f1b100fa8') &&
Configuration::updateValue('ADDTHISSHARE_TWITTER', 1) &&
Configuration::updateValue('ADDTHISSHARE_GOOGLE', 1) &&
Configuration::updateValue('ADDTHISSHARE_PINTEREST', 1) &&
Configuration::updateValue('ADDTHISSHARE_FACEBOOK', 1)
);
}
public function uninstall()
{
return (
parent::uninstall() &&
Configuration::deleteByName('CONF_ROW') &&
Configuration::deleteByName('ADDTHISSHARE_TWITTER') &&
Configuration::deleteByName('ADDTHISSHARE_GOOGLE') &&
Configuration::deleteByName('ADDTHISSHARE_PINTEREST') &&
Configuration::deleteByName('ADDTHISSHARE_FACEBOOK') &&
$this->unregisterHook('Extraright') &&
$this->unregisterHook('header')
);
}
public function getContent()
{
$this->_html .= '<h2>'.$this->displayName.'<span style=" float:right;"></span></h2><div class="clear"></div>';
if (Tools::isSubmit('submitCog'))
{
$this->updateCog();
Configuration::updateValue('CONF_ROW', Tools::getValue('conf_row'));
}
$this->_html .= '
<fieldset class="space" id="cogField">
<legend><img src="'.$this->_path.'logo.png" alt="" title="" /> '.$this->l('Configuration').'</legend>
<form id="cogForm" name="cogForm" method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<br/>
<em>'.$this->l('(Key in your account statistic http://sharethis.com)').'</em>
<div class="clearfix"></div><br/><br/>
<label>'.$this->l('Publisher Pub Key:').'</label>
<div class="margin-form">
<input type="text" name="conf_row" value="1" id="conf_row" size="60" value="'.Tools::safeOutput(Tools::getValue('conf_row', Configuration::get('CONF_ROW'))).'" />
</div><br/><br/>
<div class="margin-form">
<input style="margin:-8px 20px 0 0;" value="1" type="checkbox" name="Twitter" id="Twitter"'.(Configuration::get('ADDTHISSHARE_TWITTER') ? ' checked="checked"' : '').' />
<img src="'.$this->_path.'img/twitter.gif" />
</div>
<div class="margin-form">
<input style="margin:-8px 20px 0 0;" value="1" type="checkbox" name="Google" id="Google"'.(Configuration::get('ADDTHISSHARE_GOOGLE') ? ' checked="checked"' : '').' />
<img src="'.$this->_path.'img/google.gif" />
</div>
<div class="margin-form">
<input style="margin:-8px 20px 0 0;" value="1" type="checkbox" name="Pinterest" id="Pinterest" '.(Configuration::get('ADDTHISSHARE_PINTEREST') ? ' checked="checked"' : '').' />
<img src="'.$this->_path.'img/pinterest.gif" />
</div>
<div class="margin-form">
<input style="margin:-8px 20px 0 0;" value="1" type="checkbox" name="Facebook" id="Facebook"'.(Configuration::get('ADDTHISSHARE_FACEBOOK') ? ' checked="checked"' : '').' />
<img src="'.$this->_path.'img/facebook.gif" />
</div>
<br/><br/><div class="margin-form">
<input type="submit" class="button" name="submitCog" id="submitCog" value="'.$this->l('Save').'" />
</div>
</form>
</fieldset>';
return $this->_html;
}
public function updateCog()
{
Configuration::updateValue('ADDTHISSHARE_TWITTER', (int)Tools::getValue('Twitter'));
Configuration::updateValue('ADDTHISSHARE_GOOGLE', (int)Tools::getValue('Google'));
Configuration::updateValue('ADDTHISSHARE_PINTEREST', (int)Tools::getValue('Pinterest'));
Configuration::updateValue('ADDTHISSHARE_FACEBOOK', (int)Tools::getValue('Facebook'));
$this->_clearCache('addsharethis.tpl');
}
public function hookDisplayHeader($params)
{
if ($this->context->controller->php_self != 'product')
return;
$product = $this->context->controller->getProduct();
$cache_id = 'addsharethis_header|'.(int)$product->id.'|'.(int)Tools::usingSecureMode().'|'.(int)$this->context->shop->id.'|'.(int)$this->context->language->id;
if (!$this->isCached('addsharethis_header.tpl', $cache_id))
{
$id_lang = (int)$this->context->language->id;
$images = $product->getImages((int)$id_lang);
foreach ($images AS $k => $image)
if ($image['cover'])
{
$cover['id_image'] = (int)$product->id.'-'.(int)$image['id_image'];
$cover['legend'] = $image['legend'];
break;
}
if (!isset($cover))
$cover = array('id_image' => Language::getIsoById((int)$id_lang).'-default', 'legend' => 'No picture');
$this->context->smarty->assign(array(
'cover' => $cover,
'product' => $product,
'this_path' => $this->_path
)
);
}
return $this->display(__FILE__, 'addsharethis_header.tpl', $cache_id);
}
public function hookExtraRight($params)
{
$cache_id = 'addsharethis_content|'.(int)$this->context->shop->id;
if (!$this->isCached('addsharethis.tpl', $cache_id))
{
if (Configuration::get('ADDTHISSHARE_TWITTER'))
$data['twitter'] = '<span class="st_twitter_hcount sharebtn" displayText="Tweet"></span>';
if (Configuration::get('ADDTHISSHARE_GOOGLE'))
$data['google'] = '<span class="st_googleplus_hcount" displayText="Google +"></span>';
if (Configuration::get('ADDTHISSHARE_PINTEREST'))
$data['pinterest'] = '<span class="st_pinterest_hcount sharebtn" displayText="Pinterest"></span>';
if (Configuration::get('ADDTHISSHARE_FACEBOOK'))
$data['facebook'] = '<span class="st_facebook_hcount sharebtn" displayText="Facebook"></span>';
$this->context->smarty->assign(array(
'addsharethis_data' => $data,
'conf_row' => Configuration::get('CONF_ROW')
)
);
}
return $this->display(__FILE__, 'addsharethis.tpl', $cache_id);
}
public function hookLeftColumn($params)
{
return $this->hookExtraRight($params);
}
public function hookFooter($params)
{
return $this->hookExtraRight($params);
}
public function hookHome($params)
{
return $this->hookExtraRight($params);
}
public function hookExtraleft($params)
{
return $this->hookExtraRight($params);
}
public function hookProductActions($params)
{
return $this->hookExtraRight($params);
}
public function hookProductFooter($params)
{
return $this->hookExtraRight($params);
}
public function hookActionObjectProductUpdateAfter($params)
{
return $this->_clearCache('addsharethis_header.tpl', 'addsharethis_header|'.(int)$params['object']->id);
}
public function hookActionObjectProductDeleteAfter($params)
{
return $this->hookActionObjectProductUpdateAfter($params);
}
public function hookActionObjectProductAddAfter($params)
{
return $this->hookActionObjectProductUpdateAfter($params);
}
}
+25
View File
@@ -0,0 +1,25 @@
<link rel="stylesheet" type="text/css" href="{$module_dir}css/addsharethis.css"/>
{if isset($addsharethis_data)}
<div id="ShareDiv" class="addsharethis">
<div class="addsharethisinner">
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
{literal}
<script type="text/javascript">stLight.options({publisher: "{/literal}{$conf_row}{literal}", nativeCount:true });</script>
{/literal}
{if isset($addsharethis_data.twitter)}
{$addsharethis_data.twitter}
{/if}
{if isset($addsharethis_data.google)}
{$addsharethis_data.google}
{/if}
{if isset($addsharethis_data.pinterest)}
{$addsharethis_data.pinterest}
{/if}
{if isset($addsharethis_data.facebook)}
{$addsharethis_data.facebook}
{/if}
</div>
</div>
{/if}
@@ -0,0 +1,2 @@
<meta property="og:image" content="{$link->getImageLink($product->link_rewrite, $cover.id_image, large_default)}" />
+36
View File
@@ -0,0 +1,36 @@
<link rel="stylesheet" type="text/css" href="{$module_dir}css/addsharethis.css"/>
{if isset($addsharethis_data)}
<div class="addsharethis topaddsharethis">
<div class="addsharethisinner">
{if isset($addsharethis_data.twitter)}
{$addsharethis_data.twitter}
{/if}
{if isset($addsharethis_data.google)}
{$addsharethis_data.google}
{/if}
{if isset($addsharethis_data.pinterest)}
{$addsharethis_data.pinterest}
{/if}
{if isset($addsharethis_data.facebook)}
{$addsharethis_data.facebook}
{/if}
</div>
</div>
{/if}
<script type="text/javascript">
$(function(){
$(".addsharethis").addClass("loader");
$(window).load(function() {
$(".addsharethis").removeClass("loader");
$(".addsharethisinner").show(400);
});
});
$(function(){
$(".addsharethis .sharebtn").click(function(){
$(this).find("img").show("medium");
})
});
</script>
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">{literal}stLight.options({publisher: "{/literal}{$conf_row}{literal}", doNotHash: false, doNotCopy: false, hashAddressBar: false});{/literal}</script>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>addsharethis</name>
<displayName><![CDATA[Add Sharethis]]></displayName>
<version><![CDATA[]]></version>
<description><![CDATA[Display social count button on the home page]]></description>
<author><![CDATA[Custom]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>
@@ -0,0 +1,6 @@
.topaddsharethis{ position:absolute; right:-170px; top:160px; width:150px;}
.stButton .stFb, .stButton .stTwbutton, .stButton .stMainServices, .stButton .stButton_gradient {height:22px !important;}
.stButton .stButton_gradient:hover {background: -moz-linear-gradient(center top , #D5D5D5 0px, #EFEFEF 48%, #FFFFFF 94%) repeat scroll 0 0 transparent!important;}
.stButton .chicklets:hover{ opacity:1!important;}
.stButton{ margin-bottom:15px;}
.addsharethis .stButton:hover{ opacity:0.6;}
View File
+4
View File
@@ -0,0 +1,4 @@
<?php
global $_MODULE;
$_MODULE = array();
View File
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File
+18 -12
View File
@@ -131,6 +131,9 @@ var ajaxCart = {
success: function(jsonData)
{
ajaxCart.updateCart(jsonData);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
},
@@ -175,7 +178,7 @@ var ajaxCart = {
},
// add a product in the cart via ajax
add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist){
add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){
if (addedFromProductPage && !checkCustomizations())
{
alert(fieldRequired);
@@ -204,9 +207,9 @@ var ajaxCart = {
data: 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''),
success: function(jsonData,textStatus,jqXHR)
{
// add appliance to whishlist module
if (whishlist && !jsonData.errors)
WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]);
// add appliance to wishlist module
if (wishlist && !jsonData.errors)
WishlistAddProductCart(wishlist[0], idProduct, idCombination, wishlist[1]);
// add the picture to the cart
var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
@@ -341,7 +344,7 @@ var ajaxCart = {
// If the cart is now empty, show the 'no product in the cart' message and close detail
if($('#cart_block dl.products dt').length == 0)
{
$("#cart_block").stop(true, true).slideUp(200);
$("#header #cart_block").stop(true, true).slideUp(200);
$('#cart_block_no_products:hidden').slideDown(450);
$('#cart_block dl.products').remove();
}
@@ -719,25 +722,25 @@ $(document).ready(function()
cart_qty = parseInt($('.ajax_cart_quantity').html());
/* roll over cart */
var cart_block = new HoverWatcher('#cart_block');
var cart_block = new HoverWatcher('#header #cart_block');
var shopping_cart = new HoverWatcher('#shopping_cart');
$("#shopping_cart a:first").hover(
function() {
$(this).css('border-radius', '3px 3px 0px 0px');
if (ajaxCart.nb_total_products > 0 || cart_qty > 0)
$("#header_right #cart_block").stop(true, true).slideDown(450);
$("#header #cart_block").stop(true, true).slideDown(450);
},
function() {
$('#shopping_cart a').css('border-radius', '3px');
setTimeout(function() {
if (!shopping_cart.isHoveringOver() && !cart_block.isHoveringOver())
$("#header_right #cart_block").stop(true, true).slideUp(450);
$("#header #cart_block").stop(true, true).slideUp(450);
}, 200);
}
);
$("#header_right #cart_block").hover(
$("#header #cart_block").hover(
function() {
$('#shopping_cart a').css('border-radius', '3px 3px 0px 0px');
},
@@ -745,7 +748,7 @@ $(document).ready(function()
$('#shopping_cart a').css('border-radius', '3px');
setTimeout(function() {
if (!shopping_cart.isHoveringOver())
$("#header_right #cart_block").stop(true, true).slideUp(450);
$("#header #cart_block").stop(true, true).slideUp(450);
}, 200);
}
);
@@ -756,7 +759,10 @@ $(document).ready(function()
headers: { "cache-control": "no-cache" },
async: true,
cache: false,
url:$(this).attr('href') + '?rand=' + new Date().getTime()
url:$(this).attr('href') + '?rand=' + new Date().getTime(),
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
$(this).parent().parent().remove();
if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc')
@@ -825,4 +831,4 @@ function crossselling_serialScroll()
force:false
});
$('#blockcart_list').trigger('goto', 0);
}
}
+57 -56
View File
@@ -33,7 +33,7 @@ class BlockCategories extends Module
{
$this->name = 'blockcategories';
$this->tab = 'front_office_features';
$this->version = '2.1';
$this->version = '2.2';
$this->author = 'PrestaShop';
parent::__construct();
@@ -107,11 +107,16 @@ class BlockCategories extends Module
if (isset($resultParents[$id_category]) && count($resultParents[$id_category]) && ($maxDepth == 0 || $currentDepth < $maxDepth))
foreach ($resultParents[$id_category] as $subcat)
$children[] = $this->getTree($resultParents, $resultIds, $maxDepth, $subcat['id_category'], $currentDepth + 1);
if (!isset($resultIds[$id_category]))
return false;
$return = array('id' => $id_category, 'link' => $this->context->link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']),
'name' => $resultIds[$id_category]['name'], 'desc'=> $resultIds[$id_category]['description'],
'children' => $children);
$return = array(
'id' => $id_category,
'link' => $this->context->link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']),
'name' => $resultIds[$id_category]['name'],
'desc'=> $resultIds[$id_category]['description'],
'children' => $children
);
return $return;
}
@@ -181,86 +186,82 @@ class BlockCategories extends Module
}
public function hookLeftColumn($params)
{
if (!$this->isCached('blockcategories.tpl', $this->getCacheId()))
{
$category = false;
if (method_exists($this->context->controller, 'getCategory') && ($category = $this->context->controller->getCategory()))
$this->context->cookie->last_visited_category = $category->id;
elseif (method_exists($this->context->controller, 'getProduct') && ($product = $this->context->controller->getProduct()))
{
// Get all groups for this customer and concatenate them as a string: "1,2,3..."
$groups = implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id));
if (!isset($this->context->cookie->last_visited_category)
|| !Product::idIsOnCategoryId($product->id, array(array('id_category' => $this->context->cookie->last_visited_category)))
|| !Category::inShopStatic($this->context->cookie->last_visited_category, $this->context->shop))
$this->context->cookie->last_visited_category = (int)$product->id_category_default;
$category = new Category($this->context->cookie->last_visited_category, $this->context->language->id);
}
$cacheId = $this->getCacheId($category ? $category->id : null);
if (!$this->isCached('blockcategories.tpl', $cacheId))
{
$range = '';
$maxdepth = Configuration::get('BLOCK_CATEG_MAX_DEPTH');
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite
FROM `'._DB_PREFIX_.'category` c
INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->context->language->id.Shop::addSqlRestrictionOnLang('cl').')
INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)$this->context->shop->id.')
WHERE (c.`active` = 1 OR c.`id_category` = '.(int)Configuration::get('PS_HOME_CATEGORY').')
AND c.`id_category` != '.(int)Configuration::get('PS_ROOT_CATEGORY').'
'.((int)$maxdepth != 0 ? ' AND `level_depth` <= '.(int)$maxdepth : '').'
AND c.id_category IN (SELECT id_category FROM `'._DB_PREFIX_.'category_group` WHERE `id_group` IN ('.pSQL($groups).'))
ORDER BY `level_depth` ASC, '.(Configuration::get('BLOCK_CATEG_SORT') ? 'cl.`name`' : 'cs.`position`').' '.(Configuration::get('BLOCK_CATEG_SORT_WAY') ? 'DESC' : 'ASC')))
return;
if ($category)
{
if ($maxdepth > 0)
$maxdepth += $category->level_depth;
$range = 'AND nleft >= '.$category->nleft.' AND nright <= '.$category->nright;
}
$resultParents = array();
$resultIds = array();
$resultParents = array();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite
FROM `'._DB_PREFIX_.'category` c
INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->context->language->id.Shop::addSqlRestrictionOnLang('cl').')
INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)$this->context->shop->id.')
WHERE (c.`active` = 1 OR c.`id_category` = '.(int)Configuration::get('PS_HOME_CATEGORY').')
AND c.`id_category` != '.(int)Configuration::get('PS_ROOT_CATEGORY').'
'.((int)$maxdepth != 0 ? ' AND `level_depth` <= '.(int)$maxdepth : '').'
'.$range.'
AND c.id_category IN (
SELECT id_category
FROM `'._DB_PREFIX_.'category_group`
WHERE `id_group` IN ('.pSQL(implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id))).')
)
ORDER BY `level_depth` ASC, '.(Configuration::get('BLOCK_CATEG_SORT') ? 'cl.`name`' : 'cs.`position`').' '.(Configuration::get('BLOCK_CATEG_SORT_WAY') ? 'DESC' : 'ASC'));
foreach ($result as &$row)
{
$resultParents[$row['id_parent']][] = &$row;
$resultIds[$row['id_category']] = &$row;
}
$blockCategTree = $this->getTree($resultParents, $resultIds, Configuration::get('BLOCK_CATEG_MAX_DEPTH'));
unset($resultParents, $resultIds);
$id_category = (int)Tools::getValue('id_category');
$id_product = (int)Tools::getValue('id_product');
$isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false);
if (Tools::isSubmit('id_category'))
{
$this->context->cookie->last_visited_category = $id_category;
$this->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
}
if (Tools::isSubmit('id_product'))
{
if (!isset($this->context->cookie->last_visited_category)
|| !Product::idIsOnCategoryId($id_product, array('0' => array('id_category' => $this->context->cookie->last_visited_category)))
|| !Category::inShopStatic($this->context->cookie->last_visited_category, $this->context->shop))
{
$product = new Product($id_product);
if (isset($product) && Validate::isLoadedObject($product))
$this->context->cookie->last_visited_category = (int)$product->id_category_default;
}
$this->smarty->assign('currentCategoryId', (int)$this->context->cookie->last_visited_category);
}
$blockCategTree = $this->getTree($resultParents, $resultIds, $maxdepth, ($category ? $category->id : null));
$this->smarty->assign('blockCategTree', $blockCategTree);
if ($category)
$this->smarty->assign(array('currentCategory' => $category, 'currentCategoryId' => $category->id));
$this->smarty->assign('isDhtml', Configuration::get('BLOCK_CATEG_DHTML'));
if (file_exists(_PS_THEME_DIR_.'modules/blockcategories/blockcategories.tpl'))
$this->smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl');
else
$this->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
$this->smarty->assign('isDhtml', $isDhtml);
}
$display = $this->display(__FILE__, 'blockcategories.tpl', $this->getCacheId());
return $display;
return $this->display(__FILE__, 'blockcategories.tpl', $cacheId);
}
protected function getCacheId($name = null)
{
parent::getCacheId($name);
$groups = implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id));
$id_product = (int)Tools::getValue('id_product', 0);
$id_category = (int)Tools::getValue('id_category', 0);
$id_lang = (int)$this->context->language->id;
return 'blockcategories|'.(int)Tools::usingSecureMode().'|'.$this->context->shop->id.'|'.$groups.'|'.$id_lang.'|'.$id_product.'|'.$id_category;
$name = ($name ? $name.'|' : '').implode('-', Customer::getGroupsStatic($this->context->customer->id));
return parent::getCacheId($name);
}
public function hookFooter($params)
{
// Get all groups for this customer and concatenate them as a string: "1,2,3..."
if (!$this->isCached('blockcategories_footer.tpl', $this->getCacheId()))
{
$maxdepth = Configuration::get('BLOCK_CATEG_MAX_DEPTH');
// Get all groups for this customer and concatenate them as a string: "1,2,3..."
$groups = implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id));
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite
+3 -1
View File
@@ -24,8 +24,9 @@
*}
<!-- Block categories module -->
{if $blockCategTree && $blockCategTree.children|@count}
<div id="categories_block_left" class="block">
<h4 class="title_block">{l s='Categories' mod='blockcategories'}</h4>
<h4 class="title_block">{if isset($currentCategory)}{$currentCategory->name|escape}{else}{l s='Categories' mod='blockcategories'}{/if}</h4>
<div class="block_content">
<ul class="tree {if $isDhtml}dhtml{/if}">
{foreach from=$blockCategTree.children item=child name=blockCategTree}
@@ -45,4 +46,5 @@
</script>
</div>
</div>
{/if}
<!-- /Block categories module -->
+3 -3
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blockcategories</name>
<displayName><![CDATA[Bloc cat&eacute;gories]]></displayName>
<version><![CDATA[2.1]]></version>
<description><![CDATA[Ajoute un bloc proposant une navigation au sein de vos cat&eacute;gories de produits]]></description>
<displayName><![CDATA[Categories block]]></displayName>
<version><![CDATA[2.2]]></version>
<description><![CDATA[Adds a block featuring product categories.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
+7 -3
View File
@@ -364,15 +364,20 @@ class BlockCMSModel extends ObjectModel
return Db::getInstance()->executeS($sql);
}
public static function getCMSBlockPages($id_block)
public static function getCMSBlockPages($id_block, $id_shop = false)
{
$id_shop = ($id_shop !== false) ? $id_shop : Context::getContext()->shop->id;
$sql = 'SELECT cl.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
FROM `'._DB_PREFIX_.'cms_block_page` bcp
INNER JOIN `'._DB_PREFIX_.'cms_lang` cl
ON (bcp.`id_cms` = cl.`id_cms`)
INNER JOIN `'._DB_PREFIX_.'cms` c
ON (bcp.`id_cms` = c.`id_cms`)
INNER JOIN `'._DB_PREFIX_.'cms_shop` cs
ON (c.`id_cms` = cs.`id_cms`)
WHERE bcp.`id_cms_block` = '.(int)$id_block.'
AND cs.`id_shop` = '.(int)$id_shop.'
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
AND bcp.`is_category` = 0
AND c.`active` = 1
@@ -534,8 +539,7 @@ class BlockCMSModel extends ObjectModel
{
$key = (int)$cmsCategory['id_cms_block'];
$content[$key]['display_store'] = $cmsCategory['display_store'];
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block']);
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block'], $id_shop);
$links = array();
if (count($content[$key]['cms']))
{
-1
View File
@@ -3167,7 +3167,6 @@ class BlockLayered extends Module
$smarty->assign($filter_block);
$smarty->assign('hide_0_values', Configuration::get('PS_LAYERED_HIDE_0_VALUES'));
return $this->display(__FILE__, 'blocklayered.tpl');
}
else
@@ -89,12 +89,13 @@ class BlockNewProducts extends Module
{
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
{
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
if (!Configuration::get('NEW_PRODUCTS_NBR'))
return;
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR'));
if (!$newProducts)
$newProducts = false;
if (Configuration::get('PS_NB_DAYS_NEW_PRODUCT'))
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'));
if (!$newProducts && !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
return;
$this->smarty->assign(array(
'new_products' => $newProducts,
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
@@ -144,7 +145,7 @@ class BlockNewProducts extends Module
{
$this->_clearCache('blocknewproducts.tpl');
}
public function renderForm()
{
$fields_form = array(
@@ -1,15 +0,0 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -1,54 +0,0 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -1,19 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span><strong>
<?php echo t('Thank you for subscribing to our newsletter.'); ?>
</strong></span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,20 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<?php echo t('Thank you for subscribing to our newsletter, please confirm your request by clicking the link below :'); ?><br/>
<span><strong><a href="{verif_url}">{verif_url}</a></strong></span>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,22 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Newsletter subscription'); ?>
</p>
<span>
<?php echo t('Regarding your newsletter subscription, we are pleased to offer you the following voucher:'); ?> <span><strong>{discount}</strong></span>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
+133
View File
@@ -0,0 +1,133 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
class Blockquickview extends Module
{
public function __construct()
{
$this->name = 'blockquickview';
$this->tab = 'front_office_features';
$this->version = '1.0';
parent::__construct();
$this->displayName = $this->l('Quick view');
$this->description = $this->l('Add Quick information about product.');
}
public function install()
{
Configuration::updateValue('PS_QUICK_VIEW',1);
if (!parent::install())
return false;
return true;
}
public function uninstall()
{
if (!parent::uninstall() OR
!Configuration::deleteByName('PS_QUICK_VIEW'))
return false;
else return true;
}
public function getContent()
{
$html = '';
// If we try to update the settings
if (Tools::isSubmit('submitModule'))
{
Configuration::updateValue('PS_QUICK_VIEW', Tools::getValue('PS_QUICK_VIEW'));
$html .= $this->displayConfirmation($this->l('Configuration updated'));
}
$html .= $this->renderForm();
return $html;
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Display Quick view'),
'name' => 'PS_QUICK_VIEW',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-primary')
),
);
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$this->fields_form = array();
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitModule';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = array(
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
return $helper->generateForm(array($fields_form));
}
public function getConfigFieldsValues()
{
return array(
'PS_QUICK_VIEW' => Tools::getValue('PS_QUICK_VIEW', Configuration::get('PS_QUICK_VIEW')),
);
}
}
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blockquickview</name>
<displayName><![CDATA[Quick view]]></displayName>
<version><![CDATA[1.0]]></version>
<description><![CDATA[Add Quick information about product.]]></description>
<author><![CDATA[]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>
+35
View File
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA␍
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../');
exit;
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
+2 -2
View File
@@ -29,7 +29,7 @@
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
</form>
</div>
{else}
@@ -41,7 +41,7 @@
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
</p>
</form>
+1 -1
View File
@@ -32,7 +32,7 @@
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
<input type="submit" id="search_button" class="button_mini" value="{l s='Go!' mod='blocksearch'}" />
</p>
</form>
+3 -2
View File
@@ -19,7 +19,8 @@
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA␍
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
@@ -63,7 +64,7 @@ class blocksharefb extends Module
if (isset($id_product) && $id_product != '')
{
$product_infos = new Product((int)$id_product, true, $cookie->id_lang);
$product_infos = $this->context->controller->getProduct();
$smarty->assign(array(
'product_link' => urlencode($link->getProductLink($product_infos)),
'product_title' => urlencode($product_infos->name),
+1 -1
View File
@@ -99,7 +99,7 @@ class BlockSpecials extends Module
));
}
return $this->display(__FILE__, 'blockspecials.tpl', $this->getCacheId('blockspecials|'.$random));
return $this->display(__FILE__, 'blockspecials.tpl', (Configuration::get('BLOCKSPECIALS_NB_CACHES') ? $this->getCacheId('blockspecials|'.$random) : null));
}
public function hookLeftColumn($params)
@@ -1,15 +0,0 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -1,54 +0,0 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -1,23 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Message from {shop_name}'); ?>
</p>
<span>
<?php echo t('<span><strong>{shop_name}</strong></span> invites you to send this link to your friends, so they can see your wishlist:'); ?> <span><strong>{wishlist}</strong></span><br /><br />
<a title="WishList" href="{message}">{message}</a>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,23 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Message from {shop_name}'); ?>
</p>
<span>
<?php echo t('<span><strong>{firstname} {lastname}</strong></span> indicated you may want to see his/her wishlist:'); ?> <span><strong>{wishlist}</strong></span><br /><br />
<a title="WishList" href="{message}">{wishlist}</a>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
+5
View File
@@ -68,6 +68,11 @@ if ($context->customer->isLogged())
$combination_imgs = $obj->getCombinationImages($context->language->id);
if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
else
{
$cover = Product::getCover($obj->id);
$products[$i]['cover'] = $obj->id.'-'.$cover['id_image'];
}
}
else
{
+5
View File
@@ -62,6 +62,11 @@ if (empty($token) === false)
$combination_imgs = $obj->getCombinationImages($context->language->id);
if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
else
{
$cover = Product::getCover($obj->id);
$products[$i]['cover'] = $obj->id.'-'.$cover['id_image'];
}
}
else
{
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
@@ -0,0 +1,37 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/list/list_content.tpl"}
{block name="td_content"}
{if isset($params.type) && $params.type == 'priority'}
<span class="label label-default">{$priority[$tr.$key]}</span>
{elseif isset($params.type) && $params.type == 'image'}
<img src="{$tr.$key}"/>
{else}
{$smarty.block.parent}
{/if}
{/block}
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
+2 -1
View File
@@ -99,6 +99,7 @@ class CrossSelling extends Module
{
$this->context->controller->addCSS(($this->_path).'crossselling.css', 'all');
$this->context->controller->addJS(($this->_path).'js/crossselling.js');
$this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll'));
}
/**
@@ -303,4 +304,4 @@ class CrossSelling extends Module
'CROSSSELLING_DISPLAY_PRICE' => Tools::getValue('CROSSSELLING_DISPLAY_PRICE', Configuration::get('CROSSSELLING_DISPLAY_PRICE')),
);
}
}
}
+8 -13
View File
@@ -123,14 +123,14 @@ class Dashactivity extends Module
$sql = 'SELECT COUNT(DISTINCT c.id_connections)
FROM `'._DB_PREFIX_.'connections` c
LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections
WHERE TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900
WHERE TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 1800
AND cp.`time_end` IS NULL
'.Shop::addSqlRestriction(false, 'c').'
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '');
else
$sql = 'SELECT COUNT(*)
FROM `'._DB_PREFIX_.'connections`
WHERE TIME_TO_SEC(TIMEDIFF(NOW(), `date_add`)) < 900
WHERE TIME_TO_SEC(TIMEDIFF(NOW(), `date_add`)) < 1800
'.Shop::addSqlRestriction(false).'
'.($maintenance_ips ? 'AND ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '');
$online_visitor = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
@@ -145,7 +145,7 @@ class Dashactivity extends Module
$abandoned_cart = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'cart`
WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
WHERE `date_upd` BETWEEN "'.pSQL(date('Y-m-d H:i:s', strtotime('-2 DAY'))).'" AND "'.pSQL(date('Y-m-d H:i:s', strtotime('-1 DAY'))).'"
AND id_cart NOT IN (SELECT id_cart FROM `'._DB_PREFIX_.'orders`)
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
@@ -157,18 +157,13 @@ class Dashactivity extends Module
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o'));
$products_out_of_stock = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
SELECT SUM(IF(IFNULL(stock.quantity, 0) > 0, 0, 1))
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
'.Product::sqlStock('p').'
WHERE IFNULL(stock.quantity, 0) <= 0');
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON p.id_product = pa.id_product
'.Product::sqlStock('p', 'pa'));
$new_messages = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'customer_thread` ct
LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON ct.id_customer_thread = cm.id_customer_thread
WHERE cm.`date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
'.Shop::addSqlRestriction(false, 'ct'));
$new_messages = AdminStatsController::getPendingMessages();
$active_shopping_cart = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
@@ -278,7 +273,7 @@ class Dashactivity extends Module
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT http_referer
FROM '._DB_PREFIX_.'connections
WHERE date_add BETWEEN '.$date_from.' AND '.$date_to.'
WHERE date_add BETWEEN "'.$date_from.'" AND "'.$date_to.'"
'.Shop::addSqlRestriction().'
LIMIT '.(int)$limit);
foreach ($result as $row)
+9 -1
View File
@@ -183,10 +183,18 @@ class Dashproducts extends Module
continue;
$category = new Category($product_obj->getDefaultCategory(), $this->context->language->id);
$img = '';
if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image'])
{
$image = new Image($row_image['id_image']);
$path_to_image = _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$this->context->controller->imageType;
$img = ImageManager::thumbnail($path_to_image, 'product_mini_'.$product_obj->id.'.'.$this->context->controller->imageType, 45, $this->context->controller->imageType);
}
$body[] = array(
array(
'id' => 'product',
'value' => '<img src="'._PS_TMP_IMG_.'product_mini_'.$product['product_id'].'.jpg'.'" />',
'value' => $img,
'class' => 'text-center'
),
array(
+2 -2
View File
@@ -200,8 +200,8 @@ class DateOfDelivery extends Module
$id_carrier = (int)OrderInvoice::getCarrierId($order_invoice->id);
$return = '';
if ($datesDelivery = $this->_getDatesOfDelivery($id_carrier, $oos, $order_invoice->date_add))
$return = sprintf($this->l('Approximate date of delivery is between %1$s and %2$s'), $datesDelivery[0], $datesDelivery[1]);
if (($datesDelivery = $this->_getDatesOfDelivery($id_carrier, $oos, $order_invoice->date_add)) && isset($datesDelivery[0][0]) && isset($datesDelivery[1][0]))
$return = sprintf($this->l('Approximate date of delivery is between %1$s and %2$s'), $datesDelivery[0][0], $datesDelivery[1][0]);
return $return;
}
+5 -2
View File
@@ -26,6 +26,9 @@
include(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
if (!Module::getInstanceByName('feeder')->active)
exit;
// Get data
$number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10);
$orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby'));
@@ -64,7 +67,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
if (is_array($image) AND sizeof($image))
{
$imageObj = new Image($image[0]['id_image']);
echo "<![CDATA[<img src='"._PS_BASE_URL_._THEME_PROD_DIR_.$imageObj->getExistingImgPath()."-small_default.jpg' title='".str_replace('&', '', $product['name'])."' alt='thumb' />";
echo "<![CDATA[<img src='".$link->getImageLink($product['link_rewrite'], $image[0]['id_image'], 'small_default')."' title='".str_replace('&', '', $product['name'])."' alt='thumb' />";
$cdata = false;
}
if ($cdata)
@@ -76,4 +79,4 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
}
?>
</channel>
</rss>
</rss>
@@ -1,38 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {firstname} {lastname},'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Your cart at {shop_name}'); ?>
</p>
<span>
<?php echo t('We noticed that during your last visit on {shop_name}, you did not complete the order you had started.'); ?><br /> <br />
<?php echo t('Your cart has been saved, you can resume your order by visiting our shop:'); ?> <span><strong><a title="{shop_name}" href="{shop_url}">{shop_url}</a></strong></span><br /><br />
<?php echo t('As an incentive, we can give you a discount of {amount}% off your next order! This offer is valid for <span><strong>{days}</strong></span> days, so do not waste a moment!'); ?>
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Your {shop_name} login details'); ?>
</p>
<span>
<span><strong><?php echo t('Here is your coupon:'); ?></strong></span> {voucher_num}<br />
<?php echo t('Enter this code in your shopping cart to get your discount.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,22 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {firstname} {lastname},'); ?></span><br/>
<span class="subtitle"><?php echo t('Thank you for your order at {shop_name}.'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<?php echo t('As our way of saying thanks, we want to give you a discount of <span><strong>{amount}</strong></span>% off your next order! This offer is valid for <span><strong>{days}</strong></span> days, so do not waste a moment!'); ?><br /> <br />
<span><strong><?php echo t('Here is your coupon:'); ?></strong></span> {voucher_num}<br /><br />
<?php echo t('Enter this code in your shopping cart to get your discount.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,25 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {firstname} {lastname},'); ?></span><br/>
<span class="subtitle"><?php echo t('Thanks for your trust.'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('You are one of our best customers and as such we want to thank you for your continued patronage.'); ?>
</p>
<span>
<?php echo t('As appreciation for your loyalty, we want to give you a discount of <span><strong>{amount}</strong></span>% valid on your next order! This offer is valid for <span><strong>{days}</strong></span> days, so do not waste a moment!'); ?><br /> <br />
<span><strong><?php echo t('Here is your coupon:'); ?></strong></span> {voucher_num}<br /><br />
<?php echo t('Enter this code in your shopping cart to get your discount.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,35 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {firstname} {lastname},'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Your cart at {shop_name}'); ?>
</p>
<span>
<?php echo t('You are one of our best customers, however you have not placed an order in {days_threshold} days.'); ?><br /> <br />
<?php echo t('Your cart has been saved, you can resume your order by visiting our shop:'); ?> <span><strong><a title="{shop_name}" href="{shop_url}">{shop_url}</a></strong></span><br /><br />
<?php echo t('We wish to thank you for the trust you have placed in us and want to give you a discount of {amount}% valid on your next order! This offer is valid for <span><strong>{days}</strong></span> days, so do not waste a moment!'); ?>
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<span><strong><?php echo t('Here is your coupon:'); ?></strong></span> {voucher_num}<br /><br />
<?php echo t('Enter this code in your shopping cart to get your discount.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
-15
View File
@@ -1,15 +0,0 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
-54
View File
@@ -1,54 +0,0 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
+35
View File
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
@@ -0,0 +1,32 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/form/form.tpl"}
{block name="field"}
{if $input.type == 'desc'}
<div class="alert alert-info">{$input.text}</div>
{/if}
{$smarty.block.parent}
{/block}
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
@@ -0,0 +1,71 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="panel" id="fieldset_4">
<h3><i class="icon-bar-chart"></i> {l s="Statistics"}</h3>
<p>{l s="Detailed statistics for last 30 days:"}</p>
<p style="font-size: 10px; font-weight: bold;">
{l s="S = Number of sent e-mails"}<br />
{l s="U = Number of discounts used (valid orders only)"}<br />
{l s="% = Conversion rate"}
</p>
<table class="table">
<tr>
<th rowspan="2" style="width: 75px;">{l s="Date"}</th>
<th colspan="3">{l s="Cancelled carts"}</th>
<th colspan="3">{l s="Re-order"}</th>
<th colspan="3">{l s="Best cust."}</th>
<th colspan="3">{l s="Bad cust."}</th>
</tr>
<tr>
<td class="center">{l s="S"}</td>
<td class="center">{l s="U"}</td>
<td class="center">%</td>
<td class="center">{l s="S"}</td>
<td class="center">{l s="U"}</td>
<td class="center">%</td>
<td class="center">{l s="S"}</td>
<td class="center">{l s="U"}</td>
<td class="center">%</td>
<td class="center">{l s="S"}</td>
<td class="center">{l s="U"}</td>
<td class="center">%</td>
</tr>
{foreach from=$stats_array key='date' item='stats'}
<tr>
<td class="center">{$date}</td>
{foreach from=$stats key='key' item='val'}
<td class="center">{$val.nb}</td>
<td class="center">{$val.nb_used}</td>
<td class="center">{$val.rate}</td>
{/foreach}
</tr>
{foreachelse}
<tr>
<td colspan="13" style="font-weight: bold; text-align: center;">{l s="No statistics at this time."}</td>
</tr>
{/foreach}
</table>
</div>
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

+1 -1
View File
@@ -101,7 +101,7 @@ class GridHtml extends ModuleGridEngine
$.each(values, function(index, row){
var newLine = "<tr>";';
foreach ($params['columns'] as $column)
$html .= ' newLine += "<td'.(isset($column['align']) ? ' class=\"'.$column['align'].'\"' : '').'>" + row["'.$column['dataIndex'].'"] + "</td>";';
$html .= ' newLine += "<td'.(isset($column['align']) ? ' align=\"'.$column['align'].'\"' : '').'>" + row["'.$column['dataIndex'].'"] + "</td>";';
if (!isset($params['defaultSortColumn']))
$params['defaultSortColumn'] = false;
if (!isset($params['defaultSortDirection']))
+258 -6
View File
@@ -183,7 +183,6 @@ class HomeSlider extends Module
public function getContent()
{
$this->_html .= $this->headerHTML();
$this->_html .= '<h2>'.$this->displayName.'.</h2>';
/* Validate & process */
if (Tools::isSubmit('submitSlide') || Tools::isSubmit('delete_id_slide') ||
@@ -191,14 +190,24 @@ class HomeSlider extends Module
Tools::isSubmit('changeStatus'))
{
if ($this->_postValidation())
{
$this->_postProcess();
$this->_displayForm();
$this->_html .= $this->renderForm();
$this->_html .= $this->renderList();
}
else
$this->_html .= $this->renderAddForm();
}
elseif (Tools::isSubmit('addSlide') || (Tools::isSubmit('id_slide') && $this->slideExists((int)Tools::getValue('id_slide'))))
$this->_displayAddForm();
$this->_html .= $this->renderAddForm();
else
$this->_displayForm();
{
$this->_html .= $this->renderForm();
$this->_html .= $this->renderList();
}
return $this->_html;
}
@@ -456,6 +465,8 @@ class HomeSlider extends Module
/* If edit : checks id_slide */
if (Tools::isSubmit('id_slide'))
{
//d(var_dump(Tools::getValue('id_slide')));
if (!Validate::isInt(Tools::getValue('id_slide')) && !$this->slideExists(Tools::getValue('id_slide')))
$errors[] = $this->l('Invalid id_slide');
}
@@ -705,7 +716,7 @@ class HomeSlider extends Module
cursor: "move",
update: function() {
var order = $(this).sortable("serialize") + "&action=updateSlidesPosition";
$.post("'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order);
$.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order);
}
});
$mySlides.hover(function() {
@@ -774,4 +785,245 @@ class HomeSlider extends Module
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($req);
return ($row);
}
public function renderList()
{
$slides = $this->getSlides();
foreach ($slides as $key => $slide)
$slides[$key]['status'] = $this->displayStatus($slide['id_slide'], $slide['active']);
$this->context->smarty->assign(array(
'link' => $this->context->link,
'slides' => $slides,
));
return $this->display(__FILE__, 'list.tpl');
}
public function renderAddForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Slide informations'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'file_lang',
'label' => $this->l('Select a file:'),
'name' => 'image',
'lang' => true,
),
array(
'type' => 'text',
'label' => $this->l('Title:'),
'name' => 'title',
'lang' => true,
),
array(
'type' => 'text',
'label' => $this->l('URL:'),
'name' => 'url',
'lang' => true,
),
array(
'type' => 'text',
'label' => $this->l('Legend:'),
'name' => 'legend',
'lang' => true,
),
array(
'type' => 'textarea',
'label' => $this->l('Description:'),
'name' => 'description',
'lang' => true,
),
array(
'type' => 'switch',
'label' => $this->l('Active'),
'name' => 'active_slide',
'is_bool' => true,
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Yes')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('No')
)
),
),
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-default')
),
);
if (Tools::isSubmit('id_slide') && $this->slideExists((int)Tools::getValue('id_slide')))
{
$slide = new HomeSlide((int)Tools::getValue('id_slide'));
$fields_form['form']['input'][] = array('type' => 'hidden', 'name' => 'id_slide');
$has_picture = true;
foreach (Language::getLanguages(false) as $lang)
if (!isset($slide->image[$lang['id_lang']]))
$has_picture &= false;
if ($has_picture)
$fields_form['form']['input'][] = array('type' => 'hidden', 'name' => 'has_picture');
}
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$this->fields_form = array();
$helper->module = $this;
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitSlide';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->tpl_vars = array(
'base_url' => $this->context->shop->getBaseURL(),
'language' => array(
'id_lang' => $language->id,
'iso_code' => $language->iso_code
),
'fields_value' => $this->getAddFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
$helper->override_folder = '/';
return $helper->generateForm(array($fields_form));
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Height:'),
'name' => 'HOMESLIDER_HEIGHT',
'suffix' => 'px'
),
array(
'type' => 'text',
'label' => $this->l('Width:'),
'name' => 'HOMESLIDER_WIDTH',
'suffix' => 'px'
),
array(
'type' => 'text',
'label' => $this->l('Speed:'),
'name' => 'HOMESLIDER_SPEED',
'suffix' => 'ms'
),
array(
'type' => 'text',
'label' => $this->l('Pause:'),
'name' => 'HOMESLIDER_PAUSE',
'suffix' => 'ms'
),
array(
'type' => 'switch',
'label' => $this->l('Loop:'),
'name' => 'HOMESLIDER_LOOP',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
)
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-default')
),
);
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$this->fields_form = array();
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitSlider';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = array(
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
return $helper->generateForm(array($fields_form));
}
public function getConfigFieldsValues()
{
return array(
'HOMESLIDER_HEIGHT' => Tools::getValue('HOMESLIDER_HEIGHT', Configuration::get('HOMESLIDER_HEIGHT')),
'HOMESLIDER_WIDTH' => Tools::getValue('HOMESLIDER_WIDTH', Configuration::get('HOMESLIDER_WIDTH')),
'HOMESLIDER_SPEED' => Tools::getValue('HOMESLIDER_SPEED', Configuration::get('HOMESLIDER_SPEED')),
'HOMESLIDER_PAUSE' => Tools::getValue('HOMESLIDER_PAUSE', Configuration::get('HOMESLIDER_PAUSE')),
'HOMESLIDER_LOOP' => Tools::getValue('HOMESLIDER_LOOP', Configuration::get('HOMESLIDER_LOOP')),
);
}
public function getAddFieldsValues()
{
$fields = array();
if (Tools::isSubmit('id_slide') && $this->slideExists((int)Tools::getValue('id_slide')))
{
$slide = new HomeSlide((int)Tools::getValue('id_slide'));
$fields['id_slide'] = (int)Tools::getValue('id_slide', $slide->id);
}
else
$slide = new HomeSlide();
$fields['active_slide'] = Tools::getValue('active_slide', $slide->active);
$fields['has_picture'] = true;
$languages = Language::getLanguages(false);
foreach ($languages as $lang)
{
$fields['image'][$lang['id_lang']] = Tools::getValue('image_'.(int)$lang['id_lang']);
$fields['title'][$lang['id_lang']] = Tools::getValue('title_'.(int)$lang['id_lang'], $slide->title[$lang['id_lang']]);
$fields['url'][$lang['id_lang']] = Tools::getValue('url_'.(int)$lang['id_lang'], $slide->url[$lang['id_lang']]);
$fields['legend'][$lang['id_lang']] = Tools::getValue('legend_'.(int)$lang['id_lang'], $slide->legend[$lang['id_lang']]);
$fields['description'][$lang['id_lang']] = Tools::getValue('description_'.(int)$lang['id_lang'], $slide->description[$lang['id_lang']]);
}
return $fields;
}
}
+35
View File
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../../');
exit;
@@ -0,0 +1,78 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/form/form.tpl"}
{block name="field"}
{if $input.type == 'file_lang'}
<div class="row">
{foreach from=$languages item=language}
{if $languages|count > 1}
<div class="translatable-field lang-{$language.id_lang}" {if $language.id_lang != $defaultFormLanguage}style="display:none"{/if}>
{/if}
<div class="col-lg-6">
<input id="{$input.name}_{$language.id_lang}" type="file" name="{$input.name}_{$language.id_lang}" class="hide" />
<div class="dummyfile input-group">
<span class="input-group-addon"><i class="icon-file"></i></span>
<input id="{$input.name}_{$language.id_lang}-name" type="text" class="disabled" name="filename" readonly />
<span class="input-group-btn">
<button id="{$input.name}_{$language.id_lang}-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
<i class="icon-folder-open"></i> {l s='Choose a file'}
</button>
</span>
</div>
</div>
{if $languages|count > 1}
<div class="col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" tabindex="-1" data-toggle="dropdown">
{$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=lang}
<li><a href="javascript:hideOtherLanguage({$lang.id_lang});" tabindex="-1">{$lang.name}</a></li>
{/foreach}
</ul>
</div>
{/if}
{if $languages|count > 1}
</div>
{/if}
<script>
$(document).ready(function(){
$('#{$input.name}_{$language.id_lang}-selectbutton').click(function(e){
$('#{$input.name}_{$language.id_lang}').trigger('click');
});
$('#{$input.name}_{$language.id_lang}').change(function(e){
var val = $(this).val();
var file = val.split(/[\\/]/);
$('#{$input.name}_{$language.id_lang}-name').val(file[file.length-1]);
});
});
</script>
{/foreach}
</div>
{/if}
{$smarty.block.parent}
{/block}
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../../../../');
exit;
@@ -0,0 +1,50 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<fieldset>
<div class="panel-heading">
<i class="icon-list-ul"></i> {l s='Slides list'}
<span class="panel-heading-action">
<a id="desc-product-new" class="list-toolbar-btn" href="{$link->getAdminLink('AdminModules')}&configure=homeslider&addSlide=1">
<label><span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="Add new" data-html="true"><i class="process-icon-new "></i></span></label>
</a>
</span>
</div>
<div id="slidesContent" style="width: 400px; margin-top: 30px;">
<ul id="slides">
{foreach from=$slides item=slide}
<li id="slides_{$slide.id_slide}">
<strong>#{$slide.id_slide}</strong> {$slide.title}
<p style="float: right">
{$slide.status}
<a class="btn btn-primary" href="{$link->getAdminLink('AdminModules')}&configure=homeslider&id_slide={$slide.id_slide}"> {l s='Edit'}</a>
<a class="btn btn-danger" href="{$link->getAdminLink('AdminModules')}&configure=homeslider&delete_id_slide={$slide.id_slide}"> {l s='Delete'}</a>
</p>
</li>
{/foreach}
</ul>
</div>
</fieldset>
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../../../');
exit;
+3 -1
View File
@@ -88,7 +88,9 @@ class LoyaltyModule extends ObjectModel
$currentContext = Context::getContext();
$context = clone $currentContext;
$context->cart = $cart;
$context->customer = new Customer($context->cart->id_customer);
// if customer is logged we do not recreate it
if(!$context->customer->isLogged(true))
$context->customer = new Customer($context->cart->id_customer);
$context->language = new Language($context->cart->id_lang);
$context->shop = new Shop($context->cart->id_shop);
$context->currency = new Currency($context->cart->id_currency, null, $context->shop->id);
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>mailalerts</name>
<displayName><![CDATA[Mail alerts]]></displayName>
<version><![CDATA[2.5]]></version>
<version><![CDATA[2.7]]></version>
<description><![CDATA[Sends e-mail notifications to customers and merchants.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
+28 -9
View File
@@ -46,7 +46,7 @@ class MailAlerts extends Module
{
$this->name = 'mailalerts';
$this->tab = 'administration';
$this->version = '2.5';
$this->version = '2.7';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -194,6 +194,21 @@ class MailAlerts extends Module
$this->init();
}
public function getAllMessages($id)
{
$messages = Db::getInstance()->executeS('
SELECT `message`
FROM `'._DB_PREFIX_.'message`
WHERE `id_order` = '.(int)$id.'
ORDER BY `id_message` ASC
');
$result = array();
foreach ($messages as $message) {
$result[] = $message['message'];
}
return implode('<br/>', $result);
}
public function hookActionValidateOrder($params)
{
if (!$this->_merchant_order || empty($this->_merchant_mails))
@@ -209,9 +224,9 @@ class MailAlerts extends Module
$configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME', 'PS_MAIL_COLOR'), $id_lang, null, $id_shop);
$delivery = new Address((int)$order->id_address_delivery);
$invoice = new Address((int)$order->id_address_invoice);
$order_date_text = Tools::displayDate($order->date_add, (int)$id_lang);
$order_date_text = Tools::displayDate($order->date_add);
$carrier = new Carrier((int)$order->id_carrier);
$message = $order->getFirstMessage();
$message = $this->getAllMessages($order->id);
if (!$message || empty($message))
$message = $this->l('No message');
@@ -315,6 +330,7 @@ class MailAlerts extends Module
'{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency),
'{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency),
'{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency),
'{currency}' => $currency->sign,
'{message}' => $message
@@ -374,16 +390,20 @@ class MailAlerts extends Module
public function hookActionUpdateQuantity($params)
{
$id_product = (int)$params['id_product'];
$product = new Product($id_product);
$product_has_attributes = $product->hasAttributes();
$id_product_attribute = (int)$params['id_product_attribute'];
$quantity = (int)$params['quantity'];
$context = Context::getContext();
$id_shop = (int)$context->shop->id;
$id_lang = (int)$context->language->id;
$product = new Product($id_product, true, $id_lang, $id_shop, $context);
$configuration = Configuration::getMultiple(array('MA_LAST_QTIES', 'PS_STOCK_MANAGEMENT', 'PS_SHOP_EMAIL', 'PS_SHOP_NAME'), $id_lang, null, $id_shop);
$configuration = Configuration::getMultiple(array('MA_LAST_QTIES', 'PS_STOCK_MANAGEMENT', 'PS_SHOP_EMAIL', 'PS_SHOP_NAME'), null, null, $id_shop);
$ma_last_qties = (int)$configuration['MA_LAST_QTIES'];
if ($product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && $configuration['PS_STOCK_MANAGEMENT'])
$check_oos = ($product_has_attributes && $id_product_attribute) || (!$product_has_attributes && !$id_product_attribute);
if ($check_oos && $product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && $configuration['PS_STOCK_MANAGEMENT'])
{
$iso = Language::getIsoById($id_lang);
$product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);
@@ -662,8 +682,7 @@ class MailAlerts extends Module
'type' => 'textarea',
'label' => $this->l('E-mail addresses:'),
'name' => 'MA_MERCHANT_MAILS',
'desc' => $this->l('One e-mail address per line (e.g. bob@example.com)
'),
'desc' => $this->l('One e-mail address per line (e.g. bob@example.com)'),
),
),
'submit' => array(
@@ -707,4 +726,4 @@ class MailAlerts extends Module
'MA_MERCHANT_MAILS' => Tools::getValue('MA_MERCHANT_MAILS', Configuration::get('MA_MERCHANT_MAILS')),
);
}
}
}
@@ -1,24 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('{product} is now available.'); ?>
</p>
<span>
<?php echo t('This item is once again in-stock.'); ?><br /><br />
<?php echo t('You can access the product page by clicking on the link:'); ?> <span><strong><a href="{product_link}">{product}</a></strong></span><br />
<?php echo t('You can order it right now from our online shop.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,15 +0,0 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -1,54 +0,0 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -1,125 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Congratulations!'); ?></span>
</td>
</tr>
<tr>
<td>
<span><?php echo t('A new order was placed on {shop_name} from the following customer: {firstname} {lastname} ({email})'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box" colspan="3">
<p>
<?php echo t('Order details'); ?>
</p>
<span>
<span><strong><?php echo t('Order:'); ?></strong></span> {order_name} <?php echo t('Placed on'); ?> {date}<br /><br />
<span><strong><?php echo t('Payment:'); ?></strong></span> {payment}
</span>
</td>
</tr>
<tr>
<td>
<table class="table table-recap" bgcolor="#ffffff"><!-- Title -->
<thead>
<tr>
<th><?php echo t('Reference'); ?></th>
<th width="30%"><?php echo t('Product'); ?></th>
<th><?php echo t('Unit price'); ?></th>
<th><?php echo t('Quantity'); ?></th>
<th><?php echo t('Total price'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5">
{items}
</td>
</tr>
<tr class="conf_body">
<td bgcolor="#fbfbfb" align="right" colspan="4"><strong><?php echo t('Products'); ?></strong></td>
<td bgcolor="#fbfbfb" align="right">{total_products}</td>
</tr>
<tr class="conf_body">
<td bgcolor="#fbfbfb" align="right" colspan="4"><strong><?php echo t('Discounts'); ?></strong></td>
<td bgcolor="#fbfbfb" align="right">{total_discounts}</td>
</tr>
<tr class="conf_body">
<td bgcolor="#fbfbfb" align="right" colspan="4"><strong><?php echo t('Gift-wrapping'); ?></strong></td>
<td bgcolor="#fbfbfb" align="right">{total_wrapping}</td>
</tr>
<tr class="conf_body">
<td bgcolor="#fbfbfb" align="right" colspan="4"><strong><?php echo t('Shipping'); ?></strong></td>
<td bgcolor="#fbfbfb" align="right">{total_shipping}</td>
</tr>
<tr class="conf_body">
<td bgcolor="#fbfbfb" align="right" colspan="4"><strong><?php echo t('Total Tax paid'); ?></strong></td>
<td bgcolor="#fbfbfb" align="right">{total_tax_paid}</td>
</tr>
<tr class="conf_body">
<td bgcolor="#fbfbfb" align="right" colspan="4" class="total"><strong><?php echo t('Total paid'); ?></strong></td>
<td bgcolor="#fbfbfb" align="right" class="total_amount">{total_paid}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="box" colspan="3">
<p>
<?php echo t('Carrier:'); ?>
</p>
<span>
{carrier}
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<table class="table">
<tr>
<td class="box" width="310">
<p>
<?php echo t('Delivery address'); ?>
</p>
<span>
{delivery_block_html}
</span>
</td>
<td width="20">&nbsp;</td>
<td class="box" width="310">
<p>
<?php echo t('Billing address'); ?>
</p>
<span>
{invoice_block_html}
</span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box" colspan="3">
<p>
<?php echo t('Customer message:'); ?>
</p>
<span>
{message}
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,23 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('{product} is almost out of stock.'); ?>
</p>
<span>
<?php echo t('The stock cover is now less than the specified minimum of:'); ?> <strong><span>{warning_coverage}.</span></strong><br /><br />
<strong><span><?php echo t('Current stock cover:'); ?></span></strong> {current_coverage}
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,24 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi,'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('{product} is nearly out of stock.'); ?>
</p>
<span>
<?php echo t('The remaining stock is now less than the specified minimum of'); ?> <strong><span>{last_qty}.</span></strong><br /><br />
<strong><span><?php echo t('Remaining stock:'); ?></span></strong> {qty}<br/><br/>
<?php echo t('You are advised to open the product&#039;s admin Product Page in order to replenish your inventory.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
+2 -2
View File
@@ -561,7 +561,7 @@ class ProductComments extends Module
<div class="margin-form">
">
<select name="id_product_comment_criterion" id="id_product_comment_criterion" onchange="window.location=\''.Tools::safeOutput($this->_baseUrl).'&updateCriterion=\'+$(\'#id_product_comment_criterion option:selected\').val()">
<option value="--">-- '.$this->l('Choose a criterion').' --</option>';
<option value="-">- '.$this->l('Choose a criterion').' -</option>';
foreach ($criterions as $foo)
$this->_html .= '<option value="'.(int)($foo['id_product_comment_criterion']).'" '.($foo['id_product_comment_criterion'] == $id_criterion ? 'selected="selected"' : '').'>'.$foo['name'].'</option>';
$this->_html .= '</select>
@@ -705,7 +705,7 @@ class ProductComments extends Module
$this->context->smarty->assign(array(
'id_product_comment_form' => (int)Tools::getValue('id_product'),
'product' => new Product((int)Tools::getValue('id_product'), false, $this->context->language->id),
'product' => $this->context->controller->getProduct(),
'secure_key' => $this->secure_key,
'logged' => (int)$this->context->customer->isLogged(true),
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
@@ -174,7 +174,7 @@ class productsCategory extends Module
{
$this->context->controller->addCSS($this->_path.'productscategory.css', 'all');
$this->context->controller->addJS($this->_path.'productscategory.js');
$this->context->controller->addJqueryPlugin('serialScroll');
$this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll'));
}
public function hookAddProduct($params)
@@ -23,7 +23,7 @@
* International Registered Trademark & Property of PrestaShop SA
*}
{if count($categoryProducts) > 0 && $categoryProducts !== false}
{if isset($categoryProducts) && count($categoryProducts) > 0 && $categoryProducts !== false}
<div class="clearfix blockproductscategory">
<h2 class="productscategory_h2">{$categoryProducts|@count} {l s='other products in the same category:' mod='productscategory'}</h2>
<div id="{if count($categoryProducts) > 5}productscategory{else}productscategory_noscroll{/if}">
+9 -5
View File
@@ -117,7 +117,7 @@ class PSCleaner extends Module
// Remove inexisting or monolanguage configuration value from configuration_lang
$query = 'DELETE FROM `'._DB_PREFIX_.'configuration_lang`
WHERE `id_configuration` NOT IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration`)
OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NOT NULL AND name != "")';
OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NULL OR name = "")';
if ($db->Execute($query))
if ($affected_rows = $db->Affected_Rows())
$logs[$query] = $affected_rows;
@@ -266,8 +266,6 @@ class PSCleaner extends Module
array('stock', 'id_warehouse', 'warehouse', 'id_warehouse'),
array('stock', 'id_product', 'product', 'id_product'),
array('stock_available', 'id_product', 'product', 'id_product'),
array('stock_available', 'id_shop', 'shop', 'id_shop'),
array('stock_available', 'id_shop_group', 'shop_group', 'id_shop_group'),
array('stock_mvt', 'id_stock', 'stock', 'id_stock'),
array('tab_module_preference', 'id_employee', 'employee', 'id_employee'),
array('tab_module_preference', 'id_tab', 'tab', 'id_tab'),
@@ -333,7 +331,13 @@ class PSCleaner extends Module
if ($affected_rows = $db->Affected_Rows())
$logs[$query] = $affected_rows;
}
// stock_available
$query = 'DELETE FROM `'._DB_PREFIX_.'stock_available` WHERE `id_shop` NOT IN (SELECT `id_shop` FROM `'._DB_PREFIX_.'shop`) AND `id_shop_group` NOT IN (SELECT `id_shop_group` FROM `'._DB_PREFIX_.'shop_group`)';
if ($db->Execute($query))
if ($affected_rows = $db->Affected_Rows())
$logs[$query] = $affected_rows;
Category::regenerateEntireNtree();
// @Todo: Remove attachment files, images...
@@ -605,4 +609,4 @@ class PSCleaner extends Module
{
return array('value' => '');
}
}
}
@@ -183,6 +183,8 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController
if ((int)($stats['nb_orders']) >= $orderQuantity)
$canSendInvitations = true;
$discountInPercent = Tools::getValue('discount_type', Configuration::get('REFERRAL_DISCOUNT_TYPE')) == 1;
// Smarty display
$this->context->smarty->assign(array(
@@ -199,7 +201,7 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController
'nbRevive' => $nbRevive,
'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($this->context->customer->id), 'subscribed'),
'mails_exists' => (isset($mails_exists) ? $mails_exists : array()),
'currencySign' => $this->context->currency->sign
'currencySign' => ($discountInPercent ? '%' : $this->context->currency->sign)
));
$this->setTemplate('program.tpl');
}
@@ -1,15 +0,0 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -1,54 +0,0 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -1,28 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Congratulations!'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<?php echo t('Your referred friend,'); ?> <span><strong>{sponsored_firstname} {sponsored_lastname}</strong></span> <?php echo t('has placed his or her first order on <a href="{shop_url}">{shop_name}</a>!'); ?><br /><br />
<?php echo t('We are pleased to offer you a voucher worth'); ?> <span><strong>{discount_display} (voucher # {discount_name})</strong></span> <?php echo t('that you can use on your next order.'); ?>
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<span><?php echo t('Best regards,'); ?></span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,31 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title">{firstname_friend} {lastname_friend}, <?php echo t('join us!'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<?php echo t('Your friend,'); ?> <span><strong>{firstname} {lastname}</strong></span> <?php echo t('wants to refer you on <a href="{shop_url}">{shop_name}</a>!'); ?><br /><br />
<?php echo t('We are pleased to offer you a voucher worth'); ?> <span><strong>{discount_display} (voucher # {discount_name})</strong></span> <?php echo t('that you can use on your next order.'); ?><br /><br />
<?php echo t('Get referred and earn a discount voucher of'); ?> <span><strong>{discount}!</strong></span>
<a title="Register" href="{link}"><?php echo t('It&#039;s very easy to sign up. Just click here!'); ?></a>
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<span><?php echo t('When signing up, don&#039;t forget to provide the e-mail address of your referring friend:'); ?> <span><strong>{email}</strong></span>.<br/><br/>
<span><?php echo t('Best regards,'); ?>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,24 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {firstname} {lastname},'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Referral Program'); ?>
</p>
<span>
<?php echo t('We have created a voucher in your name for referring a friend.'); ?><br />
<?php echo t('Here is the code of your voucher:'); ?> <span><strong>{voucher_num}</strong></span><?php echo t(', with an amount of'); ?> <span><strong>{voucher_amount}</strong></span>.<br /><br />
<?php echo t('Simply copy/paste this code during the payment process for your next order.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -1,15 +0,0 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -1,54 +0,0 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -1,23 +0,0 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {name},'); ?></span><br/>
<span class="subtitle"><?php echo t('Thank you for creating a customer account at {shop_name}.'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
{customer} <?php echo t('has sent you a link to a product that (s)he thinks may interest you.'); ?>
</p>
<span>
<?php echo t('Click here to view this item:'); ?> <a href="{product_link}">{product}</a>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -57,7 +57,7 @@ class StatsBestCategories extends ModuleGrid
'id' => 'name',
'header' => $this->l('Name'),
'dataIndex' => 'name',
'align' => 'center'
'align' => 'left'
),
array(
'id' => 'totalQuantitySold',
@@ -69,7 +69,7 @@ class StatsBestCategories extends ModuleGrid
'id' => 'totalPriceSold',
'header' => $this->l('Total Price'),
'dataIndex' => 'totalPriceSold',
'align' => 'center'
'align' => 'right'
),
array(
'id' => 'totalPageViewed',
@@ -105,7 +105,7 @@ class StatsBestCategories extends ModuleGrid
$this->_html = '
<div class="panel-heading">
'.$this->displayName.'
<i class="icon-sitemap"></i> '.$this->displayName.'
</div>
'.$this->engine($engineParams).'
<a class="btn btn-default export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1">
@@ -116,6 +116,7 @@ class StatsBestCategories extends ModuleGrid
public function getData()
{
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$dateBetween = $this->getDate();
$id_lang = $this->getLang();
@@ -197,7 +198,10 @@ class StatsBestCategories extends ModuleGrid
}
if (($this->_start === 0 || Validate::IsUnsignedInt($this->_start)) && Validate::IsUnsignedInt($this->_limit))
$this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit);
$this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query);
$values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query);
foreach ($values as &$value)
$value['totalPriceSold'] = Tools::displayPrice($value['totalPriceSold'], $currency);
$this->_values = $values;
$this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()');
}
}
@@ -57,13 +57,13 @@ class StatsBestProducts extends ModuleGrid
'id' => 'reference',
'header' => $this->l('Ref.'),
'dataIndex' => 'reference',
'align' => 'center'
'align' => 'left'
),
array(
'id' => 'name',
'header' => $this->l('Name'),
'dataIndex' => 'name',
'align' => 'center'
'align' => 'left'
),
array(
'id' => 'totalQuantitySold',
@@ -75,13 +75,13 @@ class StatsBestProducts extends ModuleGrid
'id' => 'avgPriceSold',
'header' => $this->l('Price sold'),
'dataIndex' => 'avgPriceSold',
'align' => 'center'
'align' => 'right'
),
array(
'id' => 'totalPriceSold',
'header' => $this->l('Sales'),
'dataIndex' => 'totalPriceSold',
'align' => 'center'
'align' => 'right'
),
array(
'id' => 'averageQuantitySold',
@@ -103,7 +103,7 @@ class StatsBestProducts extends ModuleGrid
)
);
$this->displayName = $this->l('Best-selling products.');
$this->displayName = $this->l('Best-selling products');
$this->description = $this->l('A list of the best-selling products.');
}
@@ -140,6 +140,7 @@ class StatsBestProducts extends ModuleGrid
public function getData()
{
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$dateBetween = $this->getDate();
$arrayDateBetween = explode(' AND ', $dateBetween);
@@ -178,7 +179,13 @@ class StatsBestProducts extends ModuleGrid
if (($this->_start === 0 || Validate::IsUnsignedInt($this->_start)) && Validate::IsUnsignedInt($this->_limit))
$this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit);
$this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query);
$values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query);
foreach ($values as &$value)
{
$value['avgPriceSold'] = Tools::displayPrice($value['avgPriceSold'], $currency);
$value['totalPriceSold'] = Tools::displayPrice($value['totalPriceSold'], $currency);
}
$this->_values = $values;
$this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()');
}
}

Some files were not shown because too many files have changed in this diff Show More