function _exportToYandexMarket($f, $rate, $export_product_name) { $spArray = array('exprtUNIC' => array('mode' => 'toarrays', 'expProducts' => array())); $exportCategories = array(array(), array()); _exportBegin($f); _exportAllCategories($f, $spArray['exprtUNIC']['expProducts']); _exportProducts($f, $rate, $export_product_name, $spArray['exprtUNIC']['expProducts']); _exportEnd($f); }
function _exportToYandexMarket($f, $rate, $export_product_name, $categories_select) { _exportBegin($f); $cates = array(); foreach ($categories_select as $ess) { $catess = catCalculatePathToCategory($ess); foreach ($catess as $ess_m) { if ($ess_m['categoryID'] != 1) { $cates[] = $ess_m['categoryID']; } } } $categories_select_all = array_merge($categories_select, $cates); $categories_select_all = array_unique($categories_select_all); _exportAllCategories($f, $categories_select_all); _exportProducts($f, $rate, $export_product_name, $categories_select); _exportEnd($f); }
function _exportSubCategoriesAndProducts($parent, $level, &$f, $delimiter) { $cnt = 0; $q = db_query("select categoryID from " . CATEGORIES_TABLE . " where parent=" . $parent . " order by sort_order, name"); //fetch all subcategories while ($row = db_fetch_row($q)) { _exportCategoryLine($row[0], $level, $f, $delimiter); _exportProducts($row[0], $f, $delimiter); //process all subcategories _exportSubCategoriesAndProducts($row[0], $level + 1, $f, $delimiter); } }