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

Accessing product info via SKU on a Static page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-12-2008, 06:35 AM
 
clew clew is offline
 

Newbie
  
Join Date: Jun 2008
Posts: 8
 

Default Accessing product info via SKU on a Static page

Hi all,

I would like to know how I could go about setting up a static page which would pull various product(s) data based on its sku number. Is this possible? If so, please reply with some sample code.

Thanks in advance.
__________________
4.1.10
Reply With Quote
  #2  
Old 06-12-2008, 06:37 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Accessing product info via SKU on a Static page

Not sure I follow...you have a static page...and you want the customer to be able to enter a sku number or....?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 06-12-2008, 08:04 AM
 
clew clew is offline
 

Newbie
  
Join Date: Jun 2008
Posts: 8
 

Default Re: Accessing product info via SKU on a Static page

I guess what I'm asking is that I wish to create my own static php pages such as:

/store/shoes.php where shoes.php will call my navigation / header / footer templates, but in the main content section I wish to have some sort of code that would pull specified product data (two specific shoes) from the database based on which sku numbers are embedded in the php code.

so the php code for that would be:

func_display("customer/header.tpl",$smarty);
func_display("customer/navMenu.tpl",$smarty);

var $arrProductsForDisplay = getProductsForDisplay('sku1111', 'sku1112');

foreach($arrProductsForDisplay as $product){
echo 'Product ID:' . $product{"productid"];
....
}


func_display("customer/footer.tpl",$smarty);


---

So the sku numbers would be hardcoded into the static page, and the "getProductsForDisplay()" function would grab all the product information I would need, but I need to figure out how to create that getProductsForDisplay() function which would query the x_cart database and give me product objects. If there's something that already exists for me to do that, great. If not, how would I go about doing this within the x-cart file structure (ie. where/how to create the function) ?

To sum up, how do I create a page which I can pull data from the x-cart database which isn't based on the productid, but rather the sku numbers which would be hardcoded into the php code.

Hope that made a little more sense, and again, thanks for the help in advance.
__________________
4.1.10
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 06:08 AM.

   

 
X-Cart forums © 2001-2020