On rajoute encore quelques modules

This commit is contained in:
2020-10-13 14:58:11 +02:00
parent c513c15cdc
commit 25cb197711
201 changed files with 22431 additions and 27 deletions

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ppbrandslider</name>
<displayName><![CDATA[Brand Logo Slider]]></displayName>
<version><![CDATA[1.0.0]]></version>
<description><![CDATA[This module add a gallery or slider with Brand Logos in your shop, with link on the image to directly go to manufacturer&#039;s page.]]></description>
<author><![CDATA[Presta Patron]]></author>
<tab><![CDATA[advertising_marketing]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,33 @@
<?php
/*
* 2007-2017 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-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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: 14 KiB

View File

@@ -0,0 +1,389 @@
<?php
/**
* 2007-2015 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 PrestaPatron
* @copyright 2017-2019 Presta Patron
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class Ppbrandslider extends Module {
public function __construct() {
$this->name = 'ppbrandslider';
$this->tab = 'advertising_marketing';
$this->version = '1.0.0';
$this->author = 'Presta Patron';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.7.0.0', 'max' => _PS_VERSION_);
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Brand Logo Slider');
$this->description = $this->l('This module add a gallery or slider with Brand Logos in your shop, with link on the image to directly go to manufacturer\'s page.');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
}
public function install(){
if (Shop::isFeatureActive()) {
Shop::setContext(Shop::CONTEXT_ALL);
}
$slidersettings = $this->getModulesliderSettings();
foreach ($slidersettings as $name => $value) {
Configuration::updateValue($name, $value);
}
return parent::install() &&
$this->registerHook('displayHome') &&
$this->registerHook('displayAfterProductThumbs') &&
$this->registerHook('displayProductListReviews') &&
$this->registerHook('header');
}
public function uninstall() {
$slidersettings = $this->getModulesliderSettings();
foreach (array_keys($slidersettings) as $name) {
Configuration::deleteByName($name);
}
// All went well!
return parent::uninstall();
}
protected function getModulesliderSettings() {
$slidersettings = array(
'ENABLE_BRAND_SLIDER' => 1,
'VISIBLE_ITEMS' => '4',
'SCROLL_ITEMS' => '1',
'ANIMATION_SPEED' => '1500',
'AUTOPLAY_SLIDER' => 1,
'SHOW_ARROWS' => 1,
'MOUSE_HOVER' => 1,
);
return $slidersettings;
}
public function getContent() {
return $this->renderForm();
}
public function renderForm() {
// Get default language
$default_lang = (int)Configuration::get('PS_LANG_DEFAULT');
$this->processConfiguration();
$this->assignConfiguration();
$fields_form = null;
// Init Fields form array
$fields_form[0]['form'] = array(
'legend' => array(
'title' => $this->l('Brand Logo SLider Settings'),
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Enable Brand Slider:'),
'hint' => $this->l('Enable to add logo slider on home page'),
'name' => 'ENABLE_BRAND_SLIDER',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'text',
'label' => $this->l('Visible Items:'),
'hint' => $this->l('The number of visible Items'),
'class' => 'sm',
'name' => 'VISIBLE_ITEMS',
),
array(
'type' => 'text',
'label' => $this->l('Scroll Items:'),
'hint' => $this->l('The number of scroll Items'),
'class' => 'sm',
'name' => 'SCROLL_ITEMS',
),
array(
'type' => 'text',
'label' => $this->l('Animation Speed:'),
'hint' => $this->l('The speed of animation'),
'class' => 'sm',
'name' => 'ANIMATION_SPEED',
),
array(
'type' => 'switch',
'label' => $this->l('Autoplay Slider:'),
'hint' => $this->l('Autoplay Slider'),
'name' => 'AUTOPLAY_SLIDER',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'switch',
'label' => $this->l('Show Arrows:'),
'hint' => $this->l('The left/right arrows will be added to the slider.'),
'name' => 'SHOW_ARROWS',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'switch',
'label' => $this->l('Pause on Mouse Hover:'),
'hint' => $this->l('Show slider on left or right column on category pages.'),
'name' => 'MOUSE_HOVER',
'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 pull-right'
)
);
$helper = new HelperForm();
// Module, token and currentIndex
$helper->module = $this;
$helper->name_controller = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
// Language
$helper->default_form_language = $default_lang;
$helper->allow_employee_form_lang = $default_lang;
// Title and toolbar
$helper->title = $this->displayName;
$helper->show_toolbar = true; // false -> remove toolbar
$helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen.
$helper->submit_action = 'submit'.$this->name;
$helper->toolbar_btn = array(
'save' =>
array(
'desc' => $this->l('Save'),
'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.
'&token='.Tools::getAdminTokenLite('AdminModules'),
),
'back' => array(
'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'),
'desc' => $this->l('Back to list')
)
);
// Load current value
$helper->fields_value['ENABLE_BRAND_SLIDER'] = Configuration::get('ENABLE_BRAND_SLIDER');
$helper->fields_value['VISIBLE_ITEMS'] = Configuration::get('VISIBLE_ITEMS');
$helper->fields_value['SCROLL_ITEMS'] = Configuration::get('SCROLL_ITEMS');
$helper->fields_value['ANIMATION_SPEED'] = Configuration::get('ANIMATION_SPEED');
$helper->fields_value['AUTOPLAY_SLIDER'] = Configuration::get('AUTOPLAY_SLIDER');
$helper->fields_value['SHOW_ARROWS'] = Configuration::get('SHOW_ARROWS');
$helper->fields_value['MOUSE_HOVER'] = Configuration::get('MOUSE_HOVER');
return $helper->generateForm($fields_form);
}
public function processConfiguration(){
$output = null;
if (Tools::isSubmit('submit'.$this->name)) {
$enable_brand_slider = Tools::getValue('ENABLE_BRAND_SLIDER');
Configuration::updateValue('ENABLE_BRAND_SLIDER', $enable_brand_slider);
$visible_items = Tools::getValue('VISIBLE_ITEMS');
Configuration::updateValue('VISIBLE_ITEMS', $visible_items);
$scroll_items = Tools::getValue('SCROLL_ITEMS');
Configuration::updateValue('SCROLL_ITEMS', $scroll_items);
$animation_speed = Tools::getValue('ANIMATION_SPEED');
Configuration::updateValue('ANIMATION_SPEED', $animation_speed);
$autoplay_slider = Tools::getValue('AUTOPLAY_SLIDER');
Configuration::updateValue('AUTOPLAY_SLIDER', $autoplay_slider);
$show_arrows = Tools::getValue('SHOW_ARROWS');
Configuration::updateValue('SHOW_ARROWS', $show_arrows);
$mouse_hover = Tools::getValue('MOUSE_HOVER');
Configuration::updateValue('MOUSE_HOVER', $mouse_hover);
$output .= $this->displayConfirmation($this->l(' Settings Updated'));
}
}
public function assignConfiguration() {
$enable_brand_slider = Configuration::get('ENABLE_BRAND_SLIDER');
$this->context->smarty->assign('enable_brand_slider', $enable_brand_slider);
$visible_items = Configuration::get('VISIBLE_ITEMS');
$this->context->smarty->assign('visible_items', $visible_items);
$scroll_items = Configuration::get('SCROLL_ITEMS');
$this->context->smarty->assign('scroll_items', $scroll_items);
$animation_speed = Configuration::get('ANIMATION_SPEED');
$this->context->smarty->assign('animation_speed', $animation_speed);
$autoplay_slider = Configuration::get('AUTOPLAY_SLIDER');
$this->context->smarty->assign('autoplay_slider', $autoplay_slider);
$show_arrows = Configuration::get('SHOW_ARROWS');
$this->context->smarty->assign('show_arrows', $show_arrows);
$mouse_hover = Configuration::get('MOUSE_HOVER');
$this->context->smarty->assign('mouse_hover', $mouse_hover);
Media::addJsDef(array(
'visible_items' => $visible_items,
'scroll_items' => $scroll_items,
'animation_speed' => $animation_speed,
'autoplay_slider' => $autoplay_slider,
'show_arrows' => $show_arrows,
'mouse_hover' => $mouse_hover,
));
}
public function hookDisplayHeader() {
$this->context->controller->addCSS($this->_path.'views/css/ppbrandslider.css');
$this->context->controller->addJS($this->_path.'views/js/jquery.flexisel.js');
$this->context->controller->addJS($this->_path.'views/js/ppbrandslider.js');
}
public function hookDisplayHome($params) {
$this->processConfiguration();
$this->assignConfiguration();
$this->smarty->assign(array(
'manufacturers' => Manufacturer::getManufacturers(),
'link' => $this->context->link,
));
return $this->display(__FILE__, 'displayHome.tpl');
}
public function hookLeftColumn($params){
$this->processConfiguration();
$this->assignConfiguration();
$this->smarty->assign(array(
'manufacturers' => Manufacturer::getManufacturers(),
'link' => $this->context->link,
));
return $this->display(__FILE__, 'leftColumn.tpl');
}
public function hookDisplayAfterProductThumbs($params){
return $this->display(__FILE__, 'displayAfterProductThumbs.tpl');
}
public function hookDisplayProductListReviews($params){
$id_product = (int)$params['product']['id_product'];
$id_manufacturer = Db::getInstance()->getValue(' select `id_manufacturer` FROM ' ._DB_PREFIX_.'product where `id_product` =' . $id_product);
$this->smarty->assign(array(
'id_manufacturer' => $id_manufacturer,
));
return $this->display(__FILE__, 'displayProductListReviews.tpl');
}
}

View File

@@ -0,0 +1,5 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{ppbrandslider}prestashop>displayafterproductthumbs_b68b622f3d4d292acc2920742e449e12'] = 'Fabricant';

View File

@@ -0,0 +1,33 @@
<?php
/*
* 2007-2017 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-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;

View File

@@ -0,0 +1,93 @@
.nbs-flexisel-container {
position:relative;
max-width:100%;
}
.nbs-flexisel-ul {
position:relative;
width:99999px;
margin:0px;
padding:0px;
list-style-type:none;
text-align:center;
overflow: auto;
}
.nbs-flexisel-inner {
position: relative;
overflow: hidden;
float:left;
width:100%;
}
.nbs-flexisel-item {
float:left;
margin:0px;
padding:0px;
cursor:pointer;
position:relative;
line-height:0px;
}
.nbs-flexisel-item img {
max-width: 100%;
cursor: pointer;
position: relative;
margin-top: 10px;
margin-bottom: 10px;
}
/*** Navigation ***/
.nbs-flexisel-nav-left,
.nbs-flexisel-nav-right {
padding:5px 15px;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
position: absolute;
cursor: pointer;
z-index: 4;
top: 50%;
transform: translateY(-50%);
background: #1B9BCC;
color: #fff;
}
.nbs-flexisel-nav-left {
left: 10px;
}
.nbs-flexisel-nav-left:before {
content: "<"
}
.nbs-flexisel-nav-left.disabled {
opacity: 0.4;
}
.nbs-flexisel-nav-right {
right: 5px;
}
.nbs-flexisel-nav-right:before {
content: ">"
}
.nbs-flexisel-nav-right.disabled {
opacity: 0.4;
}
.left-brands .nbs-flexisel-container .nbs-flexisel-nav-left,
.left-brands .nbs-flexisel-container .nbs-flexisel-nav-right {
display: none;
}
.brand-image {
background: #fff;
text-align: center;
}
.thumbnail-container {
margin-top: 50px;
}

View File

@@ -0,0 +1,33 @@
<?php
/*
* 2007-2017 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-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;

View File

@@ -0,0 +1,33 @@
<?php
/*
* 2007-2017 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-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;

View File

@@ -0,0 +1,416 @@
/*
* File: jquery.flexisel.js
* Version: 2.2.2
* Description: Responsive carousel jQuery plugin
* Author: 9bit Studios
* Copyright 2016, 9bit Studios
* http://www.9bitstudios.com
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function ($) {
$.fn.flexisel = function (options) {
var defaults = $.extend({
visibleItems: 4,
itemsToScroll: 3,
animationSpeed: 400,
infinite: true,
navigationTargetSelector: null,
autoPlay: {
enable: false,
interval: 5000,
pauseOnHover: true
},
responsiveBreakpoints: {
portrait: {
changePoint:480,
visibleItems: 1,
itemsToScroll: 1
},
landscape: {
changePoint:640,
visibleItems: 2,
itemsToScroll: 2
},
tablet: {
changePoint:768,
visibleItems: 3,
itemsToScroll: 3
}
},
loaded: function(){ },
before: function(){ },
after: function(){ },
resize: function(){ }
}, options);
/******************************
Private Variables
*******************************/
var object = $(this);
var settings = $.extend(defaults, options);
var itemsWidth;
var canNavigate = true;
var itemCount;
var itemsVisible = settings.visibleItems;
var itemsToScroll = settings.itemsToScroll;
var responsivePoints = [];
var resizeTimeout;
var autoPlayInterval;
/******************************
Public Methods
*******************************/
var methods = {
init: function() {
return this.each(function () {
methods.appendHTML();
methods.setEventHandlers();
methods.initializeItems();
});
},
/******************************
Initialize Items
*******************************/
initializeItems: function() {
var obj = settings.responsiveBreakpoints;
for(var i in obj) { responsivePoints.push(obj[i]); }
responsivePoints.sort(function(a, b) { return a.changePoint - b.changePoint; });
var childSet = object.children();
childSet.first().addClass("index");
itemsWidth = methods.getCurrentItemWidth();
itemCount = childSet.length;
childSet.width(itemsWidth);
if(settings.infinite) {
methods.offsetItemsToBeginning(Math.floor(childSet.length / 2));
object.css({
'left': -itemsWidth * Math.floor(childSet.length / 2)
});
}
$(window).trigger('resize');
object.fadeIn();
settings.loaded.call(this, object);
},
/******************************
Append HTML
*******************************/
appendHTML: function() {
object.addClass("nbs-flexisel-ul");
object.wrap("<div class='nbs-flexisel-container'><div class='nbs-flexisel-inner'></div></div>");
object.find("li").addClass("nbs-flexisel-item");
if(settings.navigationTargetSelector && $(settings.navigationTargetSelector).length > 0) {
$("<div class='nbs-flexisel-nav-left'></div><div class='nbs-flexisel-nav-right'></div>").appendTo(settings.navigationTargetSelector);
} else {
settings.navigationTargetSelector = object.parent();
$("<div class='nbs-flexisel-nav-left'></div><div class='nbs-flexisel-nav-right'></div>").insertAfter(object);
}
if(settings.infinite) {
var childSet = object.children();
var cloneContentBefore = childSet.clone();
var cloneContentAfter = childSet.clone();
object.prepend(cloneContentBefore);
object.append(cloneContentAfter);
}
},
/******************************
Set Event Handlers
*******************************/
setEventHandlers: function() {
var self = this;
var childSet = object.children();
$(window).on("resize", function(event){
canNavigate = false;
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function(){
canNavigate = true;
methods.calculateDisplay();
itemsWidth = methods.getCurrentItemWidth();
childSet.width(itemsWidth);
if(settings.infinite) {
object.css({
'left': -itemsWidth * Math.floor(childSet.length / 2)
});
} else {
methods.clearDisabled();
$(settings.navigationTargetSelector).find(".nbs-flexisel-nav-left").addClass('disabled');
object.css({
'left': 0
});
}
settings.resize.call(self, object);
}, 100);
});
$(settings.navigationTargetSelector).find(".nbs-flexisel-nav-left").on("click", function (event) {
methods.scroll(true);
});
$(settings.navigationTargetSelector).find(".nbs-flexisel-nav-right").on("click", function (event) {
methods.scroll(false);
});
if(settings.autoPlay.enable) {
methods.setAutoplayInterval();
if (settings.autoPlay.pauseOnHover === true) {
object.on({
mouseenter : function() {
canNavigate = false;
},
mouseleave : function() {
canNavigate = true;
}
});
}
}
object[0].addEventListener('touchstart', methods.touchHandler.handleTouchStart, false);
object[0].addEventListener('touchmove', methods.touchHandler.handleTouchMove, false);
},
/******************************
Calculate Display
*******************************/
calculateDisplay: function() {
var contentWidth = $('html').width();
var largestCustom = responsivePoints[responsivePoints.length-1].changePoint; // sorted array
for(var i in responsivePoints) {
if(contentWidth >= largestCustom) { // set to default if width greater than largest custom responsiveBreakpoint
itemsVisible = settings.visibleItems;
itemsToScroll = settings.itemsToScroll;
break;
}
else { // determine custom responsiveBreakpoint to use
if(contentWidth < responsivePoints[i].changePoint) {
itemsVisible = responsivePoints[i].visibleItems;
itemsToScroll = responsivePoints[i].itemsToScroll;
break;
}
else {
continue;
}
}
}
},
/******************************
Scroll
*******************************/
scroll: function(reverse) {
if(typeof reverse === 'undefined') { reverse = true }
if(canNavigate == true) {
canNavigate = false;
settings.before.call(this, object);
itemsWidth = methods.getCurrentItemWidth();
if(settings.autoPlay.enable) {
clearInterval(autoPlayInterval);
}
if(!settings.infinite) {
var scrollDistance = itemsWidth * itemsToScroll;
if(reverse) {
object.animate({
'left': methods.calculateNonInfiniteLeftScroll(scrollDistance)
}, settings.animationSpeed, function(){
settings.after.call(this, object);
canNavigate = true;
});
} else {
object.animate({
'left': methods.calculateNonInfiniteRightScroll(scrollDistance)
},settings.animationSpeed, function(){
settings.after.call(this, object);
canNavigate = true;
});
}
} else {
object.animate({
'left' : reverse ? "+=" + itemsWidth * itemsToScroll : "-=" + itemsWidth * itemsToScroll
}, settings.animationSpeed, function() {
settings.after.call(this, object);
canNavigate = true;
if(reverse) {
methods.offsetItemsToBeginning(itemsToScroll);
} else {
methods.offsetItemsToEnd(itemsToScroll);
}
methods.offsetSliderPosition(reverse);
});
}
if(settings.autoPlay.enable) {
methods.setAutoplayInterval();
}
}
},
touchHandler: {
xDown: null,
yDown: null,
handleTouchStart: function(evt) {
this.xDown = evt.touches[0].clientX;
this.yDown = evt.touches[0].clientY;
},
handleTouchMove: function (evt) {
if (!this.xDown || !this.yDown) {
return;
}
var xUp = evt.touches[0].clientX;
var yUp = evt.touches[0].clientY;
var xDiff = this.xDown - xUp;
var yDiff = this.yDown - yUp;
// only comparing xDiff
// compare which is greater against yDiff to determine whether left/right or up/down e.g. if (Math.abs( xDiff ) > Math.abs( yDiff ))
if (Math.abs( xDiff ) > 0) {
if ( xDiff > 0 ) {
// swipe left
methods.scroll(false);
} else {
//swipe right
methods.scroll(true);
}
}
/* reset values */
this.xDown = null;
this.yDown = null;
canNavigate = true;
}
},
/******************************
Utility Functions
*******************************/
getCurrentItemWidth: function() {
return (object.parent().width())/itemsVisible;
},
offsetItemsToBeginning: function(number) {
if(typeof number === 'undefined') { number = 1 }
for(var i = 0; i < number; i++) {
object.children().last().insertBefore(object.children().first());
}
},
offsetItemsToEnd: function(number) {
if(typeof number === 'undefined') { number = 1 }
for(var i = 0; i < number; i++) {
object.children().first().insertAfter(object.children().last());
}
},
offsetSliderPosition: function(reverse) {
var left = parseInt(object.css('left').replace('px', ''));
if (reverse) {
left = left - itemsWidth * itemsToScroll;
} else {
left = left + itemsWidth * itemsToScroll;
}
object.css({
'left': left
});
},
getOffsetPosition: function() {
return parseInt(object.css('left').replace('px', ''));
},
calculateNonInfiniteLeftScroll: function(toScroll) {
methods.clearDisabled();
if(methods.getOffsetPosition() + toScroll >= 0) {
$(settings.navigationTargetSelector).find(".nbs-flexisel-nav-left").addClass('disabled');
return 0;
} else {
return methods.getOffsetPosition() + toScroll;
}
},
calculateNonInfiniteRightScroll: function(toScroll){
methods.clearDisabled();
var negativeOffsetLimit = (itemCount * itemsWidth) - (itemsVisible * itemsWidth);
if(methods.getOffsetPosition() - toScroll <= -negativeOffsetLimit) {
$(settings.navigationTargetSelector).find(".nbs-flexisel-nav-right").addClass('disabled');
return -negativeOffsetLimit;
} else {
return methods.getOffsetPosition() - toScroll;
}
},
setAutoplayInterval: function(){
autoPlayInterval = setInterval(function() {
if (canNavigate) {
methods.scroll(false);
}
}, settings.autoPlay.interval);
},
clearDisabled: function() {
var parent = $(settings.navigationTargetSelector);
parent.find(".nbs-flexisel-nav-left").removeClass('disabled');
parent.find(".nbs-flexisel-nav-right").removeClass('disabled');
}
};
if (methods[options]) { // $("#element").pluginName('methodName', 'arg1', 'arg2');
return methods[options].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof options === 'object' || !options) { // $("#element").pluginName({ option: 1, option:2 });
return methods.init.apply(this);
} else {
$.error( 'Method "' + method + '" does not exist in flexisel plugin!');
}
};
})(jQuery);

