Results 1 to 3 of 3

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

      
  1. #1
    Member
    Join Date
    Apr 2004
    Posts
    35
    Rep Power
    0


    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!

  2. #2
    Member
    Join Date
    Aug 2004
    Posts
    41
    Rep Power
    0


    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

  3. #3
    Lurker
    Join Date
    Mar 2005
    Posts
    1
    Rep Power
    0


    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?

Similar Threads

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •