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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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 = '&nbsp;<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>&nbsp;'; } else { $lc_text = '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;'; } 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! |
| Sponsored Links | ||
| ||
|
#2
| |||
| |||
| 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 = '&nbsp;<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>&nbsp;';
} else {
$lc_text = '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;';
}
break;
Code: case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text = '&nbsp;<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>&nbsp;';
}
elseif ($listing['products_price'] == 0){
$lc_text = 'Call for price';
} else {
$lc_text = '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;';
}
break;
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>&nbsp;';
break;
}
Code: case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
if ($listing['products_price'] == 0){
$lc_text = '&nbsp;';
} 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>&nbsp;';
break;
}
}
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> Code: <td class="pageHeading" align="right" valign="top"><?php if ($product_info['products_price'] == 0){ }else{ echo $products_price;} ?></td>
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>
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>
Please tell me if it will work. Paul |
|
#3
| |||
| |||
| 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? |
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| 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 |