cgchris99 Posted June 18, 2003 Posted June 18, 2003 I have some items that the manufacturer will not let me advertise a price below his suggested price. So if I put an email/call for price and can tell them the price over the phone or by email. Anyone know how to do this? Thanks
cgchris99 Posted June 18, 2003 Author Posted June 18, 2003 So how do I implement the email/call for price on oscommerce? thx
Guest Posted June 19, 2003 Posted June 19, 2003 Hi, This is what I'm using. Linda Mcgrath has a freecallforprice 4.0 contribution out. includes/application_top.php put this: // define('PRODUCTS_PRICE_DISPLAY_CALL_FOR_PRICE',DIR_WS_IMAGE . tep_image('call_for_price.jpg'),'Call for Price'); define('PRODUCTS_PRICE_DISPLAY_CALL_FOR_PRICE','Call for Price'); Anything you want to read "Call for Price" or what ever you define PRODUCTS_PRICE_DISPLAY_CALL_FOR_PRICE as ... I put the text and image example there, will be what the calls to that function give when the products_price is 999999 All prices pass through one of two functions in the /includes/classes/currencies.php Either via function display_price or function format 90% are through function display_price PUT THIS IN catalog/includes/classes/currencies.php If you evaluate the $products_price you can change what is displayed: function display_price($products_price, $products_tax, $quantity = 1) { if ($products_price == 999999) { return PRODUCTS_PRICE_DISPLAY_CALL_FOR_PRICE; } else { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } } } ?> Note: on prices for products_price and special this function gets called twice in a row. So you have to be careful. If you get weird results. Let me know and I can piece something together. Set the price on products in the admin area that you want Call for Price on to 999999. The next thing is the product_info.php submit button. You do not want them buying this. I have it go to the contact_us.php <?php // BOF: WebMakers.com Added: Call for Price if ($product_info['products_price']==999999) { ?> <td align="right" class="main"><a href="<?php echo tep_href_link(FILENAME_CONTACT_US); ?>">Contact Us</a></td> <?php } else { ?> <td align="right" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <?php } // EOF: WebMakers.com Added: Call for Price ?> You will need to do something similar for anywhere there is an "In cart" or "Buy now" button. Yell if you need help on the other areas like What's New listing or Products Listing etc. ======================================== The Buy Now buttons are handled by /includes/modules/product_listing.php NOTE: There is no need for this code if your site has the multiple products installed across the page instead of down. NEW CODE: This is the only change needed to hide the buy_now button: case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; if ($listing['products_price']=='999999') { $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', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a> '; } break; You could make that read something like More Info ... and be a link to the products page.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.