本文整理汇总了PHP中vmJsApi::chosenDropDowns方法的典型用法代码示例。如果您正苦于以下问题:PHP vmJsApi::chosenDropDowns方法的具体用法?PHP vmJsApi::chosenDropDowns怎么用?PHP vmJsApi::chosenDropDowns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmJsApi
的用法示例。
在下文中一共展示了vmJsApi::chosenDropDowns方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
defined('_JEXEC') or die;
$ccData = $viewData['ccData'];
JHTML::_('behavior.tooltip');
JHTML::script('vmcreditcard.js', 'components/com_virtuemart/assets/js/', false);
VmConfig::loadJLang('com_virtuemart', true);
vmJsApi::jCreditCard();
vmJsApi::jQuery();
vmJsApi::chosenDropDowns();
$doc = JFactory::getDocument();
$doc->addScript(JURI::root(true) . '/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/js/site.js');
$doc->addStyleSheet(JURI::root(true) . '/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/css/realex.css');
$attribute = '';
if ($viewData['dccinfo']) {
$attribute = ' readonly ';
}
?>
<div class="realex remote_cc_form" id="remote_cc_form">
<h3 class="order_amount"><?php
echo $viewData['order_amount'];
?>
</h3>
示例2: renderCountryList
/**
* Render a simple country list
*
* @author jseros, Max Milbers, Valérie Isaksen
*
* @param int $countryId Selected country id
* @param boolean $multiple True if multiple selections are allowed (default: false)
* @param mixed $_attrib string or array with additional attributes,
* e.g. 'onchange=somefunction()' or array('onchange'=>'somefunction()')
* @param string $_prefix Optional prefix for the formtag name attribute
* @return string HTML containing the <select />
*/
public static function renderCountryList($countryId = 0, $multiple = FALSE, $_attrib = array(), $_prefix = '', $required = 0)
{
$countryModel = VmModel::getModel('country');
$countries = $countryModel->getCountries(TRUE, TRUE, FALSE);
$attrs = array();
$name = 'country_name';
$id = 'virtuemart_country_id';
$idA = $_prefix . 'virtuemart_country_id';
$attrs['class'] = 'virtuemart_country_id';
$attrs['class'] = 'vm-chzn-select';
// Load helpers and languages files
if (!class_exists('VmConfig')) {
require JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php';
}
VmConfig::loadConfig();
VmConfig::loadJLang('com_virtuemart_countries');
vmJsApi::chosenDropDowns();
$sorted_countries = array();
$lang = JFactory::getLanguage();
$prefix = "COM_VIRTUEMART_COUNTRY_";
foreach ($countries as $country) {
$country_string = $lang->hasKey($prefix . $country->country_3_code) ? JText::_($prefix . $country->country_3_code) : $country->country_name;
$sorted_countries[$country->virtuemart_country_id] = $country_string;
}
asort($sorted_countries);
$countries_list = array();
$i = 0;
foreach ($sorted_countries as $key => $value) {
$countries_list[$i] = new stdClass();
$countries_list[$i]->{$id} = $key;
$countries_list[$i]->{$name} = $value;
$i++;
}
if ($required != 0) {
$attrs['class'] .= ' required';
}
if ($multiple) {
$attrs['multiple'] = 'multiple';
$idA .= '[]';
} else {
$emptyOption = JHTML::_('select.option', '', JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION'), $id, $name);
array_unshift($countries_list, $emptyOption);
}
if (is_array($_attrib)) {
$attrs = array_merge($attrs, $_attrib);
} else {
$_a = explode('=', $_attrib, 2);
$attrs[$_a[0]] = $_a[1];
}
//Todo remove inline style
//$attrs['style'] = 'width:270px;';
return JHTML::_('select.genericlist', $countries_list, $idA, $attrs, $id, $name, $countryId);
}
示例3: displayProductCustomfieldFE
/**
* Formating front display by roles
* for product only !
*/
public function displayProductCustomfieldFE(&$product, $customfield, $row = '')
{
$virtuemart_custom_id = isset($customfield->virtuemart_custom_id) ? $customfield->virtuemart_custom_id : 0;
$value = $customfield->custom_value;
$type = $customfield->field_type;
$is_list = isset($customfield->is_list) ? $customfield->is_list : 0;
$price = isset($customfield->custom_price) ? $customfield->custom_price : 0;
$is_cart = isset($customfield->is_cart) ? $customfield->is_cart : 0;
//vmdebug('displayProductCustomfieldFE and here is something wrong ',$customfield);
if (!class_exists('CurrencyDisplay')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
}
$currency = CurrencyDisplay::getInstance();
if ($is_list > 0) {
$values = explode(';', $value);
if ($is_cart != 0) {
$options = array();
foreach ($values as $key => $val) {
$options[] = array('value' => $val, 'text' => $val);
}
vmJsApi::chosenDropDowns();
return JHTML::_('select.genericlist', $options, 'field[' . $row . '][custom_value]', NULL, 'value', 'text', FALSE, TRUE);
} else {
$html = '';
$html .= '<div id="custom_' . $virtuemart_custom_id . '_' . $value . '" >' . $value . '</div>';
return $html;
}
} else {
if ($price > 0) {
$price = $currency->priceDisplay((double) $price);
}
switch ($type) {
case 'A':
$options = array();
$session = JFactory::getSession();
$virtuemart_category_id = $session->get('vmlastvisitedcategoryid', 0, 'vm');
$productModel = VmModel::getModel('product');
//Note by Jeremy Magne (Daycounts) 2013-08-31
//Previously the the product model is loaded but we need to ensure the correct product id is set because the getUncategorizedChildren does not get the product id as parameter.
//In case the product model was previously loaded, by a related product for example, this would generate wrong uncategorized children list
$productModel->setId($product->virtuemart_product_id);
//parseCustomParams
VirtueMartModelCustomfields::bindParameterableByFieldType($customfield);
//Todo preselection as dropdown of children
//Note by Max Milbers: This is not necessary, in this case it is better to unpublish the parent and to give the child which should be preselected a category
//Or it is withParent, in that case there exists the case, that a parent should be used as a kind of mini category and not be orderable.
//There exists already other customs and in special plugins which wanna disable or change the add to cart button.
//I suggest that we manipulate the button with a message "choose a variant first"
//if(!isset($customfield->pre_selected)) $customfield->pre_selected = 0;
$selected = JRequest::getVar('virtuemart_product_id', 0);
if (is_array($selected)) {
$selected = $selected[0];
}
$selected = (int) $selected;
$html = '';
$uncatChildren = $productModel->getUncategorizedChildren($customfield->withParent);
if (empty($uncatChildren)) {
return $html;
break;
}
if (!$customfield->withParent or $customfield->withParent and $customfield->parentOrderable) {
$options[0] = array('value' => JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $customfield->virtuemart_product_id, FALSE), 'text' => vmText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT'));
}
foreach ($uncatChildren as $child) {
$options[] = array('value' => JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $child['virtuemart_product_id'], FALSE), 'text' => $child['product_name']);
}
//vmJsApi::chosenDropDowns(); would need class="inputbox vm-chzn-select", but it does not work, in case people have two times the same product,
//because both dropdowns have then the same id and the js does not work.
$html .= JHTML::_('select.genericlist', $options, 'field[' . $row . '][custom_value]', 'onchange="window.top.location.href=this.options[this.selectedIndex].value" size="1" class="inputbox"', "value", "text", JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $selected, FALSE));
//vmdebug('$customfield',$customfield);
if ($customfield->parentOrderable == 0 and $product->product_parent_id == 0) {
$product->orderable = FALSE;
}
return $html;
break;
/* variants*/
/* variants*/
case 'V':
if ($price == 0) {
$price = vmText::_('COM_VIRTUEMART_CART_PRICE_FREE');
}
/* Loads the product price details */
return '<input type="text" value="' . vmText::_($value) . '" name="field[' . $row . '][custom_value]" /> ' . vmText::_('COM_VIRTUEMART_CART_PRICE') . $price . ' ';
break;
/*Date variant*/
/*Date variant*/
case 'D':
return '<span class="product_custom_date">' . vmJsApi::date($value, 'LC1', TRUE) . '</span>';
//vmJsApi::jDate($field->custom_value, 'field['.$row.'][custom_value]','field_'.$row.'_customvalue').$priceInput;
break;
/* text area or editor No vmText, only displayed in BE */
/* text area or editor No vmText, only displayed in BE */
case 'X':
case 'Y':
return $value;
break;
//.........这里部分代码省略.........
示例4: displayProductCustomfieldFE
//.........这里部分代码省略.........
continue;
}
$parentStock += $available;
$priceStr = '';
if ($customfield->wPrice) {
//$product = $productModel->getProductSingle((int)$child['virtuemart_product_id'],false);
$productPrices = $calculator->getProductPrices($productChild);
$priceStr = ' (' . $currency->priceDisplay($productPrices['salesPrice']) . ')';
}
$options[] = array('value' => JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $child['virtuemart_product_id']), 'text' => $child[$customfield->customfield_value] . $priceStr);
if ($selected == $child['virtuemart_product_id']) {
$selectedFound = true;
vmdebug($customfield->virtuemart_product_id . ' $selectedFound by vRequest ' . $selected);
}
//vmdebug('$child productId ',$child['virtuemart_product_id'],$customfield->customfield_value,$child);
}
}
if (!$selectedFound) {
$pos = array_search($customfield->virtuemart_product_id, $product->allIds);
if (isset($product->allIds[$pos - 1])) {
$selected = $product->allIds[$pos - 1];
//vmdebug($customfield->virtuemart_product_id.' Set selected to - 1 allIds['.($pos-1).'] = '.$selected.' and count '.$dynChilds);
//break;
} elseif (isset($product->allIds[$pos])) {
$selected = $product->allIds[$pos];
//vmdebug($customfield->virtuemart_product_id.' Set selected to allIds['.$pos.'] = '.$selected.' and count '.$dynChilds);
} else {
$selected = $customfield->virtuemart_product_id;
//vmdebug($customfield->virtuemart_product_id.' Set selected to $customfield->virtuemart_product_id ',$selected,$product->allIds);
}
}
$url = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $selected;
$html .= JHtml::_('select.genericlist', $options, $fieldname, 'onchange="window.top.location.href=this.options[this.selectedIndex].value" size="1" class="vm-chzn-select no-vm-bind" data-dynamic-update="1" ', "value", "text", JRoute::_($url, false), $idTag);
vmJsApi::chosenDropDowns();
if ($customfield->parentOrderable == 0) {
if ($product->product_parent_id == 0) {
$product->orderable = FALSE;
} else {
$product->product_in_stock = $parentStock;
}
} else {
}
$dynChilds++;
$customfield->display = $html;
break;
/*Date variant*/
/*Date variant*/
case 'D':
if (empty($customfield->custom_value)) {
$customfield->custom_value = 'LC2';
}
//Customer selects date
if ($customfield->is_input) {
$customfield->display = '<span class="product_custom_date">' . vmJsApi::jDate($customfield->customfield_value, $customProductDataName) . '</span>';
//vmJsApi::jDate($field->custom_value, 'field['.$row.'][custom_value]','field_'.$row.'_customvalue').$priceInput;
} else {
$customfield->display = '<span class="product_custom_date">' . vmJsApi::date($customfield->customfield_value, $customfield->custom_value, TRUE) . '</span>';
}
break;
/* text area or editor No vmText, only displayed in BE */
/* text area or editor No vmText, only displayed in BE */
case 'X':
case 'Y':
$customfield->display = $customfield->customfield_value;
break;
/* string or integer */
示例5: getSearchCustom
public function getSearchCustom()
{
$emptyOption = array('virtuemart_custom_id' => 0, 'custom_title' => vmText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION'));
$this->_db = JFactory::getDBO();
$this->_db->setQuery('SELECT `virtuemart_custom_id`, `custom_title` FROM `#__virtuemart_customs` WHERE `field_type` ="P"');
$this->options = $this->_db->loadAssocList();
$this->custom_parent_id = 0;
if ($this->custom_parent_id = vRequest::getInt('custom_parent_id', 0)) {
$this->_db->setQuery('SELECT `virtuemart_custom_id`, `custom_title` FROM `#__virtuemart_customs` WHERE custom_parent_id=' . $this->custom_parent_id);
$this->selected = $this->_db->loadObjectList();
$this->searchCustomValues = '';
foreach ($this->selected as $selected) {
$this->_db->setQuery('SELECT `custom_value` as virtuemart_custom_id,`custom_value` as custom_title FROM `#__virtuemart_product_customfields` WHERE virtuemart_custom_id=' . $selected->virtuemart_custom_id);
$valueOptions = $this->_db->loadAssocList();
$valueOptions = array_merge(array($emptyOption), $valueOptions);
$this->searchCustomValues .= vmText::_($selected->custom_title) . ' ' . JHtml::_('select.genericlist', $valueOptions, 'customfields[' . $selected->virtuemart_custom_id . ']', 'class="inputbox"', 'virtuemart_custom_id', 'custom_title', 0);
}
}
// add search for declared plugins
JPluginHelper::importPlugin('vmcustom');
$dispatcher = JDispatcher::getInstance();
$plgDisplay = $dispatcher->trigger('plgVmSelectSearchableCustom', array(&$this->options, &$this->searchCustomValues, $this->custom_parent_id));
if (!empty($this->options)) {
$this->options = array_merge(array($emptyOption), $this->options);
// render List of available groups
vmJsApi::chosenDropDowns();
$this->searchCustomList = vmText::_('COM_VIRTUEMART_SET_PRODUCT_TYPE') . ' ' . JHtml::_('select.genericlist', $this->options, 'custom_parent_id', 'class="inputbox vm-chzn-select"', 'virtuemart_custom_id', 'custom_title', $this->custom_parent_id);
} else {
$this->searchCustomList = '';
}
}
示例6: select
/**
*
* @author Patrick Kohl
* @param array $options( value & text)
* @param string $name option name
* @param string $defaut defaut value
* @param string $key option value
* @param string $text option text
* @param boolean $zero add a '0' value in the option
* return a select list
*/
public static function select($name, $options, $default = '0', $attrib = "onchange='submit();'", $key = 'value', $text = 'text', $zero = true, $chosenDropDowns = true, $tranlsate = true)
{
if ($zero == true) {
$option = array($key => "0", $text => vmText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION'));
$options = array_merge(array($option), $options);
}
if ($chosenDropDowns) {
vmJsApi::chosenDropDowns();
$attrib .= ' class="vm-chzn-select"';
}
return VmHtml::genericlist($options, $name, $attrib, $key, $text, $default, false, $tranlsate);
}
示例7: lVendor
function lVendor()
{
// If the current user is a vendor, load the store data
if ($this->userDetails->user_is_vendor) {
vmJsApi::addJScript('/administrator/components/com_virtuemart/assets/js/vm2admin.js', false, false);
vmJsApi::addJScript('fancybox/jquery.mousewheel-3.0.4.pack');
vmJsApi::addJScript('fancybox/jquery.easing-1.3.pack');
vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack');
vmJsApi::addJScript('jquery.ui.autocomplete.html');
vmJsApi::chosenDropDowns();
vmJsApi::jQueryUi();
$currencymodel = tmsModel::getModel('currency', 'VirtuemartModel');
$currencies = $currencymodel->getCurrencies();
$this->assignRef('currencies', $currencies);
if (!$this->_orderList) {
$this->lOrderlist();
}
$vendorModel = tmsModel::getModel('vendor');
$vendorModel->setId($this->userDetails->virtuemart_vendor_id);
$this->vendor = $vendorModel->getVendor();
$vendorModel->addImages($this->vendor);
}
}
示例8: display
//.........这里部分代码省略.........
$parent = $product_model->getProduct($product->product_parent_id);
$document->addHeadLink($parent->canonical, 'canonical', 'rel', '');
} else {
$document->addHeadLink($product->canonical, 'canonical', 'rel', '');
}
} else {
if ($format == 'pdf') {
defined('K_PATH_IMAGES') or define('K_PATH_IMAGES', VMPATH_ROOT);
}
}
// Set the titles
// $document->setTitle should be after the additem pathway
if ($product->customtitle) {
$document->setTitle(strip_tags(html_entity_decode($product->customtitle, ENT_QUOTES)));
} else {
$document->setTitle(strip_tags(html_entity_decode(($category->category_name ? vmText::_($category->category_name) . ' : ' : '') . $product->product_name, ENT_QUOTES)));
}
$this->allowReview = $ratingModel->allowReview($product->virtuemart_product_id);
$this->showReview = $ratingModel->showReview($product->virtuemart_product_id);
$this->rating_reviews = '';
if ($this->showReview) {
$this->review = $ratingModel->getReviewByProduct($product->virtuemart_product_id);
$this->rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
}
if ($this->showRating) {
$this->vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
}
$this->allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
$superVendor = vmAccess::isSuperVendor();
if ($superVendor == 1 or $superVendor == $product->virtuemart_vendor_id or $superVendor) {
$edit_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&manage=1&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id;
$this->edit_link = $this->linkIcon($edit_link, 'COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT', 'edit', false, false);
} else {
$this->edit_link = "";
}
// Load the user details
$this->user = JFactory::getUser();
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = vmURI::getCleanUrl();
$this->assignRef('more_reviews', $uristring);
if ($product->metadesc) {
$document->setDescription(strip_tags(html_entity_decode($product->metadesc, ENT_QUOTES)));
} else {
$document->setDescription(strip_tags(html_entity_decode($product->product_name, ENT_QUOTES)) . " " . $category->category_name . " " . strip_tags(html_entity_decode($product->product_s_desc, ENT_QUOTES)));
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($app->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $product->product_name);
//Maybe better product_name
}
if ($app->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
$user = JFactory::getUser();
$showBasePrice = (vmAccess::manager() or vmAccess::isSuperVendor());
$this->assignRef('showBasePrice', $showBasePrice);
$productDisplayShipments = array();
$productDisplayPayments = array();
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->assignRef('productDisplayPayments', $productDisplayPayments);
$this->assignRef('productDisplayShipments', $productDisplayShipments);
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
if (vRequest::getCmd('layout', 'default') == 'notify') {
$this->setLayout('notify');
}
//Added by Seyi Awofadeju to catch notify layout
VmConfig::loadJLang('com_virtuemart');
vmJsApi::chosenDropDowns();
//This must be loaded after the customfields are rendered (they may need to overwrite the handlers)
if (VmConfig::get('jdynupdate', TRUE) or $app->isAdmin()) {
vmJsApi::jDynUpdate();
}
if ($show_prices == '1') {
if (!class_exists('calculationHelper')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php';
}
vmJsApi::jPrice();
}
parent::display($tpl);
}
示例9: display
//.........这里部分代码省略.........
$rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id);
$this->assignRef('rating_reviews', $rating_reviews);
}
if ($this->showRating) {
$vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
$this->assignRef('vote', $vote);
//$rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
//$this->assignRef('rating', $rating);
//vmdebug('Should show rating vote and rating',$vote,$rating);
}
$allowRating = $ratingModel->allowRating($product->virtuemart_product_id);
$this->assignRef('allowRating', $allowRating);
// Check for editing access
// @todo build edit page
$user = JFactory::getUser();
$superVendor = VmConfig::isSuperVendor();
if($superVendor == 1 or $superVendor==$product->virtuemart_vendor_id or ($superVendor)){
$edit_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&manage=1&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id;
$edit_link = $this->linkIcon($edit_link, 'COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT', 'edit', false, false);
} else {
$edit_link = "";
}
$this->assignRef('edit_link', $edit_link);
// Load the user details
$user = JFactory::getUser();
$this->assignRef('user',$user);
// More reviews link
$uri = JURI::getInstance();
$uri->setVar('showall', 1);
$uristring = vmURI::getCleanUrl();
$this->assignRef('more_reviews', $uristring);
if ($product->metadesc) {
$document->setDescription($product->metadesc);
} else {
$document->setDescription( $product->product_name . " " . $category->category_name . " " . $product->product_s_desc );
}
if ($product->metakey) {
$document->setMetaData('keywords', $product->metakey);
}
if ($product->metarobot) {
$document->setMetaData('robots', $product->metarobot);
}
if ($mainframe->getCfg('MetaTitle') == '1') {
$document->setMetaData('title', $product->product_name); //Maybe better product_name
}
if ($mainframe->getCfg('MetaAuthor') == '1') {
$document->setMetaData('author', $product->metaauthor);
}
$user = JFactory::getUser();
$showBasePrice = ($user->authorise('core.admin','com_virtuemart') or $user->authorise('core.manage','com_virtuemart') or VmConfig::isSuperVendor());
$this->assignRef('showBasePrice', $showBasePrice);
$productDisplayShipments = array();
$productDisplayPayments = array();
if (!class_exists('vmPSPlugin'))
require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php');
JPluginHelper::importPlugin('vmshipment');
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayShipment', array($product, &$productDisplayShipments));
$returnValues = $dispatcher->trigger('plgVmOnProductDisplayPayment', array($product, &$productDisplayPayments));
$this->assignRef('productDisplayPayments', $productDisplayPayments);
$this->assignRef('productDisplayShipments', $productDisplayShipments);
if (empty($category->category_template)) {
$category->category_template = VmConfig::get('categorytemplate');
}
shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);
shopFunctionsF::addProductToRecent($virtuemart_product_id);
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
if(vRequest::getCmd( 'layout', 'default' )=='notify') $this->setLayout('notify'); //Added by Seyi Awofadeju to catch notify layout
VmConfig::loadJLang('com_virtuemart');
vmJsApi::chosenDropDowns();
parent::display($tpl);
}
示例10: displayProductCustomfieldFE
//.........这里部分代码省略.........
if($customfield->wPrice){
//$product = $productModel->getProductSingle((int)$child['virtuemart_product_id'],false);
$productPrices = $calculator->getProductPrices ($productChild);
$priceStr = ' (' . $currency->priceDisplay ($productPrices['salesPrice']) . ')';
}
$options[] = array('value' => JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $virtuemart_category_id . '&virtuemart_product_id=' . $child['virtuemart_product_id']), 'text' => $child[$customfield->customfield_value].$priceStr);
if($selected==$child['virtuemart_product_id']){
$selectedFound = true;
vmdebug($customfield->virtuemart_product_id.' $selectedFound by vRequest '.$selected);
}
//vmdebug('$child productId ',$child['virtuemart_product_id'],$customfield->customfield_value,$child);
}
}
if(!$selectedFound){
$pos = array_search($customfield->virtuemart_product_id, $product->allIds);
if(isset($product->allIds[$pos-1])){
$selected = $product->allIds[$pos-1];
//vmdebug($customfield->virtuemart_product_id.' Set selected to - 1 allIds['.($pos-1).'] = '.$selected.' and count '.$dynChilds);
//break;
} elseif(isset($product->allIds[$pos])){
$selected = $product->allIds[$pos];
//vmdebug($customfield->virtuemart_product_id.' Set selected to allIds['.$pos.'] = '.$selected.' and count '.$dynChilds);
} else {
$selected = $customfield->virtuemart_product_id;
//vmdebug($customfield->virtuemart_product_id.' Set selected to $customfield->virtuemart_product_id ',$selected,$product->allIds);
}
}
$url = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id='.
$virtuemart_category_id .'&virtuemart_product_id='. $selected;
$html .= JHtml::_ ('select.genericlist', $options, $fieldname, 'onchange="window.top.location.href=this.options[this.selectedIndex].value" size="1" class="vm-chzn-select" data-dynamic-update="1" ', "value", "text",
JRoute::_ ($url,false),$idTag);
vmJsApi::chosenDropDowns();
if($customfield->parentOrderable==0){
if($product->product_parent_id==0){
$product->orderable = FALSE;
} else {
$product->product_in_stock = $parentStock;
}
} else {
}
$dynChilds++;
$customfield->display = $html;
break;
/*Date variant*/
case 'D':
if(empty($customfield->custom_value)) $customfield->custom_value = 'LC2';
//Customer selects date
if($customfield->is_input){
$customfield->display = '<span class="product_custom_date">' . vmJsApi::jDate ($customfield->customfield_value,$customProductDataName) . '</span>'; //vmJsApi::jDate($field->custom_value, 'field['.$row.'][custom_value]','field_'.$row.'_customvalue').$priceInput;
}
//Customer just sees a date
else {
$customfield->display = '<span class="product_custom_date">' . vmJsApi::date ($customfield->customfield_value, $customfield->custom_value, TRUE) . '</span>';
}
break;
/* text area or editor No vmText, only displayed in BE */
case 'X':
示例11: lVendor
function lVendor()
{
// If the current user is a vendor, load the store data
if ($this->userDetails->user_is_vendor) {
$front = JURI::root(true) . '/components/com_virtuemart/assets/';
$admin = JURI::root(true) . '/administrator/components/com_virtuemart/assets/';
$document = JFactory::getDocument();
$document->addScript($front . 'js/fancybox/jquery.mousewheel-3.0.4.pack.js');
$document->addScript($front . 'js/fancybox/jquery.easing-1.3.pack.js');
$document->addScript($front . 'js/fancybox/jquery.fancybox-1.3.4.pack.js');
vmJsApi::chosenDropDowns();
/*vmJsApi::js ('jquery-ui', FALSE, '', TRUE);
vmJsApi::js ('jquery.ui.autocomplete.html');
vmJsApi::js( 'jquery.noConflict');
$document->addScript($admin.'js/vm2admin.js');*/
$currencymodel = VmModel::getModel('currency', 'VirtuemartModel');
$currencies = $currencymodel->getCurrencies();
$this->assignRef('currencies', $currencies);
if (!$this->_orderList) {
$this->lOrderlist();
}
$vendorModel = VmModel::getModel('vendor');
/*if (Vmconfig::get('multix', 'none') === 'none') {
//$vendorModel->setId(1);
} else {*/
$vendorModel->setId($this->userDetails->virtuemart_vendor_id);
//}
$this->vendor = $vendorModel->getVendor();
$vendorModel->addImages($this->vendor);
}
}
示例12: select_add_on
/**
*
* @author Patrick Kohl
* @param array $options ( value & text)
* @param string $name option name
* @param string $defaut defaut value
* @param string $key option value
* @param string $text option text
* @param boolean $zero add a '0' value in the option
* return a select list
*/
public static function select_add_on($name, $options, $default = '0', $attrib = "onchange='submit();'", $key = 'value', $text = 'text', $iframe_link, $zero = true, $chosenDropDowns = true, $tranlsate = true)
{
$doc = JFactory::getDocument();
$doc->addScript(JUri::root() . '/administrator/components/com_tsmart/assets/js/controller/html_select_add_on.js');
$doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/js/controller/html_select_add_on.less');
$input = JFactory::getApplication()->input;
$reload_iframe_id = $input->get('iframe_id', '', 'string');
$reload_ui_dialog_id = $input->get('ui_dialog_id', '', 'string');
$remove_ui_dialog = $input->get('remove_ui_dialog', false, 'boolean');
if ($zero == true) {
$option = array($key => "0", $text => tsmText::_('com_tsmart_LIST_EMPTY_OPTION'));
$options = array_merge(array($option), $options);
}
if ($chosenDropDowns) {
vmJsApi::chosenDropDowns();
$attrib .= ' class="vm-chzn-select"';
}
$select = VmHtml::genericlist($options, $name, $attrib, $key, $text, $default, false, $tranlsate);
$doc = JFactory::getDocument();
ob_start();
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#div_<?php
echo $name;
?>
').html_select_add_on({
id_field_edit_content_wrapper: 'field_edit_content_wrapper_<?php
echo $name;
?>
',
iframe_link: '<?php
echo $iframe_link;
?>
',
link_reload: '<?php
echo base64_encode(JUri::getInstance()->toString());
?>
',
ui_dialog_id: 'dialog_content_<?php
echo $name;
?>
',
iframe_id: 'iframe_<?php
echo $name;
?>
',
reload_iframe_id: '<?php
echo $reload_iframe_id;
?>
',
reload_ui_dialog_id: '<?php
echo $reload_ui_dialog_id;
?>
',
remove_ui_dialog: '<?php
echo json_encode($remove_ui_dialog);
?>
'
});
});
</script>
<?php
$script_content = ob_get_clean();
$script_content = TSMUtility::remove_string_javascript($script_content);
$doc->addScriptDeclaration($script_content);
ob_start();
?>
<div id="div_<?php
echo $name;
?>
" class="html_select_add_on">
<div class="input-append ">
<div id="field_edit_content_wrapper_<?php
echo $name;
?>
" style="display: none">
<iframe id="vm-iframe_<?php
echo $name;
?>
" scrolling="no" src=""></iframe>
</div>
<?php
echo $select;
?>
<button class="btn edit_content btn_<?php
//.........这里部分代码省略.........