Results 1 to 10 of 14

Hybrid View

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

    Default Re: Login for price on specific products

    You are being a goober ...

    Add a new case, and you have to find the syntax as I have to run:
    Code:
    case ($_SESSION['customer_id'] == ''  and $categories_id == '13'):
            // no prices for unlogged customers for Category 13
            return TEXT_LOGIN_FOR_PRICE_PRICE;
            break;
    Add just before the
    Code:
    default:
    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!

  2. #2
    Join Date
    May 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Login for price on specific products

    Ok, so I'm really not trying to be a goober here

    So I just modified the actual file, using your formulation of the case. It's now the final case in the switch statement instead of the first, just before the default. And I'm sorry to say it's not working.

    I hate to be troublesome, especially since it seems like this shouldn't be this hard. The logic makes perfect sense, but the items in the category are stubbornly continuing to show a price. What am I missing??

  3. #3
    Join Date
    May 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Login for price on specific products

    ok, getting there. Got it working, giving price unavailable, now I'm going digging to prevent it from being added to cart, which then shows the price without a login :) Thanks for your help.

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

    Default Re: Login for price on specific products

    Now you hunt down the button function to do the same thing ...

    A search in the Developers Tool Kit on:
    CUSTOMERS_APPROVAL

    will probably lead you to a similarly designed function ... but the night is late and too tired to do the work for you, tonight ...
    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!

  5. #5
    Join Date
    May 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Login for price on specific products

    Actually I did get it figured out last night, thanks again for all your help. I came back to explain for the benefit of others who may be searching.

    The final trick with the price display was that $category_id had no value, so I duplicated a DB call from elsewhere in the functions_prices to grab that value. Thus the case would evaluate and the price would become "unavailable".

    The problem then was that the add to cart button was still available, and once in the cart the price would be displayed. A search through the DTK as recommended turned up the portion of tpl_product_info_display that builds the add to cart box. This is an if/else statement with an exception for the "showroom mode". I added an elseif and the same logic from the price function to cause the conditional to exit without creating the button/qty field.

    Probably not the best solution, and additional DB calls to boot, but it worked.

  6. #6
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: Login for price on specific products

    I need a little further help here.
    The project being worked is for a store that the customer can browse but cannot see the prices anywhere unless they are logged in.

    I found the function_prices.php and added a snippet of code on the default saying:

    Code:
            default:
            case ($_SESSION['customer_id'] == '' ):
            // no prices for unlogged customers
            return TEXT_LOGIN_FOR_PRICE_PRICE;
            break;
    We also found the file tpl_product_info_display.php because we noticed the catalog worked well but if they added product, then viewed the cart, the prices were visible again. I'm unsure how to proceed from here, or even if I should. While searching for a little more information I began seeing many places this could be handled in the Admin panel because it's a global attribute being changed.

    The desired goal here is to allow customers to browse but only see the prices and be allowed to check out if logged in. Am I chasing my tail here?
    Last edited by agrapha; 2 Feb 2009 at 07:19 PM. Reason: a little better english composition

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

    Default Re: Login for price on specific products

    You are adding your new CASE after the default: and it needs to be before the default:
    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!

  8. #8
    Join Date
    Jan 2008
    Posts
    11
    Plugin Contributions
    0

    Default Re: Login for price on specific products

    Quote Originally Posted by agrapha View Post

    The desired goal here is to allow customers to browse but only see the prices and be allowed to check out if logged in. Am I chasing my tail here?
    My desired goal is actually, the exact opposite.

    I set mine to "login for price" about a year ago, to prevent online collegues from seeing my prices then undercutting me.

    Since that happened, I haven't gotten a single sale.

    Now I'd like to change it back, but can't remember how I did it in the first place.

    any suggestions? email would be quicker than here.

    [email protected]
    subject = zencart pricing question

    Thanks
    David
    =====
    David Stous
    Chief Maille Smith
    Wolf's Den armoury
    www.wolfsdenarmoury.com

 

 

Similar Threads

  1. mass price change for all products in a specific category
    By chaiavi in forum Setting Up Categories, Products, Attributes
    Replies: 21
    Last Post: 5 May 2019, 03:28 PM
  2. v154 specific products for specific customers
    By frodemikal in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 6 Jan 2016, 09:18 PM
  3. v138a COD for specific products and for specific Zip Codes
    By hc1501 in forum Addon Payment Modules
    Replies: 0
    Last Post: 29 May 2014, 12:54 PM
  4. How to set a specific shipping price for a specific product?
    By mmambou in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 2 Feb 2009, 04:34 PM
  5. When a specific Attribute is used - change price to "call for price"?
    By PaulRiedel in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 4 Nov 2007, 02:34 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