Thread: Login for price

Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    red flag Login for price

    [Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

    I have a cart set up where prices can only be viewed when customers login, if logged out it is displaying Login for price.

    Login for price displays on the product listing, but it doesn't display on centerboxes for new products, featured products, specials etc. How would I apply the same function to these centerboxes. Currently I have manually applied it, but once logged in the prices display and it still says 'Login for price' underneath the price. I want Login for price to disappear from center boxes once logged in, just like it does on the product listing.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    6,343
    Plugin Contributions
    8

    Default Re: Login for price

    You can determine if they are logged in using: $_SESSION['customer_id']
    If it's not defined, they're not logged in.

  3. #3
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: Login for price

    Ok where would I put this for the new products centerbox?

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    6,343
    Plugin Contributions
    8

    Default Re: Login for price

    Easiest method might be in the includes/languages/english.php. All the defines are around lines 484 -- 491.

    Code:
    if ($_SESSION['customer_id']  > 0) { 
      define('TABLE_HEADING_FEATURED_PRODUCTS','Featured Products');
      define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
      define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
      define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
      define('TABLE_HEADING_SPECIALS_INDEX', 'Monthly Specials For %s');
      } else { 
      define('TABLE_HEADING_FEATURED_PRODUCTS','Log in to See Prices For Featured Products');
      define('TABLE_HEADING_NEW_PRODUCTS', 'Log in to See Prices For New Products For %s');
      define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Log in to See Prices For Upcoming Products');
      define('TABLE_HEADING_DATE_EXPECTED', 'Log in to See Prices For Date Expected');
      define('TABLE_HEADING_SPECIALS_INDEX', 'Log in to See Prices For Monthly Specials For %s');
      }
    
    Adjust the text to suit your taste.

  5. #5
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: Login for price

    Quote Originally Posted by dbltoe View Post
    Easiest method might be in the includes/languages/english.php. All the defines are around lines 484 -- 491.

    Code:
    if ($_SESSION['customer_id']  > 0) { 
      define('TABLE_HEADING_FEATURED_PRODUCTS','Featured Products');
      define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
      define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
      define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
      define('TABLE_HEADING_SPECIALS_INDEX', 'Monthly Specials For %s');
      } else { 
      define('TABLE_HEADING_FEATURED_PRODUCTS','Log in to See Prices For Featured Products');
      define('TABLE_HEADING_NEW_PRODUCTS', 'Log in to See Prices For New Products For %s');
      define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Log in to See Prices For Upcoming Products');
      define('TABLE_HEADING_DATE_EXPECTED', 'Log in to See Prices For Date Expected');
      define('TABLE_HEADING_SPECIALS_INDEX', 'Log in to See Prices For Monthly Specials For %s');
      }
    
    Adjust the text to suit your taste.
    ok got you :-) thank you

  6. #6
    Join Date
    Sep 2008
    Posts
    781
    Plugin Contributions
    3

    Default Re: Login for price

    Quote Originally Posted by Nick1973 View Post
    ok got you :-) thank you
    Ok how would I use this here:

    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<div class="productListingImageContainer"><a class="productListingImage" href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a></div><br />') . '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a></h3><br />' . $products_price . '<a href="index.php?main_page=login">Login for price</a>');

    Note the bit

    <br />' . $products_price . '<a href="index.php?main_page=login">Login for price</a>');

    I tried:

    if ($_SESSION['customer_id'] > 0) {
    '<a href="index.php?main_page=login">Login for price</a>';
    } else {
    $products_price;
    }

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    962
    Plugin Contributions
    1

    Default Re: Login for price

    nick,
    if you use the bbcode tags, it makes it easier for some of us to read. see: https://www.bbcode.org/reference.php

    i would modify the $products_price prior to its use in the statement. perhaps something like this:

    PHP Code:
    $products_price = ($_SESSION['customer_id'] > $products_price '<a href="index.php?main_page=login">Login for price</a>');

    $list_box_contents[$row][$col] = array(
        
    'params' => 'class="centerBoxContentsNew centeredContent back"' ' ' 'style="width:' $col_width '%;"',
        
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' :
                
    '<div class="productListingImageContainer"><a class="productListingImage"
                                                 href="' 
    zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">'
            
    zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'],
            
    IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT) . '</a></div><br/>') .
            
    '<h3 class="itemTitle"><a
                href="' 
    zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">'
            
    $new_products->fields['products_name'] . '</a></h3><br/>' $products_price); 
    best.
    feel free to donate money to carl or to the Zen-Cart Team

  8. #8
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    6,343
    Plugin Contributions
    8

    Default Re: Login for price

    Code:
    if ($_SESSION['customer_id'] > 0) {
    '<a href="index.php?main_page=login">Login for price</a>';
    } else {
    $products_price;
    }
    Try reading this versus looking at code. To me, it says:

    If the customer is logged in give them a link to log in.

    OR

    If the customer is not logged in give them the price.

 

 

Similar Threads

  1. v138a Shipping Estimater with Login-for-Price, for staff doing phone orders
    By farhansabir in forum General Questions
    Replies: 3
    Last Post: 25 Jun 2013, 07:49 PM
  2. reduce the space between image, name, brand, price & login for price.
    By carlosesierra in forum Customization from the Admin
    Replies: 1
    Last Post: 12 Oct 2009, 04:00 PM
  3. reduce the space between image, name, brand, price & login for price.
    By carlosesierra in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Oct 2009, 11:54 AM
  4. Login for price
    By fvpereira in forum General Questions
    Replies: 2
    Last Post: 11 Jul 2007, 02:23 AM
  5. Login for Price for only ONE product....
    By jettrue in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Jul 2007, 05:57 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR