本文整理汇总了PHP中ShopFunctions类的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions类的具体用法?PHP ShopFunctions怎么用?PHP ShopFunctions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ShopFunctions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: permalink
/**
* Obtiene el enlace a la categor?a
*/
public function permalink()
{
$mc = RMUtilities::module_config('shop');
$link = ShopFunctions::get_url();
$link .= $mc['urlmode'] == 0 ? '?cat=' . $this->id() : 'category/' . $this->path();
return $link;
}
示例2: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = $this->getLayout();
$task = vRequest::getCmd('task', $layoutName);
$this->assignRef('task', $task);
if ($layoutName == 'edit') {
//For shoppergroup specific price display
VmConfig::loadJLang('com_virtuemart_config');
VmConfig::loadJLang('com_virtuemart_shoppers', true);
$shoppergroup = $model->getShopperGroup();
$this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
$vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendors);
$this->assignRef('shoppergroup', $shoppergroup);
$this->addStandardEditViewCommands();
} else {
$this->SetViewTitle();
$showVendors = $this->showVendors();
$this->assignRef('showVendors', $showVendors);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$shoppergroups = $model->getShopperGroups(false, true);
$this->assignRef('shoppergroups', $shoppergroups);
$pagination = $model->getPagination();
$this->assignRef('sgrppagination', $pagination);
}
parent::display($tpl);
}
示例3: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
$class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : '';
return ShopFunctions::renderTaxList($value, $control_name . '[' . $name . ']', $class);
// $class = 'multiple="true" size="10"';
// return JHTML::_('select.genericlist', $taxrates, $control_name . '[' . $name . '][]', $class, 'value', 'text', $value, $control_name . $name);
}
示例4: __construct
/**
* constructs a VmModel
* setMainTable defines the maintable of the model
*
* @author Max Milbers
*/
function __construct()
{
parent::__construct('virtuemart_product_id');
$this->setMainTable('products');
$this->starttime = microtime(TRUE);
$this->maxScriptTime = ini_get('max_execution_time') * 0.95 - 1;
// $this->addvalidOrderingFieldName(array('m.mf_name','pp.product_price'));
$view = JRequest::getVar('view');
$isSite = JFactory::getApplication()->isSite() && $view !== 'product' && $view !== 'inventory';
if ($isSite) {
$browseOrderByFields = VmConfig::get('browse_orderby_fields', array('product_sku', 'category_name', 'mf_name', 'product_name'));
} else {
JLoader::register('shopFunctions', JPATH_VM_ADMINISTRATOR . 'helpers/shopfunctions.php');
$browseOrderByFields = ShopFunctions::getValidProductFilterArray();
$this->addvalidOrderingFieldName(array('product_price', 'p.`product_sales`'));
//$this->addvalidOrderingFieldName (array('product_price'));
// vmdebug('$browseOrderByFields',$browseOrderByFields);
}
$this->addvalidOrderingFieldName((array) $browseOrderByFields);
$this->removevalidOrderingFieldName('virtuemart_product_id');
$this->removevalidOrderingFieldName('product_sales');
//unset($this->_validOrderingFieldName[0]);//virtuemart_product_id
array_unshift($this->_validOrderingFieldName, 'p.virtuemart_product_id');
$this->_selectedOrdering = VmConfig::get('browse_orderby_field', '`p`.virtuemart_product_id');
$this->setToggleName('product_special');
$this->initialiseRequests();
//This is just done now for the moment for developing, the idea is of course todo this only when needed.
$this->updateRequests();
}
示例5: can
function can($task, $view, $created_by = null, $vendorId = null)
{
static $user_id = null;
static $isAdmin = null;
static $vendor = null;
if ($vendor === null) {
JLoader::register('Permissions', JPATH_VM_ADMINISTRATOR . '/helpers/permissions.php');
$vendor = Permissions::getInstance()->isSuperVendor();
if ($user_id = JFactory::getUser()->get('id')) {
$isAdmin = Permissions::getInstance()->check("admin,storeadmin");
JLoader::register('ShopFunctions', JPATH_VM_ADMINISTRATOR . '/helpers/shopfunctions.php');
}
}
if (!$vendor) {
return '';
}
if ($vendor > 1) {
if (!ShopFunctions::can($task, $view)) {
return false;
}
// only link to own entries or same vendor id
if ($vendorId) {
if ($vendorId != $vendor) {
return false;
}
} elseif ($created_by != $user_id) {
return false;
}
}
return true;
}
示例6: getOptions
protected function getOptions()
{
// if VM is not installed
if (!JFolder::exists(JPATH_ROOT . '/administrator/components/com_virtuemart') or !class_exists('ShopFunctions')) {
// add the root item
$option = new stdClass();
$option->text = JText::_('MOD_ACCORDEONCK_VIRTUEMART_NOTFOUND');
$option->value = '0';
$options[] = $option;
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
VmConfig::loadConfig();
$categorylist = ShopFunctions::categoryListTree();
// $categorylist = 'testced';
$categorylist = trim($categorylist, '</option>');
$categorylist = explode("</option><option", $categorylist);
// add the root item
$option = new stdClass();
$option->text = JText::_('MOD_ACCORDEONCK_VIRTUEMART_ROOTNODE');
$option->value = '0';
$options[] = $option;
foreach ($categorylist as $cat) {
$option = new stdClass();
$text = explode(">", $cat);
$option->text = trim($text[1]);
$option->value = strval(trim(trim(trim($text[0]), '"'), 'value="'));
$options[] = $option;
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
示例7: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
// $this->assignRef('perms', Permissions::getInstance());
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$shoppergroup = $model->getShopperGroup();
$this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
$vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendors);
$this->assignRef('shoppergroup', $shoppergroup);
$this->addStandardEditViewCommands();
} else {
$this->SetViewTitle();
JToolBarHelper::makeDefault();
$this->loadHelper('permissions');
$showVendors = Permissions::getInstance()->check('admin');
$this->assignRef('showVendors', $showVendors);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$shoppergroups = $model->getShopperGroups(false, true);
$this->assignRef('shoppergroups', $shoppergroups);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例8: display
function display($tpl = null)
{
//Load helpers
$this->loadHelper('currencydisplay');
$this->loadHelper('html');
// Get the data
$model = VmModel::getModel('product');
// Create filter
$this->addStandardDefaultViewLists($model);
$inventorylist = $model->getProductListing(false, false);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
// Apply currency
$currencydisplay = CurrencyDisplay::getInstance();
foreach ($inventorylist as $virtuemart_product_id => $product) {
//TODO oculd be interesting to show the price for each product, and all stored ones $product->product_in_stock
$product->product_instock_value = $currencydisplay->priceDisplay($product->product_price, '', $product->product_in_stock, false);
$product->product_price_display = $currencydisplay->priceDisplay($product->product_price, '', 1, false);
$product->weigth_unit_display = ShopFunctions::renderWeightUnit($product->product_weight_uom);
}
$this->assignRef('inventorylist', $inventorylist);
$options = array();
$options[] = JHTML::_('select.option', '', JText::_('COM_VIRTUEMART_DISPLAY_STOCK') . ':');
$options[] = JHTML::_('select.option', 'stocklow', JText::_('COM_VIRTUEMART_STOCK_LEVEL_LOW'));
$options[] = JHTML::_('select.option', 'stockout', JText::_('COM_VIRTUEMART_STOCK_LEVEL_OUT'));
$this->lists['stockfilter'] = JHTML::_('select.genericlist', $options, 'search_type', 'onChange="document.adminForm.submit(); return false;"', 'value', 'text', JRequest::getVar('search_type'));
$this->lists['filter_product'] = JRequest::getVar('filter_product');
// $this->assignRef('lists', $lists);
/* Toolbar */
$this->SetViewTitle('PRODUCT_INVENTORY');
JToolBarHelper::publish();
JToolBarHelper::unpublish();
parent::display($tpl);
}
示例9: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
if (!class_exists('vmPSPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = vRequest::getCmd('layout', 'default');
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
$shipment = $model->getShipment();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
if (file_exists($formFile)) {
$shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$shipment->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
VmTable::bindParameterableToSubField($shipment, $varsToPush);
$shipment->form->bind($shipment->getProperties());
} else {
$shipment->form = null;
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if ($this->showVendors()) {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->assignRef('shipment', $shipment);
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
foreach ($this->shipments as &$data) {
// Write the first 5 shoppergroups in the list
$data->shipmentShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例10: __construct
/**
* constructs a VmModel
* setMainTable defines the maintable of the model
*
* @author Max Milbers
*/
function __construct()
{
parent::__construct('virtuemart_product_id');
$this->setMainTable('products');
$this->starttime = microtime(TRUE);
$this->maxScriptTime = VmConfig::getExecutionTime() * 0.95 - 1;
$this->memory_limit = VmConfig::getMemoryLimit() - 4;
// $this->addvalidOrderingFieldName(array('m.mf_name','pp.product_price'));
$app = JFactory::getApplication();
if ($app->isSite()) {
$this->_validOrderingFieldName = array();
$browseOrderByFields = VmConfig::get('browse_orderby_fields', array('product_sku', 'category_name', 'mf_name', 'product_name'));
} else {
if (!class_exists('shopFunctions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
}
$browseOrderByFields = ShopFunctions::getValidProductFilterArray();
$this->addvalidOrderingFieldName(array('product_price', 'product_sales'));
//$this->addvalidOrderingFieldName (array('product_price'));
// vmdebug('$browseOrderByFields',$browseOrderByFields);
}
$this->addvalidOrderingFieldName((array) $browseOrderByFields);
$this->removevalidOrderingFieldName('virtuemart_product_id');
//$this->removevalidOrderingFieldName ('product_sales');
//unset($this->_validOrderingFieldName[0]);//virtuemart_product_id
array_unshift($this->_validOrderingFieldName, 'p.virtuemart_product_id');
$this->_selectedOrdering = VmConfig::get('browse_orderby_field', '`p`.virtuemart_product_id');
$this->setToggleName('product_special');
$this->initialiseRequests();
//This is just done now for the moment for developing, the idea is of course todo this only when needed.
$this->updateRequests();
}
示例11: getInput
protected function getInput() {
return ShopFunctions::renderTaxList($this->value, $this->name, '');
// $class = 'multiple="true" size="10"';
// return JHtml::_('select.genericlist', $taxrates, $control_name . '[' . $name . '][]', $class, 'value', 'text', $value, $control_name . $name);
}
示例12: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
if (!class_exists('vmPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
}
$this->assignRef('perms', Permissions::getInstance());
$model = VmModel::getModel('paymentmethod');
//@todo should be depended by loggedVendor
// $vendorId=1;
// $this->assignRef('vendorId', $vendorId);
// TODO logo
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
$vendorModel = VmModel::getModel('vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$currencyModel = VmModel::getModel('currency');
$currencyModel = $currencyModel->getCurrency($vendor->vendor_currency);
$this->assignRef('vendor_currency', $currencyModel->currency_symbol);
if ($layoutName == 'edit') {
// Load the helper(s)
if (!class_exists('VmImage')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('vmParameters')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php';
}
$payment = $model->getPayment();
$this->assignRef('payment', $payment);
$this->assignRef('vmPPaymentList', self::renderInstalledPaymentPlugins($payment->payment_jplugin_id));
// $this->assignRef('PaymentTypeList',self::renderPaymentRadioList($paym->payment_type));
// $this->assignRef('creditCardList',self::renderCreditCardRadioList($paym->payment_creditcards));
// echo 'humpf <pre>'.print_r($paym).'</pre>' ;
//$this->assignRef('creditCardList',ShopFunctions::renderCreditCardList($paym->payment_creditcards,true));
$this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($payment->virtuemart_shoppergroup_ids, true));
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($payment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->addStandardEditViewCommands($payment->virtuemart_paymentmethod_id);
} else {
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$payments = $model->getPayments();
$this->assignRef('payments', $payments);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例13: getCategories
function getCategories()
{
JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'tables');
require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'shopfunctions.php';
JRequest::setVar('filter_order', 'c.ordering');
JRequest::setVar('filter_order_Dir', 'ASC');
$list = ShopFunctions::categoryListTree(array($this->getState('catid')));
return '<select onchange="this.form.submit();" id="catid" name="catid"><option value="0">' . JText::_('K2MART_ANY') . '</option>' . $list . '</select>';
}
示例14: display
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('permissions');
$this->loadHelper('html');
if (!class_exists('vmPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
}
$this->perms = Permissions::getInstance();
$model = VmModel::getModel('paymentmethod');
//@todo should be depended by loggedVendor
// $vendorId=1;
// $this->assignRef('vendorId', $vendorId);
$vendorModel = VmModel::getModel('vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$currencyModel = VmModel::getModel('currency');
$currencyModel->setId($vendor->vendor_currency);
$currency = $currencyModel->getData();
$this->vendor_currency = $currency->currency_symbol;
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
// Load the helper(s)
$this->loadHelper('image');
// jimport('joomla.html.pane');
$this->payment = $model->getPayment();
// $this->vmPPaymentList = self::InstalledPaymentPlgSelectList($payment->payment_jplugin_id);
// $this->assignRef('PaymentTypeList',self::renderPaymentRadioList($paym->payment_type));
// $this->assignRef('creditCardList',self::renderCreditCardRadioList($paym->payment_creditcards));
// echo 'humpf <pre>'.print_r($paym).'</pre>' ;
//$this->assignRef('creditCardList',ShopFunctions::renderCreditCardList($paym->payment_creditcards,true));
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($this->payment->virtuemart_shoppergroup_ids, true);
if (Vmconfig::get('multix', 'none') !== 'none') {
$this->vendorList = ShopFunctions::renderVendorList($this->payment->virtuemart_vendor_id);
}
// TODO logo
$this->SetViewTitle('', $this->payment->payment_name);
$this->addStandardEditViewCommands($this->payment->virtuemart_paymentmethod_id);
} else {
if (JRequest::getWord('format', '') === 'raw') {
$tpl = 'results';
} else {
$this->SetViewTitle();
$this->addStandardDefaultViewCommands();
// know payment list
$this->installedPayments = $this->PaymentPlgList();
}
$this->addStandardDefaultViewLists($model);
$this->payments = $model->getPayments();
$this->pagination = $model->getPagination();
}
parent::display($tpl);
if ($tpl === 'results') {
echo $this->AjaxScripts();
}
}
示例15: shop_bk_categories_show
function shop_bk_categories_show($options)
{
include_once XOOPS_ROOT_PATH . '/modules/shop/class/shopcategory.class.php';
include_once XOOPS_ROOT_PATH . '/modules/shop/class/shopfunctions.php';
$categories = array();
ShopFunctions::categos_list($categories);
array_walk($categories, 'shop_dashed');
RMTemplate::get()->add_style('blocks.css', 'shop');
return $categories;
}