I am reading
http://www.zen-cart.com/wiki/index.p...dules_from_osC
and would like some clarification on a few points relating to 'tep_db_query and tep_db_fetch_array in if' and 'tep_db_query and tep_db_fetch_array in while'
The first question I have is:
Does Zen Cart do away completely with "tep_db_fetch_array"?
The if example given says to change
Code:
$my_var_query = tep_db_query("query stuff");
if ($my_var = tep_db_fetch_array($my_var_query)) {
to
Code:
$my_var = $db->Execute("query stuff");
if (!$my_var->EOF) {
If so, using the following example as the starting point:
Code:
if(defined('STORE_COUNTRY')) {
$store_country = tep_db_query("select countries_iso_code_3 as code from ".TABLE_COUNTRIES." where countries_id='".STORE_COUNTRY."'");
if($store_country_values = tep_db_fetch_array($store_country))
$rdf .= $format->indent(4)."<vcard:country-name xml:lang=\"en\">".$store_country_values['code']."</vcard:country-name>";
}
Would the following conversion be correct
Code:
if(defined('STORE_COUNTRY')) {
$store_country = $db->Execute("select countries_iso_code_3 as code from ".TABLE_COUNTRIES." where countries_id='".STORE_COUNTRY."'");
if($store_country_values->EOF)
$rdf .= $format->indent(4)."<vcard:country-name xml:lang=\"en\">".$store_country_values['code']."</vcard:country-name>";
}
In the case of the while usage, if the starting point is
Code:
$products = tep_db_query($products);
while($products_values = tep_db_fetch_array($products)):
$rdf .= $format->indent(2)."<gr:offers rdf:resource=\"#Offering_".$products_values['products_id']."\"/>";
endwhile;
Would the following conversion be correct
Code:
$products = $db->Execute($products);
while($products_values->EOF):
$rdf .= $format->indent(2)."<gr:offers rdf:resource=\"#Offering_".$products_values['products_id']."\"/>";
$products_values->MoveNext();
)
endwhile;
Apart from the obvious reasons for asking I am confused by the use of the colon in the initial while query.
The aim is to end up with a true semantic enabled cart using the GR ontology. OSC, Magento and others already have this capability but ZenCart does not and I believe that needs to change for ZenCart users to stand a better chance of having sites and products found in the search engines as the web develops.
For those seriously interested in this project see http://www.heppnetz.de/projects/goodrelations/ - it is the future of ecommerce
many thanks
Kevin
Bookmarks