Forums / Setting Up Categories, Products, Attributes / Call for Price if Price is set to Zero

Call for Price if Price is set to Zero

Locked

Started by schatzy on 27 Jun 2006, 4:53 PM · Views: 6,256

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
27 Jun 2006, 4:53 PM
#1
schatzy avatar

schatzy

New Zenner

Join Date:
Jun 2006
Location:
Central Massachusetts
Posts:
46
Plugin Contributions:
0

Call for Price if Price is set to Zero

I have searched the forum and may be missing the obvious but i am looking to be able to have the "Call For Price" image or text show for products that have aprice of zero.

I am sure it can be done but is it a function of the admin to turn something on or do i need to use attributes or maybe a hard codeing in one of the files (i.e. tpl_product_info_display.php).

Any help or direction would be appriciated.

thanks in advance

Schatzy

27 Jun 2006, 6:32 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Call for Price if Price is set to Zero

Call for Price is based on the field:
product_is_call

being set to 1

If you want to update your products table for all Products with the products_price set to 0 should have products_is_call set to 1 you can ...

However, note that products_price = 0 does not always mean a Product Price of 0 ...

Because Products can be made up with Prices based on Priced by Attributes ... sometimes the better field to use is:
products_price_sorter

As that field is the bottom line lowest price of a product ...

You have to evaluate your database of Products to see which is "more true"

Note: Call for Price also can have prices on it ... the difference is, Call for Price products cannot be added to the Shopping Cart ...

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!

27 Jun 2006, 7:09 PM
#3
schatzy avatar

schatzy

New Zenner

Join Date:
Jun 2006
Location:
Central Massachusetts
Posts:
46
Plugin Contributions:
0

Re: Call for Price if Price is set to Zero

Thank you for the responce.

Some of our products are custom built only. The product page is there only for reference and ot show an example of the product.

Other products we well have avolitile price and we do not want to have aprice showing so that we do not get caught in a "must sell for" situation.

Thus having the price at zero(0) does not show the price.

I understand the part about the field products_price_sorter being the absolute lowest price and about the call for price not being able to be added to the cart (that's a good thing). So using the field products_price_sorter would work if i could somehow figure out how to get the "call for price" to use it.

I understand "if statement" but i have a very very limitied knowledge of PHP and MYSQL. Any suggestions on how to do this would be helpful.

Also i am not usre of what file i would need to modify to cause it to show when the final price is zero.

2 Jul 2006, 3:47 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Call for Price if Price is set to Zero

What version of Zen Cart are you using?

I am looking in v1.3.0.2 ... and have products_price set to nothing ...

And mark the Product is Call for Price: YES

And I see no price displayed just the Call for Price tag ...

NOTE: I also edited the Product which puts the 0.00 into the products_price field and it is still displaying properly ...

Do you have an URL where this is not working right?

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 Jul 2006, 11:14 AM
#5
schatzy avatar

schatzy

New Zenner

Join Date:
Jun 2006
Location:
Central Massachusetts
Posts:
46
Plugin Contributions:
0

Re: Call for Price if Price is set to Zero

I am using v1.3.02

Yes everything works just as you explained and i understand that that is the way it is designed to display.

If price is nothing - No Display

If price is 0.00 - No Display

If price is .01 or higher - Display Price

I want to change the way it works now.

What i am looking for is the following:

  1. if price is nothing - No Display

  2. if price is set to 0.00 - diplay "Call for Price" image (wihtout having to check the "Product is Call For Price")

  3. if price is 0.01 of more the display the price.

By doing it this way then i do not have to go into each one of the 3600 plus products (eventually over 15,000) and change the "Product is Call for Price" each and every time I have to change the price to zero. It would be an absolute nightmare to change all of these "Product is Call For Price" if it can not be done automatically on the price block.

It takes us long enough now when we have a price change to update a text file for uploading. Imagine how long it would take to update each individual item for "Price is Call For Price" after updateing the pirces.

Any ideas on how to make this happen would be greatly appriciated.

Thnaks in advance.

5 Jul 2006, 1:18 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Call for Price if Price is set to Zero

There is a fine distinction between nothing and 0.00

If a products_price is nothing ... and you edit ... it will become 0.00

There are other circumstances when this can happen as well ...

You can try to alter the display via the fuction but I do not think at that point you will be able to tell the difference between nothing and 0.00

Do you have any other identifier to distinguish between nothing and 0.00 on products_price?

Is this something where before adding the products to the database you could set anything that has products_price blank to a negative number that could be captured in the function to send back a blank?

Could the qualifier be blank or 0.00 price and not price_is_call = 1 to determin this should be a blank price?

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 Jul 2006, 1:51 PM
#7
schatzy avatar

schatzy

New Zenner

Join Date:
Jun 2006
Location:
Central Massachusetts
Posts:
46
Plugin Contributions:
0

Re: Call for Price if Price is set to Zero

I supose that when we do our pricing adjustments (every couple of days) that we could use a negative number (-0.10) to indicate that we need the "Call for Price" image to show up.

That would then mean that Zen Cart would need to show ONLY positive Prices, whick it dones not do now.

If statements could be writen to cause these adjustments to happen.

i.e.

If "prduct_price" = -0.10 then

price_is_call = 1
product_price_display = 0

else

price_is_call = 0
product_price_display = 1

Obvioulsy the correct or best variable would need to be used. But where to even start thinking about purtting these staments is where i am having a problem. I do not know enough about the linking structure yet within the pages to get started.

Any suggestions on where to start attempting such a mod would be helpfull.

5 Jul 2006, 4:39 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Call for Price if Price is set to Zero

One place would address all the display prices ...

Peek in the /includes/functions/functions_prices.php

The function zen_get_products_display_price manages the display ...

At the bottom, is where the Call for Price is handled ...

    // If Call for Price, Show it
    if ($product_check->fields['product_is_call']) {
      if (PRODUCTS_PRICE_IS_CALL_IMAGE_ON=='0') {
        $call_tag = '<br />' . PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT;
      } else {
        $call_tag = '<br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_CALL_FOR_PRICE, PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT);
      }
    }

The final display price is whatever the results are when you hit:

    return $final_display_price . $free_tag . $call_tag;

You can alter this return based on any condition you want either at the end of the function or build an IF to catch it right near the start after the information has been gathered in:

    $product_check = $db->Execute("select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'" . " limit 1");

Note: the add to cart buttons work in a similar manner ...

The function zen_get_buy_now_button

Decides if the button has to be changed ... it follows along the same logic as the price display so to speak ...

Just catch the data with an IF before the return happens to test for your new condition ...

NOTE: there are no overrides on the functions so you will need to keep a copy of the original files and your changed files ...

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!

23 Aug 2010, 4:32 PM
#9
rwslippey avatar

rwslippey

New Zenner

Join Date:
Jan 2010
Posts:
70
Plugin Contributions:
0

Re: Call for Price if Price is set to Zero

Hello,

I'm kind of stuck in the same place as the above poster, with a large number of products I need to appear as call for price simply by having a 0 in the DB for the product's price.

I can't seem to get it to display correctly with an IF statement.

I'm either getting call for price on all the products or no call for price at all...

Thanks

Rob