本文整理汇总了PHP中ShopFunctions::renderProductShopperList方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::renderProductShopperList方法的具体用法?PHP ShopFunctions::renderProductShopperList怎么用?PHP ShopFunctions::renderProductShopperList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShopFunctions
的用法示例。
在下文中一共展示了ShopFunctions::renderProductShopperList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
//.........这里部分代码省略.........
$this->db->setQuery($query);
$rows = $this->db->loadObjectlist();
$html = array();
foreach ($rows as $field) {
if ($field->field_type == 'C') {
$this->json['table'] = 'childs';
$q = 'SELECT `virtuemart_product_id` FROM `#__virtuemart_products` WHERE `published`=1
AND `product_parent_id`= ' . JRequest::getInt('virtuemart_product_id');
//$this->db->setQuery(' SELECT virtuemart_product_id, product_name FROM `#__virtuemart_products` WHERE `product_parent_id` ='.(int)$product_id);
$this->db->setQuery($q);
if ($childIds = $this->db->loadResultArray()) {
// Get childs
foreach ($childIds as $childId) {
$field->custom_value = $childId;
$display = $this->model->displayProductCustomfieldBE($field, $childId, $this->row);
if ($field->is_cart_attribute) {
$cartIcone = 'default';
} else {
$cartIcone = 'default-off';
}
$html[] = '<div class="removable">
<td>' . $field->custom_title . '</td>
<td>' . $display . $field->custom_tip . '</td>
<td>' . JText::_($fieldTypes[$field->field_type]) . '
' . $this->model->setEditCustomHidden($field, $this->row) . '
</td>
<td><span class="vmicon vmicon-16-' . $cartIcone . '"></span></td>
<td></td>
</div>';
$this->row++;
}
}
} elseif ($field->field_type == 'E') {
$this->json['table'] = 'customPlugins';
$display = $this->model->displayProductCustomfieldBE($field, $product_id, $this->row);
if ($field->is_cart_attribute) {
$cartIcone = 'default';
} else {
$cartIcone = 'default-off';
}
$html[] = '
<tr class="removable">
<td><span class="hasTip" title="' . JText::_($field->custom_tip) . '">' . $field->custom_title . '</td>
<td>' . $display . '
' . $this->model->setEditCustomHidden($field, $this->row) . '
<p>' . JTEXT::_('COM_VIRTUEMART_CUSTOM_ACTIVATE_JAVASCRIPT') . '</p></td>
<td><span class="vmicon vmicon-16-' . $cartIcone . '"></span>' . JText::_('COM_VIRTUEMART_CUSTOM_EXTENSION') . '</td>
<td><span class="vmicon vmicon-16-move"></span>
<span class="vmicon vmicon-16-remove"></span><input class="ordering" type="hidden" value="' . $this->row . '" name="field[' . $this->row . '][ordering]" />
</td>
</tr>';
$this->row++;
} else {
$this->json['table'] = 'fields';
$display = $this->model->displayProductCustomfieldBE($field, $product_id, $this->row);
if ($field->is_cart_attribute) {
$cartIcone = 'default';
} else {
$cartIcone = 'default-off';
}
$html[] = '<tr class="removable">
<td><span class="hasTip" title="' . JText::_($field->custom_tip) . '">' . $field->custom_title . '</td>
<td>' . $display . '</td>
<td><span class="vmicon vmicon-16-' . $cartIcone . '"></span>' . JText::_($fieldTypes[$field->field_type]) . '
' . $this->model->setEditCustomHidden($field, $this->row) . '
</td>
<td><span class="vmicon vmicon-16-move"></span><span class="vmicon vmicon-16-remove"></span><input class="ordering" type="hidden" value="' . $this->row . '" name="field[' . $this->row . '][ordering]" /></td>
</tr>';
$this->row++;
}
}
$this->json['value'] = $html;
$this->json['ok'] = 1;
} else {
if ($this->type == 'userlist') {
$status = JRequest::getvar('status');
$productShoppers = 0;
if ($status) {
$productModel = VmModel::getModel('product');
$productShoppers = $productModel->getProductShoppersByStatus($product_id, $status);
}
if (!class_exists('ShopFunctions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
}
$html = ShopFunctions::renderProductShopperList($productShoppers);
$this->json['value'] = $html;
} else {
$this->json['ok'] = 0;
}
}
}
}
}
if (empty($this->json)) {
$this->json['value'] = null;
$this->json['ok'] = 1;
}
echo json_encode($this->json);
}
示例2: display
//.........这里部分代码省略.........
foreach ($ids as $k => $i) {
$p = $model->getCustom($i);
if ($p) {
$p->value = $p->custom_value;
$rows[] = $p;
}
}
$html = array();
foreach ($rows as $field) {
if ($field->field_type == 'deprecatedwasC') {
$this->json['table'] = 'childs';
$q = 'SELECT `tsmart_product_id` FROM `#__tsmart_products` WHERE `published`=1
AND `product_parent_id`= ' . vRequest::getInt('tsmart_product_id');
//$this->db->setQuery(' SELECT tsmart_product_id, product_name FROM `#__tsmart_products` WHERE `product_parent_id` ='.(int)$product_id);
$this->db->setQuery($q);
if ($childIds = $this->db->loadColumn()) {
// Get childs
foreach ($childIds as $childId) {
$field->custom_value = $childId;
$display = $this->model->displayProductCustomfieldBE($field, $childId, $this->row);
if ($field->is_cart_attribute) {
$cartIcone = 'default';
} else {
$cartIcone = 'default-off';
}
$html[] = '<div class="removable">
<td>' . $field->custom_title . '</td>
<td>' . $display . $field->custom_tip . '</td>
<td>' . tsmText::_($fieldTypes[$field->field_type]) . '
' . $this->model->setEditCustomHidden($field, $this->row) . '
</td>
<td><span class="vmicon vmicon-16-' . $cartIcone . '"></span></td>
<td></td>
</div>';
$this->row++;
}
}
} else {
//if ($field->field_type =='E') {
$this->json['table'] = 'customPlugins';
$colspan = '';
if ($field->field_type == 'E') {
$this->model->bindCustomEmbeddedFieldParams($field, 'E');
} else {
if ($field->field_type == 'C') {
$colspan = 'colspan="2" ';
}
}
$display = $this->model->displayProductCustomfieldBE($field, $product_id, $this->row);
if ($field->is_cart_attribute) {
$cartIcone = 'default';
} else {
$cartIcone = 'default-off';
}
$field->tsmart_product_id = $product_id;
$html[] = '
<tr class="removable">
<td>
<b>' . tsmText::_($fieldTypes[$field->field_type]) . '</b> ' . tsmText::_($field->custom_title) . '</span><br/>
<span class="vmicon vmicon-16-' . $cartIcone . '"></span>
<span class="vmicon vmicon-16-move"></span>
<span class="vmicon vmicon-16-remove"></span>
' . $this->model->setEditCustomHidden($field, $this->row) . '
</td>
<td ' . $colspan . '>' . $display . '</td>
</tr>
</tr>';
$this->row++;
}
}
$this->json['value'] = $html;
$this->json['ok'] = 1;
} else {
if ($this->type == 'userlist') {
$status = vRequest::getvar('status');
$productShoppers = 0;
if ($status) {
$productModel = tmsModel::getModel('product');
$productShoppers = $productModel->getProductShoppersByStatus($product_id, $status);
}
if (!class_exists('ShopFunctions')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
}
$html = ShopFunctions::renderProductShopperList($productShoppers);
$this->json['value'] = $html;
} else {
$this->json['ok'] = 0;
}
}
}
}
}
if (empty($this->json)) {
$this->json['value'] = null;
$this->json['ok'] = 1;
}
echo vmJsApi::safe_json_encode($this->json);
}
示例3:
<th class="title"><?php
echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_ITEM_STATUS');
?>
</th>
<th class="title"><?php
echo vmText::_('COM_VIRTUEMART_ORDER_NUMBER');
?>
</th>
</tr>
</thead>
<tbody id="customers-list">
<?php
if (!class_exists('ShopFunctions')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
}
echo ShopFunctions::renderProductShopperList($this->productShoppers);
?>
</tbody>
</table>
</div>
<div id="customer-mail-notify-list">
<?php
if (VmConfig::get('stockhandle', 0) == 'disableadd' && !empty($this->waitinglist)) {
?>
<div style="font-weight:bold;"><?php
echo vmText::_('COM_VIRTUEMART_PRODUCT_WAITING_LIST_USERLIST');
?>
</div>
<table class="adminlist table" cellspacing="0" cellpadding="0">
示例4: display
//.........这里部分代码省略.........
}
$this->db->setQuery($query);
$this->json['value'] = $this->db->loadObjectList();
$this->json['ok'] = 1;
} else {
if ($this->type == 'fields') {
$fieldTypes = $this->model->getField_types();
$query = "SELECT *,custom_value as value FROM #__virtuemart_customs\n\t\t\tWHERE (`virtuemart_custom_id`=" . $id . " or `custom_parent_id`=" . $id . ")";
$query .= " order by custom_parent_id asc";
$this->db->setQuery($query);
$rows = $this->db->loadObjectlist();
$html = array('cart_attributes' => '', 'custom_fields' => '', 'childs' => '');
foreach ($rows as $field) {
if ($field->field_type == 'C') {
$this->json['table'] = 'childs';
$q = 'SELECT `virtuemart_product_id` FROM `#__virtuemart_products` WHERE `published`=1
AND `product_parent_id`= ' . JRequest::getInt('virtuemart_product_id');
//$this->db->setQuery(' SELECT virtuemart_product_id, product_name FROM `#__virtuemart_products` WHERE `product_parent_id` ='.(int)$product_id);
$this->db->setQuery($q);
if ($childIds = $this->db->loadColumn()) {
// Get childs
foreach ($childIds as $childId) {
$field->custom_value = $childId;
$display = $this->model->displayProductCustomfieldBE($field, $childId, $this->row);
if ($field->is_cart_attribute) {
$cartIcone = 'default';
} else {
$cartIcone = 'default-off';
}
$html[] = '<div class="removable">
<td>' . $field->custom_title . '</td>
<td>' . $display . $field->custom_tip . '</td>
<td>' . JText::_($fieldTypes[$field->field_type]) . '
' . $this->model->setEditCustomHidden($field, $this->row) . '
</td>
<td><span class="vmicon vmicon-16-' . $cartIcone . '"></span></td>
<td></td>
</div>';
$this->row++;
}
}
} else {
$this->json['table'] = 'fields';
$display = $this->model->displayProductCustomfieldBE($field, $product_id, $this->row);
if ($field->custom_tip) {
$tip = ' class="hasTooltip" title="' . $field->custom_tip . '"';
} else {
$tip = '';
}
if ($field->layout_pos) {
$field->layout_pos = '<div><small>' . $field->layout_pos . '</small></div>';
}
$tbName = $field->is_cart_attribute ? 'cart_attributes' : 'custom_fields';
$html[$tbName] .= '<tr class="removable">
<td class="hidden-phone"><span class="icon-menu"></span>
<input class="ordering" type="hidden" value="' . $this->row . '" name="field[' . $this->row . '][ordering]" />
</td>
<td><div ' . $tip . '>' . JText::_($field->custom_title) . '<div>' . ($field->custom_field_desc ? '<small>' . $field->custom_field_desc . '</small>' : '') . '
<td>' . $display . '</td>
<td>
' . JText::_($fieldTypes[$field->field_type]) . '
' . $field->layout_pos . '
' . $this->model->setEditCustomHidden($field, $this->row) . '
</td>
<td><span class="icon-remove"></span></td>
</tr>';
$this->row++;
}
}
foreach ($html as $key => $item) {
if (empty($item)) {
unset($html[$key]);
}
}
$this->json['value'] = $html;
$this->json['ok'] = 1;
} else {
if ($this->type == 'userlist') {
$status = JRequest::getvar('status');
$productShoppers = 0;
if ($status) {
$productModel = VmModel::getModel('product');
$productShoppers = $productModel->getProductShoppersByStatus($product_id, $status);
}
JLoader::register('ShopFunctions', JPATH_VM_ADMINISTRATOR . 'helpers/shopfunctions.php');
$html = ShopFunctions::renderProductShopperList($productShoppers);
$this->json['value'] = $html;
} else {
$this->json['ok'] = 0;
}
}
}
}
}
if (empty($this->json)) {
$this->json['value'] = null;
$this->json['ok'] = 1;
}
echo json_encode($this->json);
}