Forums / Templates, Stylesheets, Page Layout / Login for price on specific products

Login for price on specific products

Locked

Views: 3,555

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
28 Jan 2009, 4:21 PM
#1
00goat avatar

00goat

New Zenner

Join Date:
May 2008
Posts:
26
Plugin Contributions:
0

Login for price on specific products

I've been poking around the forums for a couple of days on this, and I've seen several references to the question and no answers.

A certain vendor is prohibiting us from displaying prices for their products on our site. For the moment these items are "call for price", but what I'd really like to do is make them "login for price" (this is apparently acceptable to the vendor).

I know about the global "login to shop" option in config, but I don't want to add that barrier to the whole site for one small group of products. So is there a way to make certain items "login for price"?

Barring that, does anyone have another way that customers could be authorized to purchase these products? As it stands, if they call for price, we'd have to take the order over the phone. Even if that could be reduced to "e-mail for authorization" and then they could order on the site, that would be an improvement.

Thanks in advance for any help.

28 Jan 2009, 5:21 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Login for price on specific products

If you look in the functions file functions_prices you will see the display function for the prices:

////
// Display Price Retail
// Specials and Tax Included
  function zen_get_products_display_price($products_id) {

There is a CASE statement that currently manages the authorization display for prices:

        case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
        // customer may browse but no prices
        return TEXT_LOGIN_FOR_PRICE_PRICE;

where you could do something similar by testing for the manfacturers_id of the product and see if the customer is logged in and if not, then do the: return TEXT_LOGIN_FOR_PRICE_PRICE;

I would add that new CASE statement just 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!

28 Jan 2009, 7:50 PM
#3
00goat avatar

00goat

New Zenner

Join Date:
May 2008
Posts:
26
Plugin Contributions:
0

Re: Login for price on specific products

Well, the concept makes sense, but I'm not sure how to override a function like that? It doesn't seem to work like other overrides, and I skimmed back over the overrides explanation and it doesn't seem to include functions. Should I be changing the existing file?

Alternately I could be doing it wrong, I would prefer to have this effect on the category instead of the manufacturer id, because we have other products from that vendor that can have visible prices. I realized I'm not positive what the category variable is, is it $categories_id? And would it be checked against the subcategory id (13 in this case) or the full cPath?

Here's what I got out of it.... approval "zero" since the site is set to zero, blank customer id since they're not logged in, and match the category in question. Also, this is the first case in that "switch" group:

case (CUSTOMERS_APPROVAL == '0' and $_SESSION['customer_id'] == ''  and $categories_id == '13'):
        // customer may browse but no prices
        return TEXT_LOGIN_FOR_PRICE_PRICE;

Or am I just completely misunderstanding your directions? Many thanks again for the assistance! :D

28 Jan 2009, 9:09 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Login for price on specific products

You are being a goober ... :cool:

Add a new case, and you have to find the syntax as I have to run:

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

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!

28 Jan 2009, 10:33 PM
#5
00goat avatar

00goat

New Zenner

Join Date:
May 2008
Posts:
26
Plugin Contributions:
0

Re: Login for price on specific products

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

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??

29 Jan 2009, 12:18 AM
#6
00goat avatar

00goat

New Zenner

Join Date:
May 2008
Posts:
26
Plugin Contributions:
0

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.

29 Jan 2009, 5:53 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ... :lookaroun

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!

29 Jan 2009, 4:03 PM
#8
00goat avatar

00goat

New Zenner

Join Date:
May 2008
Posts:
26
Plugin Contributions:
0

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. :clap:

2 Feb 2009, 6:17 PM
#9
agrapha avatar

agrapha

New Zenner

Join Date:
Feb 2009
Posts:
15
Plugin Contributions:
0

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:

        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? :blink:

3 Feb 2009, 5:44 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!

12 Feb 2009, 12:33 AM
#11
wolfsden avatar

wolfsden

New Zenner

Join Date:
Jan 2008
Posts:
10
Plugin Contributions:
0

Re: Login for price on specific products

agrapha:

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? :blink:

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. :blink:

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

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
https://www.wolfsdenarmoury.com

12 Feb 2009, 4:23 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Login for price on specific products

Check your Customer Details settings ...

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!

20 May 2009, 2:31 AM
#13
empirehorn avatar

empirehorn

New Zenner

Join Date:
May 2008
Posts:
8
Plugin Contributions:
0

Re: Login for price on specific products

I have been trying all evening to get something similar to this to work. I would like to have it where everything that is on special you have to log in to see the price. Could this be accomplished by adding a case like the following?

case ($_SESSION['customer_id'] == '' and $specials > '0'):
        // no prices for specials unless logged in
        return TEXT_LOGIN_FOR_PRICE_PRICE;
        break;

If $specials equals the specials price, it should only pull it when there is a special on the particular product that is being viewed, right? Any direction or help would be appreciated.

20 May 2009, 4:03 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Login for price on specific products

The Special can be looked for with:
zen_get_products_special_price($products_id, true)

a Sale can be looked for with:
zen_get_products_special_price($products_id, false)

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!