nothing I do removes payment-history brick

Discussion in 'Templates customization' started by jmartin55, Mar 29, 2015.

Thread Status:
Not open for further replies.
  1. jmartin55

    jmartin55 aMember Pro Customer

    Joined:
    Feb 12, 2013
    Messages:
    37
    This is my copied and pasted site.php file, please let me know what I need to paste into this to remove payment history brick. I've tried everything on every forum, and every time it 1.) does not remove any brick 2.) generates a php error on line 15. This is the clean (unmodified) site.php file. Please help me and thank you in advanced :)

    <?php
    if (!defined('INCLUDED_AMEMBER_CONFIG'))
    die("Direct access to this location is not allowed");

    /*
    * aMember Pro site customization file
    *
    * Rename this file to site.php and put your site customizations,
    * such as fields additions, custom hooks and so on to this file
    * This file will not be overwritten during upgrade
    *

    Just so we are clear, I've already tried:

    Am_Di::getInstance()->hook->add(Am_Event::USER_MENU, ‘onUserMenu’);
    function onUserMenu(Am_Event $event)
    {
    //remove a tab
    $menu = $event->getMenu();
    $page = $menu->findOneBy(‘id’, ‘payment-history’);
    $menu->removePage($page);
    }

    And I've tried (from the amember documentation):

    // Remove a tab
    $page = $menu->findOneBy('id', 'payment-history');
    $menu->removePage($page);
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Please try this one
    PHP:
    <?php
    if (!defined('INCLUDED_AMEMBER_CONFIG'))
        die(
    "Direct access to this location is not allowed");

    Am_Di::getInstance()->hook->add(Am_Event::USER_MENU'onUserMenu');
    function 
    onUserMenu(Am_Event $event)
    {
        
    $menu $event->getMenu();
        
    $page $menu->findOneBy('id''payment-history');
        
    $menu->removePage($page);
    }
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Please note type of quotes is important. In your code in this thread you use incorrect quotes - ‘ , ’.
    It should be - '
    jmartin55 likes this.
  4. jmartin55

    jmartin55 aMember Pro Customer

    Joined:
    Feb 12, 2013
    Messages:
    37
    Thank you Caesar! Worked perfectly. :)
Thread Status:
Not open for further replies.

Share This Page