Thread: Login for price

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    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.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,133
    Plugin Contributions
    11

    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
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Login for price

    Ok where would I put this for the new products centerbox?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,133
    Plugin Contributions
    11

    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
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    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
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  6. #6
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    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;
    }
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,682
    Plugin Contributions
    9

    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.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  8. #8
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,133
    Plugin Contributions
    11

    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.

  9. #9
    Join Date
    Aug 2020
    Location
    Richarson
    Posts
    94
    Plugin Contributions
    0

    Default Re: Login for price

    I am using Responsive_Classic 1.5.8a and I have the cart set-up to must login to view prices. All is good except I cannot figure out how to style the words "login for price" it's too small and I want to increase the size of that text. I can see the styling for list-price, but that does not work for me as it will not adjust the "login for price" words. The website is comfortpricefurniture.com. Any help would be awesome. Thank you.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Login for price

    To the template's /css/stylesheet.css, add

    .list-price+a { font-size: larger; }

    ... or the specific font-size you want instead of the more general larger. Note that the .list-price element has a font-size of 1.5em.

    That selector, BTW, indicates that the styling applies to an anchor tag (<a>) that directly follows an element with a class of list-price.

 

 
Page 1 of 2 12 LastLast

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