Products not showing up in member.php

Discussion in 'Troubleshooting' started by webalchemist, May 23, 2011.

  1. webalchemist

    webalchemist New Member

    Joined:
    Mar 30, 2011
    Messages:
    6
    The Add Product tab in member.php is not working as I expect.

    When managing products there is a setting to show a product:
    1) Visible for all
    2) disabled (visible for none)
    3) only signup.php (this is people with no account)
    4) "only members having completed subscriptions (hide from signup page)"

    I have products that I do not want to show up on the regular signup.php, but I DO want to show up on the member.php.

    The problem is that the setting #4 is based on BOTH "is a member" AND "has a product". I expected it to be just "show only to users with accounts".

    Is there any way of showing certain products in member.php even if the member doesn't have any subscription?

    (everything was working fine until someone created an account but didn't purchase a membership. Now they can't buy anything!)

    Any ideas?
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    This used to be "only members page" but looks like it was updated to be for completed only... leaving us with using
    1) Visible for all
    and using a price group id = 2
    Then using the price group id of =1 on the signup link and for the products we want on the signup page.

    David
  3. webalchemist

    webalchemist New Member

    Joined:
    Mar 30, 2011
    Messages:
    6
    That's too bad. There should be a 5th option, then, for "members with or without a completed subscription". I really don't want to put an explicit price group on the main signup.php URL because we probably already have some links that go to the bare signup.php URL and anyone who browsed there would see too many products if we used your proposed scheme.

    Perhaps I will ask if we can have amember modified to do the 5th option.
  4. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    If above will not work, edit /amember/member.php and change this:
    PHP:
    function check_product_scope($product_id$member_id){
        
    // return '' if allowed
        // return error message if denied
        
    global $db;
        
    $product $db->get_product($product_id);
        if (!
    $product['scope']) return;
        if (
    $product['scope'] == 'member'){
            
    //check that customer paid
            
    if (count($db->get_user_payments($member_id,1)))
                return;
            else
                return 
    _MEMBER_ONLY4_PAID;
        }
        if (
    $product['scope'] == 'signup'){
            
    //check that customer paid
            
    if (!count($db->get_user_payments($member_id,1)))
                return;
            else
                return 
    _MEMBER_ONLY4_NEW;
        }
        return 
    _MEMBER_NOT4_ORDER;
    }

    to

    PHP:
    function check_product_scope($product_id$member_id){
        
    // return '' if allowed
        // return error message if denied
        
    global $db;
        
    $product $db->get_product($product_id);
        if (!
    $product['scope']) return;
        if (
    $product['scope'] == 'member'){
            
    //check that customer paid
           
    return; 
        }
        if (
    $product['scope'] == 'signup'){
            
    //check that customer paid
            
    if (!count($db->get_user_payments($member_id,1)))
                return;
            else
                return 
    _MEMBER_ONLY4_NEW;
        }
        return 
    _MEMBER_NOT4_ORDER;
    }

Share This Page