Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Prices for Logged-In Users Only with


Guest

Recommended Posts

Hi been trying to setup the "Prices for Logged-In Users Only" contribution(http://www.oscommerce.com/community/contributions,601) but having hassles implementing.

 

Step 1 instructions are

 

At the very end of catalog/includes/classes/currencies.php:

FIND THIS CODE:

function display_price($products_price, $products_tax, $quantity = 1) {
         if (TAX_INFO_ONOFF == 'Enabled') {
         $return = $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
         global $tag;
         $return .= "<br><div class=\"tax_info\">" . sprintf(TEXT_INFO_TAX, $products_tax , tep_href_link(FILENAME_SHIPPING)) . "</div>";
         return $return;
         } else {
         return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
       }
      }

       function display_price2($products_price, $products_tax, $quantity = 1) {
         if (TAX_INFO_ONOFF == 'Enabled') {
         $return = $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
         global $tag;
         return $return;
         } else {
         return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
       }
      }
   }
?>

AND REPLACE WITH THIS CODE:

function display_price($products_price, $products_tax, $quantity = 1) {
if (!tep_session_is_registered('customer_id')) {
return '<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . LOGIN_FOR_PRICE . '</a>';
} else {
if (TAX_INFO_ONOFF == 'Enabled') {
$return = $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
global $tag;
$return .= "<br><div class=\"tax_info\">" . sprintf(TEXT_INFO_TAX, $products_tax , tep_href_link(FILENAME_SHIPPING)) . "</div>";
return $return;
} else {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
}
}

function display_price2($products_price, $products_tax, $quantity = 1) {
if (!tep_session_is_registered('customer_id')) {
return '<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . LOGIN_FOR_PRICE . '</a>';
} else {
if (TAX_INFO_ONOFF == 'Enabled') {
$return = $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
global $tag;
return $return;
} else {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
}
}
}
?>

 

However I cannot find the code mentioned!.

 

the code I have is

   function display_price($products_price, $products_tax, $quantity = 1) {
     return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

 

Any guidance or help?

The release I'm running is - osCommerce 2.2-MS2

Link to comment
Share on other sites

Never mind - fixed issue witha clearer head this morning.

 

I found the 4.3 version contrib which matched the code I was using and was able to get it up and running fine.

 

Great contrib (and just goes to show its worth taking a break and actually getting some sleep sometimes!)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...