Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

User Switch???


Guest

Recommended Posts

Hi there,

 

Just wondering if anyone could help me with this one?

 

I would like to know if it is at all possible using some kind of code to say :

 

"If a person is logged in - show them this information for a product" or "If they are not logged in - show them this shorter information"

 

What I would like to use this for is so that I can auto create users then when they log in they will see a long description of the item with some download links. If they are not logged in then they will just get a description and maybe a demo download link or something to that nature.

 

Is there any code that can be placed in that says if a user is logged in?

 

Also how would I write the product description so that it has two parts to it?

 

Any help at all with this would be greatly appreciated.

 

Regards,

 

Mark Bowen

Link to comment
Share on other sites

Hi Emmett,

 

Thanks for the reply. Would you happen to know how I would add in some code so that when entering the product descriptions then the first half of a description - say up to a html tag <!-- LONG DESCRIPTION --> would show for logged out (non - registered users) and for users that are registered and logged in they would get to see the whole description?

 

Any help with this would be greatly appreciated.

 

Regards,

 

Mark

Link to comment
Share on other sites

you would probably need to create a second description field in the db - so that u can split the description in two.

 

then use the if clause in product_info.php

 

that is the general jist anyway.

Your online success is Paramount.

Link to comment
Share on other sites

Hi Emmett,

 

Thanks for the fast reply!!

 

I'm not exactly too sure how I would go about doing all of that. Could you help me out at all. One idea I did have was would it be possible to use another language so that if they are logged in it shows the product description from another language so that I can put the short descriptions into one language and then when they log in the language gets automatically changed but make sure that I take off all languages selection boxes so that there is no way that anyone can change / find out the language and go there directly?

 

If not the languages idea then could you possibly push me some more information about what you were originally talking about so I can see if I can get it working?

 

Thanks for all your help with this so far.

 

Regards,

 

Mark

Link to comment
Share on other sites

Hi Emmett,

 

Thanks for the reply. Would you happen to know how I would add in some code so that when entering the product descriptions then the first half of a description - say up to a html tag <!-- LONG DESCRIPTION --> would show for logged out (non - registered users) and for users that are registered and logged in they would get to see the whole description?

 

Any help with this would be greatly appreciated.

 

Regards,

 

Mark

 

why not use a substring of the description of not logged on.

Treasurer MFC

Link to comment
Share on other sites

Amanda's idea which I think is along the same line as yours is another option.

 

When writing the description - separate the two parts with a string e.g.

 

First bit

 

XXXX.

 

Second bit

 

Then in product info if customer not logged in it outputs everything pre the string XXXX and if they are logged in it outputs it all but strips out the XXXX.

 

I think that is what Amanda means.

 

Is that any easier ?

Your online success is Paramount.

Link to comment
Share on other sites

Amanda's idea which I think is along the same line as yours is another option.

 

When writing the description - separate the two parts with a string e.g.

 

First bit

 

XXXX.

 

Second bit

 

Then in product info if customer not logged in it outputs everything pre the string XXXX and if they are logged in it outputs it all but strips out the XXXX.

 

I think that is what Amanda means.

 

Is that any easier ?

 

 

something like this :

 

if not logged on {

 

$break_character = '^';

 

$position = strpos($description, $break_character);

echo substr($description,0, $position);

 

} else {

 

$description = str_replace($description, ^, ""); // get rid of the break character

echo $description;

 

}

Treasurer MFC

Link to comment
Share on other sites

Hi Emmett & Amanda,

 

Thanks for the fast replies again. I will look into that. It sounds like it will do the job that I need!

Not really too sure how to do it but I will go and get out the PHP manual and look into it all so thanks for all of that!

 

P.S. I will probably be back again though knowing me, I'm very new to the OSCommerce side of programming and without knowing what all the tep_functions do and all the variables everything becomes a little harder to figure out!! :)

 

 

Thanks for all your help.

 

Best wishes,

 

Mark

Link to comment
Share on other sites

Hi Emmett & Amanda,

 

Just to say an absolutely massive thanks for all your help regarding this.

I have managed to get the cart working exactly how I need it to!

 

This will be used so that people who are not logged in will get a short description with maybe a demo download link yet people who are registered and who log in will be able to see the whole description and all download links.

 

I am going to be adding this to the contributions section with thanks to you both under the name of 'Subscription Downloads Mod'.

 

Once again thanks for all your help with this.

 

Best wishes,

 

Mark

Link to comment
Share on other sites

Hi Emmett,

 

Thanks! I couldn't have done it without all the help from yourself and Amanda though so thanks for that!

 

Best wishes,

 

Mark

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...