Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hide BUY NOW and Add To Cart button when customer is not logged in(updated please)


syntax.error

Recommended Posts

Posted

/includes/functions/html_output.php

 

Find:

 

function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {
   static $button_counter = 1;

 

Add after:

 

  
   if ( (!tep_session_is_registered('customer_id')) && ( ($title == IMAGE_BUTTON_BUY_NOW) || ($title == IMAGE_BUTTON_IN_CART) ) ) {
     return NULL;
   }    

 

 

  • 7 months later...
Posted

/includes/functions/html_output.php

 

Find:

 

function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {
static $button_counter = 1;

 

Add after:

 

if ( (!tep_session_is_registered('customer_id')) && ( ($title == IMAGE_BUTTON_BUY_NOW) || ($title == IMAGE_BUTTON_IN_CART) ) ) {
return NULL;
}

 

Thank you so much!

 

It works!!!

 

:thumbsup:

 

Sorry, I tried but the "Add To Cart" button is still showing even if I am not log in.

 

Below is my code:

function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {



static $button_counter = 1;

if ( (!tep_session_is_registered('customer_id')) && ( ($title == IMAGE_BUTTON_BUY_NOW) || ($title == IMAGE_BUTTON_IN_CART) ) ) {
return NULL;
}

$types = array('submit', 'button', 'reset');

 

Am I doing it in right way?Thanks

Archived

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

×
×
  • Create New...