本文整理汇总了PHP中ps_product::get_child_options方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_product::get_child_options方法的具体用法?PHP ps_product::get_child_options怎么用?PHP ps_product::get_child_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_product
的用法示例。
在下文中一共展示了ps_product::get_child_options方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_attribute
/**
* Lists all child/sister products of the given product
*
* @param int $product_id
* @return string HTML code with Items, attributes & price
*/
function list_attribute($product_id, $extra_ids = null)
{
// The default listing method
$product_list = "N";
$display_use_parent = 'N';
if (ps_product::parent_has_children($product_id)) {
$product_list = 'N';
$child_options = ps_product::get_child_options($product_id);
if (!empty($child_options)) {
extract($child_options);
}
$quantity_options = ps_product::get_quantity_options($product_id);
if (!empty($quantity_options['quantity_box'])) {
$display_type = $quantity_options['quantity_box'];
}
$child_option_ids = ps_product::get_field($product_id, 'child_option_ids');
if ($child_option_ids != '' && $product_list == "N") {
$product_list = "Y";
}
if ($extra_ids) {
$child_option_ids .= $child_option_ids ? "," . $extra_ids : $extra_ids;
}
}
if (empty($class_suffix)) {
$class_suffix = "";
}
switch ($product_list) {
case "Y":
return $this->list_attribute_list($product_id, $display_use_parent, $product_list_child, $display_type, $class_suffix, $child_option_ids, $dw, $aw, $display_header, $product_list_type, $product_list);
break;
case "YM":
return $this->list_attribute_list($product_id, $display_use_parent, $product_list_child, $display_type, $class_suffix, $child_option_ids, $dw, $aw, $display_header, $product_list_type, $product_list);
break;
case "N":
default:
return $this->list_attribute_drop($product_id, $class_suffix);
break;
}
}
示例2: vmGet
if (!empty($product_id)) {
$price = $ps_product->get_retail_price($product_id);
} else {
$price['product_price'] = vmGet($_REQUEST, 'product_price', '');
}
$quantity_start = 0;
$quantity_end = 0;
$quantity_step = 1;
if (!empty($product_id)) {
// get the Database object we're filling the product form with
$db = $ps_product->get($product_id);
//get quantity options
$quantity_options = ps_product::get_quantity_options($product_id);
extract($quantity_options);
//get list style
$child_options = ps_product::get_child_options($product_id);
extract($child_options);
//Get min max order levels
$order_levels = ps_product::product_order_levels($product_id);
if ($order_levels) {
$min_order = array_shift($order_levels);
$max_order = array_shift($order_levels);
}
// Get category IDs
$db2 = new ps_DB();
$q = "SELECT category_id FROM #__{vm}_product_category_xref WHERE product_id='{$product_id}'";
$db2->query($q);
while ($db2->next_record()) {
$my_categories[$db2->f("category_id")] = "1";
}
// Get the Manufacturer ID