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

Get provider profile and seller address
 
Reply
   X-Cart forums > Considering X-Cart > Considering using X-Cart for my project
 
Thread Tools Search this Thread
  #1  
Old 10-03-2012, 10:49 PM
 
abdulpatrick abdulpatrick is offline
 

Newbie
  
Join Date: Sep 2012
Posts: 5
 

Default Get provider profile and seller address

i am trying to get some provider information like provider company and provider city on product detail page.

i have try adding custom function on product.php and func.product.php

this is script which i have try to get provider city.
Quote:
$provider_city = mysql_query("SELECT city FROM sql_table['seller_address'], sql_table['products'] WHERE productid='$productid'");
and then i call it on product_details.tpl with {$provider_city}

but it show nothing on product details page.

i still confused how to get it. can anyone help me..
__________________
Version 4.5.1
Reply With Quote
  #2  
Old 10-04-2012, 05:24 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Get provider profile and seller address

Have you assigned it to Smarty? In your php you need to assign variables to smarty if you want to display them in a template.

For example:
$smarty->assign('provider_city', $provider_city);

If still nothing shows up, check to make sure your query is working properly. Try assigning provider city to "hello world" temporarily, just to ensure you are talking to yourself.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 10-04-2012, 06:21 AM
 
BritSteve BritSteve is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 339
 

Default Re: Get provider profile and seller address

The SQL query needs a join from the seller_address table to the products table.

Steve
__________________
Version 4.1.8 & 4.1.9
ezcheckout4.1.x
cdseolinks2
product_metatags41x
shipping_per_product41x

http://www.earthsmagic.com
Reply With Quote
  #4  
Old 10-04-2012, 09:18 PM
 
abdulpatrick abdulpatrick is offline
 

Newbie
  
Join Date: Sep 2012
Posts: 5
 

Default Re: Get provider profile and seller address

i have figured it out like @totaltec said.

this is my new script. and it works
PHP Code:
$provider_city func_query_first_cell("SELECT city FROM $sql_tbl[seller_addresses]$sql_tbl[products] WHERE productid = '$productid'") AND $sql_tbl[seller_addresses].userid $sql_tbl[products].provider;

$smarty->assign('provider_city'$provider_city);

$provider_company func_query_first_cell("SELECT company FROM $sql_tbl[customers]$sql_tbl[products] WHERE productid = '$productid' AND $sql_tbl[customers].id = $sql_tbl[products].provider");

$smarty->assign('provider_company'$provider_company); 

and it show perfectly now.
thanks to you all guys.
Reply With Quote
Reply
   X-Cart forums > Considering X-Cart > Considering using X-Cart for my project


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:49 PM.

   

 
X-Cart forums © 2001-2018