View File

@@ -0,0 +1,73 @@
$(window).load(function() {
if (autoplay_slider == "1") {
autoplay_slider = true;
} else if (autoplay_slider == "0") {
autoplay_slider = false;
}
if (show_arrows == "1") {
show_arrows = true;
} else if (show_arrows == "0") {
show_arrows = false;
}
if (mouse_hover == "1") {
mouse_hover = true;
} else if (mouse_hover == "0") {
mouse_hover = false;
}
$("#logo-slider").flexisel({
visibleItems: visible_items,
itemsToScroll: scroll_items,
animationSpeed: animation_speed,
infinite: true,
navigationTargetSelector: null,
autoPlay: {
enable: autoplay_slider,
interval: 5000,
pauseOnHover: mouse_hover
},
responsiveBreakpoints: {
portrait: {
changePoint:480,
visibleItems: 1,
itemsToScroll: 1
},
landscape: {
changePoint:640,
visibleItems: 2,
itemsToScroll: 2
},
tablet: {
changePoint:768,
visibleItems: 3,
itemsToScroll: 3
}
},
loaded: function(object) {
console.log('Slider loaded...');
},
before: function(object){
console.log('Before transition...');
},
after: function(object) {
console.log('After transition...');
},
resize: function(object){
console.log('After resize...');
}
});
$("#brand-slider").flexisel({
visibleItems: 2,
itemsToScroll: 1,
autoPlay: {
enable: true,
interval: 5000,
pauseOnHover: true
}
});
});

