X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   common if/then modifications I make to x-cart... (https://forum.x-cart.com/showthread.php?t=8881)

chrisinoz 10-26-2005 05:52 PM

Not that I know of Mike.

If we can't work it out I'll go to xcart for the solution and post it here.

I want to mainly use it for a Club /Premium member menu only to show for them.



Cheers

Chris

instinctual 10-27-2005 06:03 AM

lol, alright, let's get serious about this 8)

So - we can assign variables for sure - that shouldn't be a problem - here is what we should be working with from what I can tell - and I'd like to put this into your auth.php file.

Code:


$membershiplevel=array_pop(func_query_first("select membership from $sql_tbl[customers] where login='$login'"));
$smarty->assign("membershiplevel",$membershiplevel);


Now, this really should do the trick I would think - may need some slight tweaking though so lemme know. You can pretty much stick this at the end of the file...

Then your if/then tag would look like:

Code:

{if $membershiplevel eq 'Premium'}Do it!{/if}

Cheers!

chrisinoz 10-27-2005 01:32 PM

Hi Instinctual

Added to home.tpl


Code:

{if $membershiplevel eq 'Premium'}Do it!{/if}

Added the code to auth.php

Code:


#
# membership levels
#

$membershiplevel=array_pop(func_query_first("select membership from $sql_tbl[customers] where login='$login'"));
$smarty->assign("membershiplevel",$membershiplevel);



No joy yet.

FYI this is the site I am working on, though that won't help of course. Only one product so far of course as I test and build.

www.seriouslygourmet.com.au/index.php

Logging in with

peter
piper

Who is a Premium member

Cheers
4.016

instinctual 10-27-2005 04:47 PM

Make sure you're adding this after the very last "}" in auth.php - (sorry, not sure what your smarty/php experience is). Or you can add it above the $pages_menu func query if you like as well.

Nice site btw - really good layout - most people don't do the expanding/contracting design, I likey ;o)

chrisinoz 10-27-2005 04:56 PM

Hey Instinctual

It's where I put it in auth.php that was the problem.

It works like a treat now!

So for others who read this - the solution at Posted: Thu Oct 27, 2005 9:03 am is the crroect one. Check where you place it in auth.

I really appreciate you sticking with this one. Others will surely benefit

Cheers

Chris

chrisinoz 10-27-2005 05:02 PM

Further to this - This will work a treat with a small mod I had x-cart do with my embedded static pages.

I can make a page but select it so that it does not display in the standard help menu but is still available.

This way I can make up a new menu for only members and load it with static page urls I have created. Then with what Instinctual has worked through I can now make this menu only show when a person logs in as a Member.

Cheers

Chris
4.016

instinctual 10-27-2005 05:24 PM

Cheers!

I will be sure to hoot and holler as I'm ripping through some singletrack on my motox bike tomorrow :lol:

I'll edit my previous posts to all point to the correct one for the solution ;o) You may want to do the same.

chrisinoz 10-27-2005 05:29 PM

My future son-in-law would love to join you 8000' in the Rockies - pity he is in Australia. He has a WR450 Yamaha trail bike.

I'll look at my posts also.

Cheers

Chris

instinctual 10-27-2005 09:35 PM

lol, I'm headin' upto 13k tomorrow - will be the last ride of the season that high, but what a great time of the year for it ;o)

Takin' the YZ250F - should be some good times, woot!

danbass 11-30-2005 12:09 PM

Quote:

Originally Posted by instinctual
lol, alright, let's get serious about this 8)

So - we can assign variables for sure - that shouldn't be a problem - here is what we should be working with from what I can tell - and I'd like to put this into your auth.php file.

Code:


$membershiplevel=array_pop(func_query_first("select membership from $sql_tbl[customers] where login='$login'"));
$smarty->assign("membershiplevel",$membershiplevel);


Now, this really should do the trick I would think - may need some slight tweaking though so lemme know. You can pretty much stick this at the end of the file...

Then your if/then tag would look like:

Code:

{if $membershiplevel eq 'Premium'}Do it!{/if}

Cheers!


Can this be altered so that people who are unregistered can see a specific membership level. I want the unregistered users to see the Retail products and registered users to see the products based on their membership level.


All times are GMT -8. The time now is 05:04 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.