Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: log in for price

    Sorry, thought I put the new code in RED ...

    In the function_general.php you will see the line in black:
    Code:
        $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    Put the code in RED above that ...
    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: v1.5.5]
    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!

  2. #12
    Join Date
    Feb 2010
    Location
    ny
    Posts
    223
    Plugin Contributions
    0

    Default Re: log in for price

    Ok I put that in and still no prices, I changes store back to 0, normal store (no login) and still shows prices for all including cat 112.

    cust details, view shop prices set to # 2 and no prices (for anything) show, please advise.

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

    Default Re: log in for price

    Go to phpMyAdmin and search your table:
    products

    for one of the products_id that is in the Category 112, and see what is in the field:
    master_categories_id

    does it read 112?

    Did you copy and paste the code in RED into your code or did you try to re-type it?
    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: v1.5.5]
    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!

  4. #14
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default Re: log in for price

    WOW. this worked like a charm Ajeh! Thanks for this.

    No need for elaborate modle installation.

    One question, can we add multible categories like so?
    Code:
     
    // bof: Login for Price
    $chk_login_for_price = false;
    $chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$products_id . "'";
    $chk_category = $db->Execute($chk_category_sql);
    if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(123, 145, 1187)) ) {
    return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE;
    }
    // eof: Login for Price
    Downunder QLD

  5. #15
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default Re: log in for price

    Quote Originally Posted by Ajeh View Post
    You would need to address the Price and the Add to Cart button ...

    In the functions_general.php in the function zen_get_buy_now_button ...

    You can add the code in RED:
    Code:
    // bof: Login for Price button      
    $chk_login_for_price = false;
    $chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$product_id . "'";
    $chk_category = $db->Execute($chk_category_sql);
    if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(10, 12)) ) {
      $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>';
      return $login_for_price;
    }
    // eof: Login for Price button      
    
        $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    In the function file function_prices in the function zen_get_products_display_price you can add the code in RED:
    Code:
    // show case only
        if (STORE_STATUS != '0') {
          if (STORE_STATUS == '1') {
            return '';
          }
        }
    
    // bof: Login for Price     
    $chk_login_for_price = false;
    $chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$products_id . "'";
    $chk_category = $db->Execute($chk_category_sql);
    if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(10, 12)) ) {
      return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE;
    }
    // eof: Login for Price
    How do you handle for the products have attributes or specials?
    I have the categories and the subcategories under the master category working but any products has attributes or specials are still showing their prices. How can I hide those product prices have the attributes and specials as well?
    Last edited by oavs; 13 Jul 2020 at 01:14 AM.
    Downunder QLD

  6. #16
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default Re: log in for price

    THis works CategoryA> CategoryAB> ProductABC

    Is it possible to hide the products under deeper category structure?
    CategoryA> CategoryAB> CategoryABC> CategoryABCD> PoductABCDE

    Hope Ajeh is still around :-}
    Downunder QLD

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v139f Login for Wholesale Price button Linked to Log In Page
    By missymissy in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Apr 2014, 11:16 AM
  2. blank log in page for admin no log in for users
    By alfonso99 in forum Customization from the Admin
    Replies: 1
    Last Post: 30 Jul 2011, 10:34 AM
  3. Replies: 2
    Last Post: 16 Jul 2009, 02:34 PM
  4. Price Unavailable and Log in for price
    By cassiedesigns in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Apr 2009, 04:30 AM
  5. Log in for Price
    By CnTGifts in forum General Questions
    Replies: 1
    Last Post: 21 Nov 2007, 04:54 AM

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