Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC 2.1 and showing/hiding prices


Sj-2

Recommended Posts

Hello everyone,

 

I've got a small question.

 

I'm using OSC 2.1 for my webshop and wanted to use the 'show prices to logged-in users only' contribution. This doesn't work :(

 

Can anyone tell me how I can can get the same result (show prices, shopping cart, etc. only to logged in users) but with another contrib or solution?

 

Thanks in advance,

 

John

Link to comment
Share on other sites

You can hide anything until logon simply by using:

 

<?php
if (tep_session_is_registered('customer_id')) {

STUFF_YOU_WISH_TO_HIDE

} ?>

 

For prices the best place for this is the very last function in catalog/includes/classes/currencies.php:

 

    

function display_price($products_price, $products_tax, $quantity = 1) {
if (tep_session_is_registered('customer_id')) {
     return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
   } else {
     return '';
 }
}

 

You will need to hide the cart also.

 

Matti

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...