Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2011
    Posts
    3
    Plugin Contributions
    0

    Default Display Model based on Account Approval

    I am trying to display the Model value for products but only show it when a customer is logged in and his/her account has been approved.

    Shouldn't the following code do the job:

    PHP Code:
    <?php
    if (CUSTOMERS_APPROVAL == and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
      
    // do nothing

    } else {
    ?>


        <?php echo (($flag_show_product_info_model == and $products_model !='') ? '<li>' TEXT_PRODUCT_MODEL $products_model '</li>' '') . "\n"?>

    <?php // CUSTOMERS_APPROVAL == 3 ?>
    But the above is not working, it's not displaying anything.


  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Display Model based on Account Approval

    To know if a customer is logged in or not use:
    $_SESSION['customer_id']

    when it is > 0, the customer is logged in ...

    I don't know what your setting is for:
    TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM

    but I would just use:
    Code:
    if ($_SESSION['customer_id'] > 0) {
    // do stuff when customer is logged in
    } else {
    // do stuff when customer is NOT logged in
    }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Feb 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Display Model based on Account Approval

    Thanks. But how can I specify to only show it when the customer that has logged in is also approved?

    Right now the price shows only when the customer had his account approved. I'd like to show the Model number as well then also.

  4. #4
    Join Date
    Feb 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Display Model based on Account Approval

    Also, for some reason the Model value is not being displayed. Nothing happens

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Display Model based on Account Approval

    If you look at how the cases are written in the function zen_get_buy_now_button in the:
    /includes/functions/functions_general.php

    that will give you an idea of how the Add to Cart/Buy Now buttons are managed based on the Authorization and Customer login ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. trouble changing wording of account approval email
    By abran1984 in forum General Questions
    Replies: 2
    Last Post: 6 May 2011, 10:40 PM
  2. Automated Account approval
    By dthoward64 in forum Managing Customers and Orders
    Replies: 10
    Last Post: 27 Nov 2009, 02:10 PM
  3. Customer Approval based on Referral Code Input
    By eplutons in forum Managing Customers and Orders
    Replies: 2
    Last Post: 4 Dec 2008, 02:57 AM
  4. Model ID based on attribute
    By milksamsa in forum Managing Customers and Orders
    Replies: 2
    Last Post: 9 Jul 2007, 11:44 PM
  5. user account approval module?
    By blackinches in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 Dec 2006, 10:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg