本文整理汇总了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;
}