Advertisement
Guest User

add button in my account - prestashop module

a guest
May 18th, 2017
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1. <?php
  2. /**
  3. * 2007-2016 PrestaShop
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@prestashop.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  18. * versions in the future. If you wish to customize PrestaShop for your
  19. * needs please refer to http://www.prestashop.com for more information.
  20. *
  21. *  @copyright 2007-2016 PrestaShop SA
  22. *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  23. *  International Registered Trademark & Property of PrestaShop SA
  24. */
  25.  
  26. if (!defined('_PS_VERSION_'))
  27.   exit;
  28.  
  29. class MyAccountButton extends Module
  30. {
  31.     public function __construct()
  32.     {
  33.         $this->name = "myaccountbutton";
  34.         $this->tab = "front_office_features";
  35.         $this->version = "1.0.0";
  36.         $this->author = "Webévasion";
  37.         $this->bootstrap = true;
  38.  
  39.         parent::__construct();
  40.         $this->controllers = array('default');
  41.         $this->displayName = $this->l('My account button');
  42.         $this->description = $this->l('Add a button in my account');
  43.         $this->confirmUninstall = $this->l('Do you really want to uninstall '.$this->displayName.' ?');
  44.     }
  45.  
  46.     public function install()
  47.     {
  48.         if(Shop::isFeatureActive())
  49.             Shop::setContext(Shop::CONTEXT_ALL);
  50.  
  51.         return parent::install() && $this->registerHook('displayMyAccountBlock');
  52.     }
  53.  
  54.     public function uninstall()
  55.     {
  56.         return parent::uninstall();
  57.     }
  58.  
  59.     public function hookDisplayCustomerAccount($params)
  60.     {
  61.         $this->smarty->assign('in_footer', false);
  62.         return $this->display(__FILE__, 'my-account.tpl');
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement