osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Display "CALL FOR PRICING" in product_listing.php

This is a discussion on Display "CALL FOR PRICING" in product_listing.php within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; My client has a bunch of products that he does not want to sell online, he the customers to CALL ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 09-22-2004, 05:13 AM
Member
 
Join Date: Apr 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
ReginaStelling
Default Display "CALL FOR PRICING" in product_listing.php

My client has a bunch of products that he does not want to sell online, he the customers to CALL FOR PRICING.

Yes,yes...I think this is very cheesey...but what to do? Anyway those products that he wants them to call about have a $0 price.


I found the code in the product_listing.php module that displays the prices:

case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
} else {
$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
}
break;



I'm not quite sure how to add this logic, but this is what I want to do:

IF PRODUCTS_PRICE = $0
THEN DISPLAY "CALL FOR PRICING'

Is that possible to do here? Is this the right place to add this code?

THANKS!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 09-22-2004, 06:52 AM
Member
 
Join Date: Aug 2004
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
wenzlerpaul
Default

Hi Regina,

First thing you have to do is BACKUP BACKUP AND LAST IS BACKUP!!! LOL


Here is what you do, inside product_listing.php file locate this code, approx line 107;

Code:
          case 'PRODUCT_LIST_PRICE':
            $lc_align = 'right';
            if (tep_not_null($listing['specials_new_products_price'])) {
              $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
            } else {
              $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
            }
            break;
change it to this code

Code:
          case 'PRODUCT_LIST_PRICE':
            $lc_align = 'right';
            if (tep_not_null($listing['specials_new_products_price'])) {
              $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
            }
	    elseif ($listing['products_price'] == 0){
              $lc_text = 'Call for price';
            } else {
              $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
            }
            break;
next step, locate this code approx line 131;

Code:
          case 'PRODUCT_LIST_BUY_NOW':
            $lc_align = 'center';
            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
            break;
        }
change it to this code

Code:
          case 'PRODUCT_LIST_BUY_NOW':
            $lc_align = 'center';
 	    if ($listing['products_price'] == 0){
            $lc_text = ' ';
            } else {

            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
            break;
	  }
        }
That is it for product_listing

next is you also have to change codes in product_info.php

locate this code approx line 93;
Code:
            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
then change it to

Code:
<td class="pageHeading" align="right" valign="top"><?php if ($product_info['products_price'] == 0){	}else{ echo $products_price;} ?></td>
locate this code approx line 213;

Code:
<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
change it to

Code:
<td class="main" align="right"><?php if ($product_info['products_price'] == 0){ echo "Call for Pricing"; }else{  echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); } ?></td>
I hope this helps you, also the price should be set to 0, else this will not work. Done on 2.2 version, fresh install.

Please tell me if it will work.

Paul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 03-09-2005, 10:22 AM
Lurker
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jbiggs77
Default

This works for me, except it's still showing $0.00 in the new products box, which I would like to change also. It may be because I have STS installed. Anyone know how to fix this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Remove "QTPRO" for "Option Type Feature" adam71o osCMax v2 Customization/Mods 3 01-10-2007 10:32 AM
"Per Customer Pricing" AND "Volume Pricing&qu Bah osCMax v2 Customization/Mods 0 12-03-2005 05:01 PM
"call for price" question.. dwsjr osCMax v2 Customization/Mods 0 11-26-2005 09:17 AM
Installing "Call for Price!" on osCMax v2.0 rgsat osCMax v2 Customization/Mods 1 09-26-2005 10:07 PM
How to display "special price" in Xsell displeyed stando007 osCMax v1.7 Discussion 0 01-19-2005 06:34 AM


All times are GMT -8. The time now is 04:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax