Can anyone give me a function/script that detects if a member is a free/paid one, and if it's for example, free, then how can I set the person to a different price for the same product that's publicly accessible (not just free members)?
We're not magic workers you know - or at least free magic workers. We can't, believe it or not, create with no information about where that info is on your site a function that will tell us. Or at least, nothing better than the thing below, which just decides at random <?php function IsPaidUser() { $random_answer = mt_rand(0, 1); return $random_answer; } ?> PHP:
I think the script is called a dynamic pricer or price descriminator. If anyone knows, please reply. Thanks.
step 1)- You need to make a registration system with a mark field of free/paid members in database. step 2)- if(logged_in()){ mysql_query = "SELECT * FROM your_database WHERE user_name ='$user_name_form'"; //or similar // next is you get a row fetch for data $free_or_paid = $above_row[x_number]; // 1 if free, 2 if paid if($free_or_paid == "1"){ $price1 = $fixed_price * 3;} // three folds of predefined normal price if($free_or_paid == "2"){ $price1 = $fixed_price;} // with this you can make many levels as you want } Code (php):
Hey thank you so much lovelycesar! step 1) already done. But the whole case is this: 1. My membership area is already set up with the step 1) above. 2. I want to integrate the site with FreeWebshop shopping cart because I just love its simplicity. 3. Public and free users of the cart will get regular/normal price for any products, but paid members from the membership site would pay less (get discount). So how to secure everything?
I don't understand clearly. For security, if you use cookies for login system, the thing is encryption user's cookies or so on. And you should use SSL too (https://yousite). I didn't get FreeWebshop, but it seems having a user management system already. You need to hack some modules to integrate your modification.