View File

@@ -0,0 +1,2 @@
<h5>{l s='Product Manufacturer:' mod='ppbrandslider'}</h5>
<img src="{$urls.img_ps_url}/m/{$product.id_manufacturer}.jpg" width="100px" >

View File

@@ -0,0 +1,21 @@
{if $show_arrows == 0}
<style type="text/css">
.nbs-flexisel-nav-left, .nbs-flexisel-nav-right {
display: none ;
}
</style>
{/if}
{if $enable_brand_slider}
<h1>Brands</h1>
<ul id="logo-slider">
{foreach from=$manufacturers item=manufacturer name=manufacturer_list}
<li>
<a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}">
<img src="img/m/{$manufacturer.id_manufacturer}.jpg"></a>
</li>
{/foreach}
</ul>
{/if}

View File

@@ -0,0 +1 @@
<img src="{$urls.img_ps_url}/m/{$product.id_manufacturer}.jpg" width="100px" >

View File

@@ -0,0 +1,4 @@
<div class="brand-image">
<img src="{$urls.img_ps_url}/m/{$id_manufacturer}.jpg" width="100px" height="50px">
</div>

View File

@@ -0,0 +1,33 @@
<?php
/*
* 2007-2017 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-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;

View File

@@ -0,0 +1,13 @@
{if $enable_brand_slider && $}
<div class="left-brands">
<h1>Our Brands</h1>
<ul id="brand-slider">
{foreach from=$manufacturers item=manufacturer name=manufacturer_list}
<li>
<a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}">
<img src="img/m/{$manufacturer.id_manufacturer}.jpg"></a>
</li>
{/foreach}
</ul>
</div>
{/if}

View File

@@ -0,0 +1,33 @@
<?php
/*
* 2007-2017 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-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;