View Single Post
  #4  
Old 10-31-2013, 06:57 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Access $product from Static Page

To pull in a product array, I typically use the function func_search_products

Here is an example from a module I am building for a client, it refernces some non-standard x-cart tables so won;t work for you, but it should get the juices flowing and point you in th right direction:
PHP Code:
$product_kit_items func_search_products(
    array(
        
'fields'        => array("$sql_tbl[products].*""$sql_tbl[product_kit_items].*"),
        
'from_tbls'     => array('product_kit_items'=>''),
        
//'skip_tables'   => XCSearchProducts::getSkipTablesByTemplate(XCSearchProducts::SKIP_ALL_POSSIBLE),
        
'query'         => " AND $sql_tbl[products].productid = $sql_tbl[product_kit_items].productid AND $sql_tbl[product_kit_items].parentid = '$productid'",
    ),
    
$user_account['membershipid'],
    
"$sql_tbl[product_kit_items].orderby, product",
    
"",
    
false,
    
false,
    
true
); 
__________________
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