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

Pulling User Information into product.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-10-2004, 04:28 PM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default Pulling User Information into product.tpl

Hi all - been bashing my head about this for about 4 hours now and can't seem to get it straight - wondering if somebody out there is experiencing the same or has a fix -

I've added an extra field into the xcart_customers table - "wishlist_only" - and I've marked people with a "Y" or null.

I'm trying to write an if/then so that if this field contains a "Y" I don't display the "add to cart" button in product.tpl.

So...this is how it worked in 3.5.8 - but now that I'm on 4.0.4 - it doesn't work.

{if $user_wishlist_only ne ""} do this {/if}

Doesn't work on product.tpl anymore - and I"m assuming if I was trying to pull address information or something into that template that wouldn't work either without correcting my syntax somehow above.

Anybody know what the correct syntax is for pulling user info into that template?

I've tried $user. - $userinfo. - $user_ - $userinfo_ - all sorts of combos and can't seem to find anything that will work anymore.

??

Any help is greatly appreciated ;o)

Instinctual
Colorado
X-Cart 3.5.x - 4.0.4
Reply With Quote
  #2  
Old 10-11-2004, 08:08 AM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default Fixed

Ok, so with help from my good friend Carrie @ BCS - here is how it works:

You must edit auth.php - add these lines in at the end before the ?>

$user_wishlist_only=array_pop(func_query_first("se lect wishlist_only from $sql_tbl[customers] where login='$login'"));

$smarty->assign("user_wishlist_only",$user_wishlist_only);

Then, in most templates, this variable will work to pull customer info:

{$user_b_address} for example.

Cheers )

Instinctual
Colorado
X-Cart Versions 3.5.x - 4.0.4
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 03:21 PM.

   

 
X-Cart forums © 2001-2020