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

Provider username as a variable - working but won't display in product list?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-10-2012, 06:36 AM
 
loopsound loopsound is offline
 

Advanced Member
  
Join Date: Feb 2004
Posts: 85
 

Question Provider username as a variable - working but won't display in product list?

Thanks to PhilJ I am now able to use the provider username as a variable in my product information however I am stuck when it comes to how to get it to display in the product list.

In product.php

Code:
$product_owner = addslashes($product_info['provider']); if (!empty($product_owner)) { $provider_info = func_query_first("SELECT id, login, title, firstname, lastname FROM $sql_tbl[customers] WHERE id='$product_owner' AND usertype IN ('P','A')"); $smarty->assign('provider_info', $provider_info); }


then in product.tpl and products.tpl

Code:
{$provider_info.login}


But nothing displays in the product list only the product pages? Anyone know how adapt the following to make it display in the products list? I have contacted PhilJ but I am aware he is very busy at the moment
__________________
xcartgold 4.5.4
xcartgold 4.5.5
Reply With Quote
  #2  
Old 10-10-2012, 07:10 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Provider username as a variable - working but won't display in product list?

See below...
__________________
xcartmods.co.uk
Reply With Quote
  #3  
Old 10-10-2012, 07:35 AM
 
loopsound loopsound is offline
 

Advanced Member
  
Join Date: Feb 2004
Posts: 85
 

Default Re: Provider username as a variable - working but won't display in product list?

Sorry Phil,

Placed code in products.php and {$product.login} in products_t.tpl and products_audio.tpl and the value returned just says "Array" ?

Anything else, I can try? Seems strange that X-Cart don't have this by default anyway.
__________________
xcartgold 4.5.4
xcartgold 4.5.5
Reply With Quote
  #4  
Old 10-10-2012, 07:41 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Provider username as a variable - working but won't display in product list?

ok, use...

Quote:
if($products) {
foreach($products as $key=> $product)
$products[$key]["login"] = func_query_first_cell("SELECT login FROM $sql_tbl[customers] WHERE id=".$product["provider"]);
}

And use {$product.login}

Tested and working.
__________________
xcartmods.co.uk
Reply With Quote
  #5  
Old 10-10-2012, 07:55 AM
 
loopsound loopsound is offline
 

Advanced Member
  
Join Date: Feb 2004
Posts: 85
 

Default Re: Provider username as a variable - working but won't display in product list?

You star! Perfect! And now everyone will get the benefits of this

Thanks so much
__________________
xcartgold 4.5.4
xcartgold 4.5.5
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 07:35 PM.

   

 
X-Cart forums © 2001-2020