CREX osCommeRcE XML


Support This Project

Introduction

The intended audience for this project are developers. This one (1) folder library enables any osCommerce based shopping cart to be accessed via XML and GET/POST queries.

This is particularly useful if you want to use AJAX ("Google Web Toolkit" anyone?), or a Flash front end... or if you simply want to integrate the shopping cart directly into an existing site!

Documentation on how to use CREX can also be found
here.

Site Map

  1. Introduction
  2. Requirements
  3. License Type
  4. Terms of Use
  5. Installation
  6. Tutorials
  7. Full List of Commands

Requirements

  • PHP 4.0 or higher
  • mySQL 3.0 or higher
  • osCommerce (or osCommerce based) shopping cart installation

Back to top.


License Type

  • GNU Public License (GPL) - Copyrights 2007 Red Pier Systems.

Back to top.


Terms of Use

  • This software is provided "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. ...In other words, use at your own risk. You agree to abide by these terms of use if you use/download this software.

Back to top.


Installation


... once uploaded, you can start sending commands to "crex_read.php" via GET/POST browser queries! Thats it!

Try "crex_read.php?cmd=" followed by a command to see what happens (if you dont have products in your categories, you may get nothing).

Back to top.


Tutorials

Below is a list that shows you how to get started with CREX (Under Construction):

  1. Retrieve Categories-Tutorial showing how to retrieve the categories in an XML format.
  2. Retrieve Products in Category-Tutorial showing how to retrieve the product id(s) associated with a particular category id (cpath) in an XML format.
  3. Retrieve Product Information and Description-Tutorial showing how to retrieve a single product's information and description associated with a particular product id in an XML format.
Retrieve Categories

To begin, simply use the following GET/POST query on the "crex_read.php" file:

http://www.YourSite.com/crex_read.php?cmd=get_categories

The XML data returned is structured as follows:
<?xml version="1.0"?>
<root>
   <data seo=""
         cpath="1"
         seo_link="http://www.YourSite.com/index.php?cPath=1"
         parent="0"
         has_subcategories="true"
         product_count="100"
   >
         <![CDATA[The Category Title]]>
   </data>
...
   <data seo=""
         cpath="100"
         seo_link="http://www.YourSite.com/index.php?cPath=100"
         parent="0"
         has_subcategories="true"
         product_count="100"
   >
         <![CDATA[The Category Title]]>
   </data>
</root>

Here is an explanation of the information retrieved within each category's <data> tag. Items in italics are not as important:
  • seo attribute - If the CHEMO SEO URL modification is installed/enabled, a value of TRUE is returned. Any other value indicates the modification is not in use.

  • cpath attribute - "cpath" stands for "category path". This value specifies the category index of this value. The "cpath" value can be used to retrieve available products associated with that category id.

  • seo_link attribute - If the CHEMO SEO URL modification is installed/enabled, an SEO friendly URL of the product will be returned, otherwise, the standard osCommerce "tep_href" function returns a standard URL. NOTE: the URL that it returns points to the osCommerce PHP pages.

  • parent attribute - Indicates the category id of this sub category's parent category.

  • has_subcategories attribute - Indicates whether or not this category has sub categories. A value of "true" indicates it does have sub categories. Any other value indicates it does not.

  • product_count attribute - Indicates how many products are associated with this category.

  • <![[CDATA]]> tag - Contains the category title.




Back to top.

Full list of Commands (July 09 2007)

Below is a full list of available commands that can be sent with the "crex_read.php?cmd=" query (Under Construction):

  1. get_categories
  2. get_products_in_category&cpath=(integer: category id)
  3. get_product&pid=(integer: product id)
  4. get_product_count&cpath=(integer: category id)
  5. product_search&keywords=(string: keywords)[&dfrom=(date: "from" date)&dto=(date: "to" date)&pfrom=(float: "from" price)&pto=(float: "to" price)]
  6. product_remove_from_wish_list&products_id=(integer: product id)
  7. product_add_to_wish_list&products_id=(integer: product id)
  8. product_delete_cart
  9. retrieve_cart
  10. product_remove_from_cart&products_id=(integer: product id)
  11. product_update_quantity&products_id=(integer: product id)&qty=(integer: quantity)[&attributes]
  12. product_add_to_cart&products_id=(integer: product id)
  13. checkout_confirmation
  14. user_register
  15. user_get_info
  16. user_logout
  17. user_login

Back to top.