Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 1 of 1

Thread: Extended Call (Contact) For Price

  1. #1
    osCMax Development Team

    Extended Call (Contact) For Price

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Lightbulb Extended Call (Contact) For Price

    In response to a client that was using zero prices because "Contact For Price" was inappropriate.

    1. catalog/includes/languages/english/core.php

    Below
    Code:
    // LINE ADDED: MOD - EASY CALL FOR PRICE v1.4
    define('TEXT_CALL_FOR_PRICE', 'Contact for Price!');
    Add
    Code:
    define('TEXT_PRODUCT_UNAVAILABLE', 'Unavailable');
    Optionally
    Code:
    define('TEXT_PRODUCT_FREE', 'Free!');
    2. catalog/includes/application_top.php

    Below
    Code:
    // call for price
      define ('CALL_FOR_PRICE_VALUE', -1);
    Add
    Code:
      define ('UNAVAILABLE_VALUE', -2);
    3. catalog/includes/classes/PriceFormatter.php
    Look in function addTaxShippingDisplay() - around line 291
    change it to read
    Code:
      function addTaxShippingDisplay() {
        // Add functionality to display tax rate and shipping link near prices
        $ts_text = '';
        if ($this->thePrice != (CALL_FOR_PRICE_VALUE || UNAVAILABLE_VALUE ) && SHOW_TAX_RATE_NEAR_PRICE == 'true') {
          if (DISPLAY_PRICE_WITH_TAX == 'true') {
            $ts_text .= '<br><span class="tax_near_price">' . TAX_RATE_NEAR_PRICE_INC . tep_get_tax_rate($this->taxClass) . '%</span>&nbsp;';
    Notice the added check for UNAVAILABLE_VALUE


    4. catalog/templates/your_template/content/product_info.tpl.php
    Above
    Code:
                  } elseif ($product_info['products_status'] == '2') {
                    echo TEXT_PRODUCT_DISCONTINUED;
                  } else { echo $products_price; }?>
    Add
    Code:
                  } elseif ( ($hi_product_price == UNAVAILABLE_VALUE) || ($lo_product_price == UNAVAILABLE_VALUE) ) {
                    echo TEXT_PRODUCT_UNAVAILABLE;
    Optionally, add this instead
    Code:
                  } elseif ( ($hi_product_price == UNAVAILABLE_VALUE) || ($lo_product_price == UNAVAILABLE_VALUE) ) {
                    echo TEXT_PRODUCT_UNAVAILABLE;
                  } elseif ( ($hi_product_price == 0) && ($lo_product_price == 0) ) {
                    echo TEXT_PRODUCT_FREE;
    5. One bug to resolve - the index pages with still display "Contact For Price!" :'(
    So...
    catalog/includes/classes/PriceFormatter.php

    Find the un-commented out function getPriceStringShort() - about line 420
    Add below
    Code:
      function getPriceStringShort() {
        global $currencies;
    The following
    Code:
         if ($this->thePrice == UNAVAILABLE_VALUE ) {
             $lc_text = TEXT_PRODUCT_UNAVAILABLE;
            return $lc_text;
            break;
         }
    It's not elegant and it's not good code but it works!
    If using the Free! option then use the following instead
    Code:
         if ($this->thePrice == UNAVAILABLE_VALUE ) {
             $lc_text = '<big>' . TEXT_PRODUCT_UNAVAILABLE . '</big>';
            return $lc_text;
            break;
         }
         if ($this->thePrice == 0 ) {
             $lc_text = '<big>' .TEXT_PRODUCT_FREE. '</big>';
            return $lc_text;
            break;
         }
    Last edited by ridexbuilder; 10-16-2013 at 08:27 AM. Reason: poor bug fix

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

Similar Threads

  1. [osCmax v2.5x] Call for price mod help
    By cujo in forum osCMax v2 Features Discussion
    Replies: 12
    Last Post: 01-12-2012, 08:36 AM
  2. Call for price ?
    By wkdwich in forum osCmax v2 Customization/Mods
    Replies: 9
    Last Post: 06-29-2010, 05:53 AM
  3. Call for price
    By scott2kuk in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 03-22-2007, 03:50 AM
  4. Easy Call for Price
    By michael_s in forum osCmax Projects Discussion
    Replies: 0
    Last Post: 12-31-2006, 07:58 AM
  5. Has anyone seen a Call For Price mod?
    By carver6 in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 01-26-2004, 02:38 AM

Bookmarks

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
  •