Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hide products to unregistered users


Recommended Posts

Hello, my question is this, I installed version 2.3.1 and I have to hide the product or price for users who are not registered.

They know how to fix this?

I've tried several addons, but are not compatible with this version.

Thank you very much.

Edited by parawebo
Link to comment
Share on other sites

Para,

 

What is the error message you are receiving after you tried to install one of the contributions ? Which one was it ?

 

 

 

Chris

Link to comment
Share on other sites

I found this addon, but applying the code did not work, because it is compatible with an older version.

 

Thanks

 

=======================================================================

This bug fix will remove BUY NOW button when customer is not loged in:

edit file in:

 

/catalog/includes/modules/product_listing.php

find:

 

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;

 

and replace with:

 

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

if (( STORE_SHOW_GUESTS_PRICES == 'true' ) && (! tep_session_is_registered('customer_id') ) ) {

} 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;

}

 

 

 

find in /catalog/includes/modules/products_new.php around line 90

 

<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>

 

and replace with

 

<td align="right" valign="middle" class="main"><?php if (( STORE_SHOW_GUESTS_PRICES == 'true' ) && (! tep_session_is_registered('customer_id') ) ) {

} else {

echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; } ?></td>

 

=====================================================================

Edited by parawebo
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...