本文整理汇总了PHP中ShopFunctions::renderUnitIsoList方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::renderUnitIsoList方法的具体用法?PHP ShopFunctions::renderUnitIsoList怎么用?PHP ShopFunctions::renderUnitIsoList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShopFunctions
的用法示例。
在下文中一共展示了ShopFunctions::renderUnitIsoList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
//.........这里部分代码省略.........
$vendor_model->setId(vmAccess::isSuperVendor());
$this->vendor = $vendor_model->getVendor();
$currency = $currency_model->getItemList();
$this->vendor_currency_symb = $currency->currency_symbol;
$lists['manufacturers'] = shopFunctions::renderManufacturerList($product->tsmart_manufacturer_id, true);
if (!empty($product->product_weight_uom)) {
$product_weight_uom = $product->product_weight_uom;
} else {
if (!empty($product_parent)) {
$product_weight_uom = $product_parent->product_weight_uom;
} else {
$product_weight_uom = tsmConfig::get('weight_unit_default');
}
}
if (!empty($product->product_lwh_uom)) {
$product_lwh_uom = $product->product_lwh_uom;
} else {
if (!empty($product_parent)) {
$product_lwh_uom = $product_parent->product_lwh_uom;
} else {
$product_lwh_uom = tsmConfig::get('lwh_unit_default');
}
}
if (!empty($product->product_unit)) {
$product_unit = $product->product_unit;
} else {
if (!empty($product_parent)) {
$product_unit = $product_parent->product_unit;
} else {
$product_unit = tsmConfig::get('product_unit_default', 'KG');
}
}
$lists['product_weight_uom'] = ShopFunctions::renderWeightUnitList('product_weight_uom', $product_weight_uom);
$lists['product_iso_uom'] = ShopFunctions::renderUnitIsoList('product_unit', $product_unit);
$lists['product_lwh_uom'] = ShopFunctions::renderLWHUnitList('product_lwh_uom', $product_lwh_uom);
if (empty($product->product_available_date)) {
$product->product_available_date = date("Y-m-d");
}
$waitinglistmodel = tmsModel::getModel('waitinglist');
/* Load waiting list */
if ($product->tsmart_product_id) {
//$waitinglist = $this->get('waitingusers', 'waitinglist');
$waitinglist = $waitinglistmodel->getWaitingusers($product->tsmart_product_id);
$this->assignRef('waitinglist', $waitinglist);
}
$orderstatusModel = tmsModel::getModel('orderstatus');
$lists['OrderStatus'] = $orderstatusModel->renderOSList(array(), 'order_status', TRUE);
// Add the tsmart_shoppergroup_ids
$cid = JFactory::getUser()->id;
$this->activeShoppergroups = shopfunctions::renderGuiList($cid, 'shoppergroups', 'shopper_group_name', 'category', 'vmuser_shoppergroups', 'tsmart_user_id');
if (!empty($this->activeShoppergroups)) {
$shoppergroupModel = tmsModel::getModel('shoppergroup');
$this->activeShoppergroups = tsmText::_($shoppergroupModel->getDefault(0)->shopper_group_name);
}
// Load protocustom lists
$customModel = tmsModel::getModel('custom');
$this->fieldTypes = tsmartModelCustom::getCustomTypes();
$customsList = $customModel->getCustomsList();
$attribs = 'style= "width: 300px;"';
$customlist = JHtml::_('select.genericlist', $customsList, 'customlist', $attribs, 'value', 'text', null, false, true);
$this->assignRef('customsList', $customlist);
if ($product->product_parent_id > 0) {
// Set up labels
$info_label = tsmText::_('com_tsmart_PRODUCT_FORM_ITEM_INFO_LBL');
$status_label = tsmText::_('com_tsmart_PRODUCT_FORM_ITEM_STATUS_LBL');
$dim_weight_label = tsmText::_('com_tsmart_PRODUCT_FORM_ITEM_DIM_WEIGHT_LBL');
示例2: display
function display($tpl = null)
{
// Get the task
$task = JRequest::getWord('task', $this->getLayout());
vmdebug('VirtuemartViewProduct ' . $task);
$this->task = $task;
// Load helpers
$this->loadHelper('currencydisplay');
$this->loadHelper('html');
$this->loadHelper('image');
$model = VmModel::getModel();
// Handle any publish/unpublish
switch ($task) {
case 'add':
case 'edit':
VmConfig::loadJLang('com_virtuemart_orders', TRUE);
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
$this->jsonPath = JFactory::getApplication()->isSite() ? juri::root() : '';
$virtuemart_product_id = JRequest::getVar('virtuemart_product_id', array());
if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
$virtuemart_product_id = (int) $virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int) $virtuemart_product_id;
}
$product = $model->getProductSingle($virtuemart_product_id, false);
$product_parent = $model->getProductParent($product->product_parent_id);
$mf_model = VmModel::getModel('manufacturer');
$manufacturers = $mf_model->getManufacturerDropdown($product->virtuemart_manufacturer_id);
$this->manufacturers = $manufacturers;
// set category in front edit link
if ($task == 'add') {
if ($category_id = jRequest::getInt('virtuemart_category_id', 0)) {
$product->categories = array($category_id);
}
}
// Get the category tree
if (isset($product->categories)) {
$this->category_tree = ShopFunctions::categoryListTree($product->categories);
} else {
$this->category_tree = ShopFunctions::categoryListTree();
}
//Get the shoppergoup list - Cleanshooter Custom Shopper Visibility
if (isset($product->shoppergroups)) {
$this->shoppergroupList = ShopFunctions::renderShopperGroupList($product->shoppergroups);
} else {
$this->shoppergroupList = '';
}
// Load the product price
$this->loadHelper('calculationh');
$product_childIds = $model->getProductChildIds($virtuemart_product_id);
$product_childs = array();
foreach ($product_childIds as $id) {
$product_childs[] = $model->getProductSingle($id, false);
}
$this->assignRef('product_childs', $product_childs);
JLoader::register('VirtueMartModelConfig', JPATH_VM_ADMINISTRATOR . '/models/config.php');
$this->productLayouts = VirtueMartModelConfig::getLayoutList('productdetails', $product->layout);
// Load Images
$model->addImages($product);
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->imagePath = $imagePath;
// Load the vendors
$vendor_model = VmModel::getModel('vendor');
if (Vmconfig::get('multix', 'none') !== 'none') {
if ($task == 'add') {
$vendor_id = $this->adminVendor;
} else {
$vendor_id = $product->virtuemart_vendor_id;
}
$lists['vendors'] = Shopfunctions::renderVendorList($vendor_id);
}
// Load the currencies
$currency_model = VmModel::getModel('currency');
$this->loadHelper('permissions');
$vendor_model->setId(Permissions::getInstance()->isSuperVendor());
$vendor = $vendor_model->getVendor();
if (empty($product->product_currency)) {
$product->product_currency = $vendor->vendor_currency;
}
//STUDIO42 fix for currency, old method set 2 time same currency symbol
// TODO verify all others
$currencyModel = VmModel::getModel('currency');
$currencyModel->setId($vendor->vendor_currency);
$currency = $currencyModel->getData();
$this->vendor_currency = $currency->currency_symbol;
$currencyModel->setId($product->product_currency);
$currency = $currencyModel->getData();
$this->product_currency = $currency->currency_symbol;
if (count($manufacturers) > 0) {
$lists['manufacturers'] = JHTML::_('select.genericlist', $manufacturers, 'virtuemart_manufacturer_id', 'class="inputbox"', 'value', 'text', $product->virtuemart_manufacturer_id);
}
$lists['product_weight_uom'] = ShopFunctions::renderWeightUnitList('product_weight_uom', $task == 'add' ? VmConfig::get('weight_unit_default') : $product->product_weight_uom);
$lists['product_iso_uom'] = ShopFunctions::renderUnitIsoList('product_unit', $task == 'add' ? VmConfig::get('weight_unit_default') : $product->product_unit);
$lists['product_lwh_uom'] = ShopFunctions::renderLWHUnitList('product_lwh_uom', $task == 'add' ? VmConfig::get('lwh_unit_default') : $product->product_lwh_uom);
if (empty($product->product_available_date)) {
$product->product_available_date = date("Y-m-d");
//.........这里部分代码省略.........
示例3: display
//.........这里部分代码省略.........
$currency = $currency_model->getCurrency($vendor->vendor_currency);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if (count($manufacturers) > 0) {
$lists['manufacturers'] = JHTML::_('select.genericlist', $manufacturers, 'virtuemart_manufacturer_id', 'class="inputbox"', 'value', 'text', $product->virtuemart_manufacturer_id);
}
if (!empty($product->product_weight_uom)) {
$product_weight_uom = $product->product_weight_uom;
} else {
if (!empty($product_parent)) {
$product_weight_uom = $product_parent->product_weight_uom;
} else {
$product_weight_uom = VmConfig::get('weight_unit_default');
}
}
if (!empty($product->product_lwh_uom)) {
$product_lwh_uom = $product->product_lwh_uom;
} else {
if (!empty($product_parent)) {
$product_lwh_uom = $product_parent->product_lwh_uom;
} else {
$product_lwh_uom = VmConfig::get('lwh_unit_default');
}
}
if (!empty($product->product_unit)) {
$product_unit = $product->product_unit;
} else {
if (!empty($product_parent)) {
$product_unit = $product_parent->product_unit;
} else {
$product_unit = VmConfig::get('product_unit_default', 'KG');
}
}
$lists['product_weight_uom'] = ShopFunctions::renderWeightUnitList('product_weight_uom', $product_weight_uom);
$lists['product_iso_uom'] = ShopFunctions::renderUnitIsoList('product_unit', $product_unit);
$lists['product_lwh_uom'] = ShopFunctions::renderLWHUnitList('product_lwh_uom', $product_lwh_uom);
if (empty($product->product_available_date)) {
$product->product_available_date = date("Y-m-d");
}
$waitinglistmodel = VmModel::getModel('waitinglist');
/* Load waiting list */
if ($product->virtuemart_product_id) {
//$waitinglist = $this->get('waitingusers', 'waitinglist');
$waitinglist = $waitinglistmodel->getWaitingusers($product->virtuemart_product_id);
$this->assignRef('waitinglist', $waitinglist);
}
$productShoppers = $model->getProductShoppersByStatus($product->virtuemart_product_id, array('S'));
$this->assignRef('productShoppers', $productShoppers);
$orderstatusModel = VmModel::getModel('orderstatus');
$lists['OrderStatus'] = $orderstatusModel->renderOSList(array(), 'order_status', TRUE);
$field_model = VmModel::getModel('customfields');
$fieldTypes = $field_model->getField_types();
$this->assignRef('fieldTypes', $fieldTypes);
// Add the virtuemart_shoppergroup_ids
$cid = JFactory::getUser()->id;
$this->activeShoppergroups = shopfunctions::renderGuiList('virtuemart_shoppergroup_id', '#__virtuemart_vmuser_shoppergroups', 'virtuemart_user_id', $cid, 'shopper_group_name', '#__virtuemart_shoppergroups', 'virtuemart_shoppergroup_id', 'category', 4, 0);
if (!$this->activeShoppergroups or is_array($this->activeShoppergroups) and count($this->activeShoppergroups) == 0) {
//vmdebug('$this->activeShoppergroups',$this->activeShoppergroups);
$shoppergroupModel = VmModel::getModel('shoppergroup');
$this->activeShoppergroups = vmText::_($shoppergroupModel->getDefault(0)->shopper_group_name);
}
/* Load protocustom lists */
$customsList = $field_model->getCustomsList();
$attribs = 'style= "width: 300px;"';
$customlist = JHTML::_('select.genericlist', $customsList, 'customlist', $attribs);
$this->assignRef('customsList', $customlist);
$ChildCustomRelation = $field_model->getProductChildCustomRelation();
示例4: display
//.........这里部分代码省略.........
$this->assignRef('productLayouts', $productLayouts);
// Load Images
$model->addImages($product);
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->assignRef('imagePath', $imagePath);
// $vendors = $vendor_model->getVendors();
// $lists['vendors'] = JHTML::_('select.genericlist', $vendors, 'virtuemart_vendor_id', '', 'virtuemart_vendor_id', 'vendor_name', $product->virtuemart_vendor_id);
// Load the vendors
$vendor_model = VmModel::getModel('vendor');
if (Vmconfig::get('multix', 'none') !== 'none') {
$lists['vendors'] = Shopfunctions::renderVendorList($product->virtuemart_vendor_id);
}
// Load the currencies
$currency_model = VmModel::getModel('currency');
$this->loadHelper('permissions');
$vendor_model->setId(Permissions::getInstance()->isSuperVendor());
$vendor = $vendor_model->getVendor();
if (empty($product->product_currency)) {
$product->product_currency = $vendor->vendor_currency;
}
$currencies = JHTML::_('select.genericlist', $currency_model->getCurrencies(), 'product_currency', '', 'virtuemart_currency_id', 'currency_name', $product->product_currency);
$currency = $currency_model->getCurrency($product->product_currency);
$this->assignRef('product_currency', $currency->currency_symbol);
$currency = $currency_model->getCurrency($vendor->vendor_currency);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if (count($manufacturers) > 0) {
$lists['manufacturers'] = JHTML::_('select.genericlist', $manufacturers, 'virtuemart_manufacturer_id', 'class="inputbox"', 'value', 'text', $product->virtuemart_manufacturer_id);
}
$lists['product_weight_uom'] = ShopFunctions::renderWeightUnitList('product_weight_uom', $task == 'add' ? VmConfig::get('weight_unit_default') : $product->product_weight_uom);
$lists['product_iso_uom'] = ShopFunctions::renderUnitIsoList('product_unit', $task == 'add' ? VmConfig::get('weight_unit_default') : $product->product_unit);
$lists['product_lwh_uom'] = ShopFunctions::renderLWHUnitList('product_lwh_uom', $task == 'add' ? VmConfig::get('lwh_unit_default') : $product->product_lwh_uom);
if (empty($product->product_available_date)) {
$product->product_available_date = date("Y-m-d");
}
$waitinglistmodel = VmModel::getModel('waitinglist');
/* Load waiting list */
if ($product->virtuemart_product_id) {
//$waitinglist = $this->get('waitingusers', 'waitinglist');
$waitinglist = $waitinglistmodel->getWaitingusers($product->virtuemart_product_id);
$this->assignRef('waitinglist', $waitinglist);
}
$productShoppers = $model->getProductShoppersByStatus($product->virtuemart_product_id, array('S'));
$this->assignRef('productShoppers', $productShoppers);
$orderstatusModel = VmModel::getModel('orderstatus');
$lists['OrderStatus'] = $orderstatusModel->renderOrderStatusList(array());
$field_model = VmModel::getModel('customfields');
$fieldTypes = $field_model->getField_types();
$this->assignRef('fieldTypes', $fieldTypes);
/* Load product types lists */
$customsList = $field_model->getCustomsList();
$customlist = JHTML::_('select.genericlist', $customsList, 'customlist');
$this->assignRef('customsList', $customlist);
$ChildCustomRelation = $field_model->getProductChildCustomRelation();
$this->assignRef('ChildCustomRelation', $ChildCustomRelation);
if ($product->product_parent_id > 0) {
$parentRelation = $field_model->getProductParentRelation($product->virtuemart_product_id);
$this->assignRef('parentRelation', $parentRelation);
// Set up labels
$info_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_ITEM_INFO_LBL');
$status_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_ITEM_STATUS_LBL');
$dim_weight_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_ITEM_DIM_WEIGHT_LBL');
$images_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_ITEM_IMAGES_LBL');