Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Disable Visitor Cart


B|ade

Recommended Posts

Hey guys,

 

Just wondering if it was possible at all to disable the visitors shopping cart.

 

All I was trying to do was implement an if statement in the product_info.php page, something like this:

 

<td class="main" align="center">

 

<?php if (tep_session_is_registered('customer_id')) { ?><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

 

For some reason that if statement doesn't work.

 

I figure all you have to do is disable the buy button on the product info page if a user is not signed in and display it when they are.

 

Any help would be appreciated.

Link to comment
Share on other sites

There is a way to hide the prices from non-logged in users (only a few lines to change).

 

If the customer tries to buy an item it jumps to the login/register page.

 

(Unfortunately I can not remember who posted the code, but I do remember it was in the tips and tricks forum).

 

This will allow the user to view all products without prices on the site before registering.

 

Sorry I can not be of more help than that only it was approx 8 months ago.

 

Cheers

 

Richard <_<

The solution is never too far away ...

Link to comment
Share on other sites

There is a way to hide the prices from non-logged in users (only a few lines to change).

 

If the customer tries to buy an item it jumps to the login/register page.

 

(Unfortunately I can not remember who posted the code, but I do remember it was in the tips and tricks forum).

 

This will allow the user to view all products without prices on the site before registering.

 

Sorry I can not be of more help than that only it was approx 8 months ago.

 

Cheers

 

Richard  <_<

 

if you look in to the includes/header.php you will find the links for the account... if tep_session..... { code}

 

simple wrap the code in to that and you will only be able to view it when logged in the only thing is i would just go ahead and create a account :-"

 

 

a view in the constribution tells me

http://www.oscommerce.com/community/contri...logged+in+users

 

gretz john

Link to comment
Share on other sites

Hey guys,

 

Just wondering if it was possible at all to disable the visitors shopping cart.

 

All I was trying to do was implement an if statement in the product_info.php page, something like this:

 

<td class="main" align="center">

 

<?php if (tep_session_is_registered('customer_id')) { ?><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

 

For some reason that if statement doesn't work.

 

I figure all you have to do is disable the buy button on the product info page if a user is not signed in and display it when they are.

 

Any help would be appreciated.

 

 

whats the prob m8, no button, button still there, button dont work ???

 

greetz john

 

btw it should be

<td class="main" align="center">

 

<?php if (tep_session_is_registered('customer_id')) { ?><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td><?php }?>

 

you where missing the closing tag ;-)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...