Forums / Templates, Stylesheets, Page Layout / How to hide price if "Call for price"

How to hide price if "Call for price"

Started by peter_m_dodge on 18 Nov 2013, 11:40 AM · Views: 2,572

Results 1 to 11 of 11
18 Nov 2013, 11:40 AM
#1
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

How to hide price if "Call for price"

Good morning,
Certain manufacturers I deal with do not allow me to advertise their prices online, so I have marked those products as "call for price". However, I still want to keep a record of the MSRP for the item in my listings, so that I don't have to keep going to the catalog or have to maintain a seperate price list to look up prices for quotes. How would I code it so the price does not show if "call for price" is set on the item?
Cheers,
Peter M Dodge

18 Nov 2013, 2:53 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: How to hide price if "Call for price"

While being able to display the price on Products marked as Call for Price is a built in feature, you can edit the function zen_get_products_display_price in:
/includes/functions/functions_price.php

with the code in RED:

// show case only
    if (STORE_STATUS != '0') {
      if (STORE_STATUS == '1') {
        return '';
      }
    }

[B]// bof: block price on call for price    
if (zen_products_lookup($products_id, 'product_is_call')) {
  return '';
}
// eof: block price on call for price    
[/B]
    // $new_fields = ', product_is_free, product_is_call, product_is_showroom_only';

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!

18 Nov 2013, 2:57 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to hide price if "Call for price"

Ajeh:

While being able to display the price on Products marked as Call for Price is a built in feature, you can edit the function zen_get_products_display_price in:
/includes/functions/functions_price.php

with the code in RED:

// show case only
if (STORE_STATUS != '0') {
if (STORE_STATUS == '1') {
return '';
}
}

[B]// bof: block price on call for price
if (zen_products_lookup($products_id, 'product_is_call')) {
return '';
}
// eof: block price on call for price
[/B]

// $new_fields = ', product_is_free, product_is_call, product_is_showroom_only';


Curious, what affect (if any) would this have on a product that is marked as to call and is setup for price by attribute where it would normally state something similar to starting at: (currency indicator)XX.XX? and the meta tags... All of that taken care of by the above?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Nov 2013, 3:45 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: How to hide price if "Call for price"

Should Attributes show at all on Call for Price products?

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!

18 Nov 2013, 8:05 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to hide price if "Call for price"

Ajeh:

Should Attributes show at all on Call for Price products?

Ultimately, I would think that is up to the store owner. Not to mention that in some cases the price shows adjacent to the attribute (though seems like that would be set to 0 or an empty pair of parenthesis possibly, etc...) Some attributes provide "options" that add no price difference, while others affect the price of the item, again depending on the setup by the store owner. If the question asked (which is in part back to me) of whether ZC will provide the attributes of a product for viewing when it is marked "call for price", then I do not know that answer at this time and is partially the source of my question as it relates to hiding the price of a product marked as such...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Nov 2013, 8:48 PM
#6
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: How to hide price if "Call for price"

My understanding is that a product marked "call for price" is a product that is unable to be added to the shopping cart therefore showing attributes that have a $ value or not should also be hidden.

Why show attributes at all?

If one is to mark products as "call for price", one should and hopefully be ready and willing to sell, up-sell (attributes) and close the sale over the phone and shouldn't waste time setting attributes for products marked "call for price".

To the OP, Peter,

Take a look in the plugin section for "Add to Cart to see Price". Allows you to show MSRP upfront (product listing pages) and show "your price" when added to cart (shopping cart page). This is acceptable by most manufacturers and you still qualify for manufacturer co-op dollars if that's a concern.

18 Nov 2013, 8:56 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to hide price if "Call for price"

rbarbour:

My understanding is that a product marked "call for price" is a product that is unable to be added to the shopping cart therefore showing attributes that have a $ value or not should also be hidden.

Why show attributes at all?

If one is to mark products as "call for price", one should and hopefully be ready and willing to sell, up-sell (attributes) and close the sale over the phone and shouldn't waste time setting attributes for products marked "call for price".

Excellent point. I would think that it would be a good idea to include in the product description something about the additional options that may be available to entice that conversation and get the customer to pick this store as the one to go with. I could be wrong.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Nov 2013, 9:19 PM
#8
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: How to hide price if "Call for price"

mc12345678:

Excellent point. I would think that it would be a good idea to include in the product description something about the additional options that may be available to entice that conversation and get the customer to pick this store as the one to go with. I could be wrong.

No I agree if the OP decides to stay with the "call for price" option.

Otherwise using the plugin I mentioned, add attributes and show the MAP price or lower price on the shopping cart page only and get the sale.

18 Nov 2013, 11:42 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: How to hide price if "Call for price"

A better solution, and this also removes the price from the Attributes on Call for Price modules is to use:

on the file:
/includes/functions/functions_prices.php

at the bottom of the function zen_get_products_display_price

    // 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);
      }
    }
[B]// bof: block price on call for price
if (zen_products_lookup($products_id, 'product_is_call')) {
  $final_display_price = '';
}
// eof: block price on call for price
[/B]
    return $final_display_price . $free_tag . $call_tag;
  }

On the module:
/includes/modules/attributes.php

around line 164:

                    $products_options_display_price .= $price_onetime;
[B]// bof: block price on call for price
if (zen_products_lookup((int)$_GET['products_id'], 'product_is_call')) {
  $products_options_display_price = '';
}
// eof: block price on call for price
[/B]
                  } // approve

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!

19 Nov 2013, 12:11 AM
#10
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: How to hide price if "Call for price"

Ajeh:

A better solution, and this also removes the price from the Attributes on Call for Price modules is to use:

on the file:
/includes/functions/functions_prices.php

at the bottom of the function zen_get_products_display_price

// 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);
  }
}

[B]// bof: block price on call for price
if (zen_products_lookup($products_id, 'product_is_call')) {
$final_display_price = '';
}
// eof: block price on call for price
[/B]

return $final_display_price . $free_tag . $call_tag;
}

> 
> On the module:
> /includes/modules/attributes.php
> 
> around line 164:
> ```
                    $products_options_display_price .= $price_onetime;
[B]// bof: block price on call for price
if (zen_products_lookup((int)$_GET['products_id'], 'product_is_call')) {
  $products_options_display_price = '';
}
// eof: block price on call for price
[/B]
                  } // approve

As always, your solution works beautifully :smile:

19 Nov 2013, 12:31 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: How to hide price if "Call for price"

Thanks for the update that all is now right in the world to mask the prices for you on your Call for Price products ... :smile:

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!