本文整理汇总了PHP中oledrion_utils::getModuleOption方法的典型用法代码示例。如果您正苦于以下问题:PHP oledrion_utils::getModuleOption方法的具体用法?PHP oledrion_utils::getModuleOption怎么用?PHP oledrion_utils::getModuleOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oledrion_utils
的用法示例。
在下文中一共展示了oledrion_utils::getModuleOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: b_oledrion_rated_show
/**
* Affiche les produits les mieux notés
*/
function b_oledrion_rated_show($options)
{
// '10|0'; // Voir 10 produits, pour toutes les catégories ou une catégorie particulière
global $xoopsConfig, $xoopsTpl;
include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$products = $block = array();
$start = 0;
$limit = $options[0];
$categoryId = $options[1];
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('bestrated')->setStart($start)->setLimit($limit)->setSort('product_rating')->setOrder('DESC')->setCategory($categoryId);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if (isset($products['lastTitle'])) {
unset($products['lastTitle']);
}
if (count($products) > 0) {
$url = OLEDRION_URL . 'include/oledrion.css';
$block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
$block['block_products'] = $products;
$xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
return $block;
} else {
// La liste des produits est introuvable (on ne trouve pas les produits vendus dans le stock des produits)
return false;
}
}
示例2: b_oledrion_recomm_show
/**
* Renvoie la liste des produits recommandés
*/
function b_oledrion_recomm_show($options)
{
// '10|0'; // Voir 10 produits, pour toutes les catégories ou une catégorie particulière
global $xoopsConfig, $xoopsTpl;
include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$products = $block = array();
$start = 0;
$limit = $options[0];
$categoyrId = $options[1];
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recommended')->setStart($start)->setLimit($limit)->setSort('product_recommended')->setOrder('DESC')->setCategory($categoyrId);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if ($h_oledrion_products->getRecommendedCount() > $limit) {
// Il y a plus de produits recommandés dans la BDD que dans le bloc, on affiche donc un lien vers la page des produits recommandés
$block['showMore'] = true;
}
if (isset($products['lastTitle'])) {
unset($products['lastTitle']);
}
if (count($products) > 0) {
$url = OLEDRION_URL . 'include/oledrion.css';
$block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
$block['block_products'] = $products;
$xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
return $block;
} else {
// Pas de produits recommandés
return false;
}
}
示例3: b_oledrion_random_show
/**
* Affiche x produit(s) au hasard
*/
function b_oledrion_random_show($options)
{
// '10|0|0'; // Voir 10 produits, pour toutes les catégories ou une catégorie particulière, et pour ce mois-ci ou pour tout le temps ?
global $xoopsConfig, $xoopsTpl;
include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$products = $block = array();
$start = 0;
$limit = $options[0];
$categoryId = $options[1];
$thisMonthOnly = intval($options[2]);
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('random')->setStart($start)->setLimit($limit)->setSort('RAND()')->setCategory($categoryId)->setThisMonthOnly($thisMonthOnly);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if (isset($products['lastTitle'])) {
unset($products['lastTitle']);
}
if (count($products) > 0) {
$url = OLEDRION_URL . 'include/oledrion.css';
$block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
$block['block_products'] = $products;
$xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
return $block;
} else {
return false;
}
}
示例4: getCurrentGateway
/**
* Retourne la passerelle de paiement en cours d'utilisation
*
* @return string Le nom de la passerelle de paiement (en fait le nom de son répertoire)
*/
function getCurrentGateway()
{
$return = xoops_trim(oledrion_utils::getModuleOption('used_gateway'));
if ($return == '') {
$return = 'paypal';
// Valeur par défaut
}
return $return;
}
示例5: b_sitemap_oledrion
/**
* oledrion
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Hervé Thouzard (http://www.herve-thouzard.com/)
* @version $Id: oledrion.php 12290 2014-02-07 11:05:17Z beckmi $
*/
function b_sitemap_oledrion()
{
require '../oledrion/header.php';
global $sitemap_configs;
$xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
$table = $xoopsDB->prefix('oledrion_cat');
$id_name = 'cat_cid';
$pid_name = 'cat_pid';
$title_name = 'cat_title';
$url = 'category.php?cat_cid=';
$order = 'cat_title';
include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
$mytree = new XoopsTree($table, $id_name, $pid_name);
$xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
$sitemap = array();
$myts = MyTextSanitizer::getInstance();
$i = 0;
$sql = "SELECT `{$id_name}`,`{$title_name}` FROM `{$table}` WHERE `{$pid_name}`=0";
if ($order != '') {
$sql .= " ORDER BY `{$order}`";
}
$result = $xoopsDB->query($sql);
while (list($catid, $name) = $xoopsDB->fetchRow($result)) {
$sitemap['parent'][$i]['id'] = $catid;
$sitemap['parent'][$i]['title'] = $myts->htmlSpecialChars($name);
if (oledrion_utils::getModuleOption('urlrewriting') == 1) {
// On utilise l'url rewriting
$url = 'category' . '-' . intval($catid) . oledrion_utils::makeSeoUrl($name) . '.html';
} else {
// Pas d'utilisation de l'url rewriting
$url = 'category.php?cat_cid=' . intval($catid);
}
$sitemap['parent'][$i]['url'] = $url;
if (@$sitemap_configs["show_subcategoris"]) {
$j = 0;
$child_ary = $mytree->getChildTreeArray($catid, $order);
foreach ($child_ary as $child) {
$count = strlen($child['prefix']) + 1;
$sitemap['parent'][$i]['child'][$j]['id'] = $child[$id_name];
$sitemap['parent'][$i]['child'][$j]['title'] = $myts->htmlSpecialChars($child[$title_name]);
$sitemap['parent'][$i]['child'][$j]['image'] = $count > 3 ? 4 : $count;
if (oledrion_utils::getModuleOption('urlrewriting') == 1) {
// On utilise l'url rewriting
$url = 'category' . '-' . intval($child[$id_name]) . oledrion_utils::makeSeoUrl($child[$title_name]) . '.html';
} else {
// Pas d'utilisation de l'url rewriting
$url = 'category.php?cat_cid=' . intval($child[$id_name]);
}
$sitemap['parent'][$i]['child'][$j]['url'] = $url;
$j++;
}
}
$i++;
}
return $sitemap;
}
示例6: __construct
public function __construct()
{
// Get the module's preferences
$this->_decimalsCount = oledrion_utils::getModuleOption('decimals_count');
$this->_thousandsSep = oledrion_utils::getModuleOption('thousands_sep');
$this->_decimalSep = oledrion_utils::getModuleOption('decimal_sep');
$this->_moneyFull = oledrion_utils::getModuleOption('money_full');
$this->_moneyShort = oledrion_utils::getModuleOption('money_short');
$this->_monnaiePlace = oledrion_utils::getModuleOption('monnaie_place');
$this->_thousandsSep = str_replace('[space]', ' ', $this->_thousandsSep);
$this->_decimalSep = str_replace('[space]', ' ', $this->_decimalSep);
}
示例7: b_oledrion_recentlysold_show
/**
* This block shows the products that were recently sold
* @param array $options [0] = Nombre maximum de produits à voir
* @return array
*/
function b_oledrion_recentlysold_show($options)
{
global $xoopsConfig, $xoTheme;
require XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$categoryId = 0;
$start = 0;
$limit = $options[0];
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recentlysold')->setStart($start)->setLimit($limit);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if (isset($products['lastTitle'])) {
unset($products['lastTitle']);
}
if (count($products) > 0) {
$block = array();
$block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
$block['block_products'] = $products;
$xoTheme->addStylesheet(OLEDRION_URL . 'assets/css/oledrion.css');
return $block;
} else {
return false;
}
}
示例8: b_oledrion_promotion_show
/**
* Affiche x produit(s) en promotion
*/
function b_oledrion_promotion_show($options)
{
// '10|0'; // Voir 10 produits, pour toutes les catégories ou une catégorie particulière
global $xoopsConfig, $xoTheme;
include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$block = $products = array();
$start = 0;
$limit = $options[0];
$categoryId = $options[1];
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('promotional')->setStart($start)->setLimit($limit)->setSort('product_submitted DESC, product_title')->setOrder('ASC')->setCategory($categoryId);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if (isset($products['lastTitle'])) {
unset($products['lastTitle']);
}
if (count($products) > 0) {
$block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
$block['block_products'] = $products;
$xoTheme->addStylesheet(OLEDRION_URL . 'assets/css/oledrion.css');
return $block;
} else {
return false;
}
}
示例9: b_oledrion_recentlysold_show
/**
* This block shows the products that were recently sold
* @param array $options [0] = Nombre maximum de produits à voir
* @return array
*/
function b_oledrion_recentlysold_show($options)
{
global $xoopsConfig, $xoopsTpl;
require XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$categoryId = 0;
$start = 0;
$limit = $options[0];
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recentlysold')->setStart($start)->setLimit($limit);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if (isset($products['lastTitle'])) {
unset($products['lastTitle']);
}
if (count($products) > 0) {
$url = OLEDRION_URL . 'include/oledrion.css';
$block = array();
$block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg');
$block['block_products'] = $products;
$xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />");
return $block;
} else {
return false;
}
}
示例10: b_oledrion_cart_show
/**
* block to display items in cart
*
* @param integer $options[0] Count of items to show (0 = no limit)
* @return array Block's content
*/
function b_oledrion_cart_show($options)
{
global $mod_pref, $xoopsConfig;
include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
$productsCount = intval($options[0]);
$cartForTemplate = $block = array();
$emptyCart = false;
$shippingAmount = $commandAmount = $vatAmount = $discountsCount = 0;
$goOn = '';
$commandAmountTTC = 0;
$discountsDescription = array();
// Calcul du montant total du caddy
$reductions = new oledrion_reductions();
$reductions->computeCart($cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription, $discountsCount);
$dec = oledrion_utils::getModuleOption('decimals_count');
if ($emptyCart) {
return '';
}
$block['block_money_full'] = oledrion_utils::getModuleOption('money_full');
$block['block_money_short'] = oledrion_utils::getModuleOption('money_short');
$block['block_shippingAmount'] = sprintf("%0." . $dec . 'f', $shippingAmount);
// Montant des frais de port
$block['block_commandAmount'] = sprintf("%0." . $dec . 'f', $commandAmount);
// Montant HT de la commande
$block['block_vatAmount'] = sprintf("%0." . $dec . 'f', $vatAmount);
// Montant de la TVA
$block['block_commandAmountTTC'] = sprintf("%0." . $dec . 'f', $commandAmountTTC);
// Montant TTC de la commande
$block['block_discountsDescription'] = $discountsDescription;
// Liste des réductions accordées
if ($productsCount > 0 && count($cartForTemplate) > $productsCount) {
array_slice($cartForTemplate, 0, $productsCount - 1);
}
$block['block_caddieProducts'] = $cartForTemplate;
// Produits dans le caddy
return $block;
}
示例11: getVar
$msg['PAYS'] = $countries[$commande->getVar('cmd_country')];
$msg['TELEPHONE'] = $commande->getVar('cmd_telephone');
$msg['EMAIL'] = $commande->getVar('cmd_email');
$msg['URL_BILL'] = OLEDRION_URL . 'invoice.php?id=' . $commande->getVar('cmd_id') . '&pass=' . $commande->getVar('cmd_password');
$msg['IP'] = oledrion_utils::IP();
if ($commande->getVar('cmd_bill') == 1) {
$msg['FACTURE'] = _YES;
} else {
$msg['FACTURE'] = _NO;
}
// Send mail to client
oledrion_utils::sendEmailFromTpl('command_client.tpl', $commande -> getVar('cmd_email'), sprintf(_OLEDRION_THANKYOU_CMD, $xoopsConfig['sitename']), $msg);
// Send mail to admin
oledrion_utils::sendEmailFromTpl('command_shop.tpl', oledrion_utils::getEmailsFromGroup(oledrion_utils::getModuleOption('grp_sold')), _OLEDRION_NEW_COMMAND, $msg);
*/
// Send SMS
if (oledrion_utils::getModuleOption('sms_checkout')) {
$information['to'] = ltrim($commande->getVar('cmd_mobile'), 0);
$information['text'] = oledrion_utils::getModuleOption('sms_checkout_text');
$sms = oledrion_sms::sendSms($information);
}
}
} else {
$ret['status'] = 0;
$ret['message'] = _OLEDRION_ERROR10;
}
}
$return = json_encode($ret);
break;
}
echo $return;
示例12: reloadPersistentCart
/**
* Recharge le dernier panier de l'utilisateur
*
* @return boolean
*/
function reloadPersistentCart()
{
global $xoopsUser, $h_oledrion_persistent_cart;
if (oledrion_utils::getModuleOption('persistent_cart') == 0) {
return false;
}
if (is_object($xoopsUser)) {
$persistent_carts = array();
$persistent_carts = $h_oledrion_persistent_cart->getUserProducts();
if (count($persistent_carts) > 0) {
foreach ($persistent_carts as $persistent_cart) {
$this->addProduct($persistent_cart->getVar('persistent_product_id'), $persistent_cart->getVar('persistent_qty'), null);
}
}
}
return true;
}
示例13: ksort
$vendors[0] = _ALL;
ksort($vendors);
$xoopsTpl->assign('disc_vendor_id_options', $vendors);
$xoopsTpl->assign('disc_vendor_id_selected', $item->getVar('disc_vendor_id'));
// Catégorie
$xoopsTpl->assign('disc_cat_cid_options', $categoriesSelect);
// Produits
$products = $h_oledrion_products->getList();
$products[0] = _ALL;
ksort($products);
$xoopsTpl->assign('disc_product_id_options', $products);
$xoopsTpl->assign('disc_product_id_selected', $item->getVar('disc_product_id'));
$productsSelect = $h_oledrion_products->productSelector(new oledrion_parameters(array('caption' => _AM_OLEDRION_DISCOUNT_PRODUCT, 'name' => 'disc_product_id', 'value' => $item->getVar('disc_product_id'), 'size' => 1, 'multiple' => false, 'values' => null, 'showAll' => true, 'sort' => 'product_title', 'order' => 'ASC', 'formName' => 'frmdiscount', 'description' => _AM_OLEDRION_DISCOUNT_HELP1, 'withNull' => _ALL)));
$xoopsTpl->assign('disc_product_id', $productsSelect->render());
$xoopsTpl->assign('discount', $discountForTemplate);
$xoopsTpl->assign('currencyName', oledrion_utils::getModuleOption('money_full'));
$editor = oledrion_utils::getWysiwygForm(_AM_OLEDRION_DISCOUNT_DESCR, 'disc_description', $item->getVar('disc_description', 'e'), 15, 60, 'description_hidden');
$xoopsTpl->assign('editor', $editor->render());
$xoopsTpl->display('db:oledrion_admin_discounts.html');
show_footer();
break;
// ****************************************************************************************************************
// ****************************************************************************************************************
case 'copy':
// Duplication d'une réduction
// ****************************************************************************************************************
xoops_cp_header();
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if (empty($id)) {
oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
}
示例14: isset
require_once XOOPS_ROOT_PATH . '/header.php';
require_once OLEDRION_PATH . 'class/registryfile.php';
// Initialisations
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
$limit = oledrion_utils::getModuleOption('newproducts');
// Nombre maximum d'éléments à afficher
$baseurl = OLEDRION_URL . basename(__FILE__);
// URL de ce script (sans son nom)
$registry = new oledrion_registryfile();
$lastTitle = '';
// Quelques options pour le template
$xoopsTpl->assign('nostock_msg', oledrion_utils::getModuleOption('nostock_msg'));
$xoopsTpl->assign('mod_pref', $mod_pref);
// Préférences du module
$xoopsTpl->assign('welcome_msg', nl2br($registry->getfile(OLEDRION_TEXTFILE1)));
$xoopsTpl->assign('columnsCount', oledrion_utils::getModuleOption('index_colums'));
// Lecture des TVA ********************************************************************************
$vatArray = $h_oledrion_vat->getAllVats(new oledrion_parameters());
// Récupération du nombre total de produits de la base
$xoopsTpl->assign('total_products_count', sprintf(_OLEDRION_THEREARE, $h_oledrion_products->getTotalPublishedProductsCount()));
if ($limit > 0) {
$itemsCount = $h_oledrion_products->getRecentProductsCount();
if ($itemsCount > $limit) {
require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($itemsCount, $limit, $start);
$xoopsTpl->assign('pagenav', $pagenav->renderNav());
}
$oledrion_shelf_parameters->resetDefaultValues()->setProductsType('recent')->setStart($start)->setLimit($limit)->setSort('product_id DESC, product_title')->setWithXoopsUser(true)->setWithRelatedProducts(true);
$products = $oledrion_shelf->getProducts($oledrion_shelf_parameters);
if (isset($products['lastTitle'])) {
$lastTitle = strip_tags($products['lastTitle']);
示例15: getAttributeOptions
/**
* Retourne une liste combinée des options de l'attribut
*
* @param string $format Format dans lequel renvoyer les données
* @param boolean $withFormatedPrices Faut il retourner les prix formatés ?
* @param object $product Le produit de travail
* @return array
* @since 2.3.2009.03.11
*/
function getAttributeOptions($format = 's', $withFormatedPrices = false, oledrion_products $product = null)
{
$ret = array();
$counter = 0;
if (!is_null($product)) {
$vat_id = $product->getVar('product_vat_id');
}
$names = $this->getOption('attribute_names', $format);
$values = $this->getOption('attribute_values', $format);
if (oledrion_utils::getModuleOption('use_price')) {
$prices = $this->getOption('attribute_prices', $format);
}
if (oledrion_utils::getModuleOption('attributes_stocks')) {
$stocks = $this->getOption('attribute_stocks', $format);
}
if ($withFormatedPrices) {
$oledrion_Currency = oledrion_Currency::getInstance();
}
if (count($names) > 0) {
foreach ($names as $key => $name) {
$price = $stock = 0;
if (oledrion_utils::getModuleOption('use_price')) {
$price = $prices[$key];
if ($withFormatedPrices) {
$priceFormated = $oledrion_Currency->amountForDisplay($price);
$priceTtc = oledrion_utils::getAmountWithVat($price, $vat_id);
$priceTtcFormated = $oledrion_Currency->amountForDisplay($priceTtc);
$vat = $priceTtc - $price;
$vatFormated = $oledrion_Currency->amountForDisplay($vat);
}
}
if (oledrion_utils::getModuleOption('attributes_stocks')) {
$stock = $stocks[$key];
}
if (!$withFormatedPrices) {
$ret[] = array('name' => $name, 'value' => $values[$key], 'price' => $price, 'stock' => $stock);
} else {
$ret[] = array('name' => $name, 'value' => $values[$key], 'price' => $price, 'priceFormated' => $priceFormated, 'priceTTC' => $priceTtc, 'priceTTCFormated' => $priceTtcFormated, 'vat' => $vat, 'vatFormated' => $vatFormated, 'counter' => $counter, 'stock' => $stock);
}
$counter++;
}
}
return $ret;
}