Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

common if/then modifications I make to x-cart...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 10-26-2005, 05:52 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

Default

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
Reply With Quote
  #32  
Old 10-27-2005, 06:03 AM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default

lol, alright, let's get serious about this

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!
__________________
Instinctual
8,000 feet up in the Rocky Mountains of Colorado
X-Cart Versions 3.5.x - 4.0.x

IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind.
Reply With Quote
  #33  
Old 10-27-2005, 01:32 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

Default

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
Reply With Quote
  #34  
Old 10-27-2005, 04:47 PM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default

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)
__________________
Instinctual
8,000 feet up in the Rocky Mountains of Colorado
X-Cart Versions 3.5.x - 4.0.x

IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind.
Reply With Quote
  #35  
Old 10-27-2005, 04:56 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

Default

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
Reply With Quote
  #36  
Old 10-27-2005, 05:02 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

Default

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
Reply With Quote
  #37  
Old 10-27-2005, 05:24 PM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default

Cheers!

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

I'll edit my previous posts to all point to the correct one for the solution ;o) You may want to do the same.
__________________
Instinctual
8,000 feet up in the Rocky Mountains of Colorado
X-Cart Versions 3.5.x - 4.0.x

IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind.
Reply With Quote
  #38  
Old 10-27-2005, 05:29 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

Default

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
Reply With Quote
  #39  
Old 10-27-2005, 09:35 PM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default

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!
__________________
Instinctual
8,000 feet up in the Rocky Mountains of Colorado
X-Cart Versions 3.5.x - 4.0.x

IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind.
Reply With Quote
  #40  
Old 11-30-2005, 12:09 PM
 
danbass danbass is offline
 

Member
  
Join Date: Mar 2005
Posts: 13
 

Default

Quote:
Originally Posted by instinctual
lol, alright, let's get serious about this

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.
__________________
Dan
XCart 4.1.6 Pro
XCart 4.1.6 Gold
Redhat 7.2
Perl 5.006001
PHP 4.1.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020