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
toCode:$my_var_query = tep_db_query("query stuff"); if ($my_var = tep_db_fetch_array($my_var_query)) {
If so, using the following example as the starting point:Code:$my_var = $db->Execute("query stuff"); if (!$my_var->EOF) {
Would the following conversion be correctCode: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>"; }
In the case of the while usage, if the starting point isCode: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>"; }
Would the following conversion be correctCode:$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;
Apart from the obvious reasons for asking I am confused by the use of the colon in the initial while query.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;
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



