本文整理匯總了PHP中mslib_fe::getProducts方法的典型用法代碼示例。如果您正苦於以下問題:PHP mslib_fe::getProducts方法的具體用法?PHP mslib_fe::getProducts怎麽用?PHP mslib_fe::getProducts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mslib_fe
的用法示例。
在下文中一共展示了mslib_fe::getProducts方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
} else {
$catIds[$page_uid][] = $shopRecord;
}
}
}
foreach ($catIds as $page_uid => $catIdsToAdd) {
foreach ($catIdsToAdd as $foreign_cat_id) {
if ($foreign_cat_id > 0) {
$insertArray = array();
$insertArray['categories_id'] = $reflector_cattree[$foreign_cat_id];
$insertArray['foreign_categories_id'] = $foreign_cat_id;
$insertArray['page_uid'] = $this->showCatalogFromPage;
$insertArray['foreign_page_uid'] = $page_uid;
$query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_categories_to_categories', $insertArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
$has_products = mslib_fe::getProducts('', $catid);
if (count($has_products)) {
foreach ($has_products as $product_id => $product_data) {
$updateArray = array();
$updateArray['categories_id'] = $foreign_cat_id;
$updateArray['products_id'] = $product_id;
$updateArray['sort_order'] = time();
$updateArray['page_uid'] = $page_uid;
$updateArray['related_to'] = $reflector_cattree[$foreign_cat_id];
// create categories tree linking
tx_mslib_catalog::linkCategoriesTreeToProduct($product_id, $foreign_cat_id, $updateArray);
}
}
}
}
}
示例2: getSitemap
public function getSitemap($categories_id, $array = array(), $include_disabled_categories = 0, $include_products = 1)
{
$str = "SELECT * from tx_multishop_categories c, tx_multishop_categories_description cd where c.page_uid='" . $this->showCatalogFromPage . "' ";
if (!$include_disabled_categories) {
$str .= "and c.status=1 ";
}
$str .= "and c.parent_id='" . $categories_id . "' and cd.language_id='" . $this->sys_language_uid . "' and c.categories_id=cd.categories_id order by c.sort_order";
$qry = $GLOBALS['TYPO3_DB']->sql_query($str);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
// cats
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) {
$array['subs'][] = mslib_fe::getSitemap($row['categories_id'], $row, $include_disabled_categories, $include_products);
}
} else {
if ($include_products) {
// products
$products = mslib_fe::getProducts('', $categories_id);
if (is_array($products)) {
if (!count($array)) {
// starting point doesnt have subcats, but products instead.
$array['subs'][0]['products'] = $products;
} else {
$array['products'] = $products;
}
}
}
}
return $array;
}