X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Access $product from Static Page (https://forum.x-cart.com/showthread.php?t=67684)

RLLC 09-05-2013 10:09 AM

Access $product from Static Page
 
Hello,

What do I need to import to be able to access $product from a static page? More specifically, I'm trying to access the smarty tag variable {$product.productcode}...

Thanks!

Jon 09-05-2013 01:23 PM

Re: Access $product from Static Page
 
You will need to query it in pages.php or you won't have access to it.

cheap eyeglasses 10-30-2013 07:00 AM

Re: Access $product from Static Page
 
how to do then? pls share your code here!

totaltec 10-31-2013 06:57 PM

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
); 


sinobest 03-24-2014 04:24 AM

Re: Access $product from Static Page
 
how to add the above code, pls?


All times are GMT -8. The time now is 05:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.