diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml index c434f6ad7..3b5fa296d 100644 --- a/install-dev/data/xml/hook.xml +++ b/install-dev/data/xml/hook.xml @@ -283,5 +283,8 @@ displayBackOfficeCategoryDisplay new elements in the Back Office, tab AdminCategoriesThis hook launches modules when the AdminCategories tab is displayed in the Back Office + + displayProductListFunctionalButtonsDisplay new elements in the Front Office, products listThis hook launches modules when the products list is displayed in the Front Office + diff --git a/modules/blockwishlist/blockwishlist.php b/modules/blockwishlist/blockwishlist.php index 440b04939..83142f8f6 100644 --- a/modules/blockwishlist/blockwishlist.php +++ b/modules/blockwishlist/blockwishlist.php @@ -38,7 +38,7 @@ class BlockWishList extends Module { $this->name = 'blockwishlist'; $this->tab = 'front_office_features'; - $this->version = 0.2; + $this->version = 0.3; $this->author = 'PrestaShop'; $this->need_instance = 0; @@ -62,13 +62,15 @@ class BlockWishList extends Module if($query) if(!Db::getInstance()->execute(trim($query))) return false; - if (!parent::install() OR - !$this->registerHook('rightColumn') OR - !$this->registerHook('productActions') OR - !$this->registerHook('cart') OR - !$this->registerHook('customerAccount') OR - !$this->registerHook('header') OR - !$this->registerHook('adminCustomers') + if (!parent::install() || + !$this->registerHook('rightColumn') || + !$this->registerHook('productActions') || + !$this->registerHook('cart') || + !$this->registerHook('customerAccount') || + !$this->registerHook('header') || + !$this->registerHook('adminCustomers') || + !$this->registerHook('displayProductListFunctionalButtons') || + !$this->registerHook('top') ) return false; /* This hook is optional */ @@ -79,10 +81,10 @@ class BlockWishList extends Module public function uninstall() { return ( - Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist') AND - Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist_email') AND - Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist_product') AND - Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist_product_cart') AND + Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist') && + Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist_email') && + Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist_product') && + Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'wishlist_product_cart') && parent::uninstall() ); } @@ -107,6 +109,18 @@ class BlockWishList extends Module return $this->_html; } + public function hookDisplayProductListFunctionalButtons($params) + { + //TODO : Add cache + $this->smarty->assign('product', $params['product']); + return $this->display(__FILE__, 'blockwishlist_button.tpl'); + } + + public function hookTop($params) + { + return $this->display(__FILE__, 'blockwishlist_top.tpl'); + } + public function hookHeader($params) { $this->context->controller->addCSS(($this->_path).'blockwishlist.css', 'all'); diff --git a/modules/blockwishlist/blockwishlist_button.tpl b/modules/blockwishlist/blockwishlist_button.tpl new file mode 100644 index 000000000..c339a9b59 --- /dev/null +++ b/modules/blockwishlist/blockwishlist_button.tpl @@ -0,0 +1,28 @@ +{* +* 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 +* @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 +*} + +
+ Add to Wishlist +
\ No newline at end of file diff --git a/modules/blockwishlist/blockwishlist_top.tpl b/modules/blockwishlist/blockwishlist_top.tpl new file mode 100644 index 000000000..a7e5a6463 --- /dev/null +++ b/modules/blockwishlist/blockwishlist_top.tpl @@ -0,0 +1,28 @@ +{* +* 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 +* @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 +*} + + \ No newline at end of file diff --git a/modules/blockwishlist/config.xml b/modules/blockwishlist/config.xml index b2769a8d2..43c96a918 100755 --- a/modules/blockwishlist/config.xml +++ b/modules/blockwishlist/config.xml @@ -2,7 +2,7 @@ blockwishlist - + diff --git a/modules/blockwishlist/upgrade/install-0.3.php b/modules/blockwishlist/upgrade/install-0.3.php new file mode 100644 index 000000000..1d2b8f3d3 --- /dev/null +++ b/modules/blockwishlist/upgrade/install-0.3.php @@ -0,0 +1,9 @@ +registerHook('displayProductListFunctionalButtons') && $object->registerHook('top')); +}