Exemplo n.º 1
0
 public function isInstalled()
 {
     if (utility::isB2B() === false) {
         return false;
     }
     return (bool) defined('MODULE_ORDER_TOTAL_TERMS_HANDLING_STATUS');
 }
Exemplo n.º 2
0
 function process()
 {
     global $lC_ShoppingCart, $lC_Currencies;
     // restrict to payment and confirmation pages
     if (strstr($_SERVER['REQUEST_URI'], 'shipping=process') || strstr($_SERVER['REQUEST_URI'], 'confirmation')) {
         if (utility::isB2B() === true) {
             $value = isset($_SESSION['this_handling']) && $_SESSION['this_handling'] > 0 ? $_SESSION['this_handling'] : 0;
             $this->output[] = array('title' => $this->_title . ':', 'text' => $lC_Currencies->getSessionSymbolLeft() . number_format($value, DECIMAL_PLACES) . $lC_Currencies->getSessionSymbolRight(), 'value' => $value);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Constructor; load the category structure relationship data from the database
  *
  * @access public
  */
 public function __construct()
 {
     global $lC_Database, $lC_Cache, $lC_Language, $lC_Customer;
     if (SERVICES_CATEGORY_PATH_CALCULATE_PRODUCT_COUNT == '1') {
         $this->_show_total_products = true;
     }
     if ($lC_Cache->isEnabled() && $lC_Cache->read('category_tree-' . $lC_Language->getCode(), 720)) {
         $this->_data = $lC_Cache->getCache();
     } else {
         $Qcategories = $lC_Database->query('select c.categories_id, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url, c.categories_status, c.categories_visibility_nav, c.categories_visibility_box, c.access_levels, cd.categories_name, cd.categories_menu_name from :table_categories c, :table_categories_description cd where c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = :language_id');
         $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
         $Qcategories->bindInt(':language_id', $lC_Language->getID());
         $Qcategories->appendQuery('order by c.parent_id, c.sort_order, cd.categories_name, cd.categories_menu_name');
         $Qcategories->execute();
         while ($Qcategories->next()) {
             // added to grab permalink if exists
             $Qpermalink = $lC_Database->query('select item_id, query, permalink from :table_permalinks where item_id = :item_id and language_id = :language_id and type = 1 limit 1');
             $Qpermalink->bindTable(':table_permalinks', TABLE_PERMALINKS);
             $Qpermalink->bindInt(':item_id', $Qcategories->valueInt('categories_id'));
             $Qpermalink->bindInt(':language_id', $lC_Language->getID());
             $Qpermalink->execute();
             $this->_data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('item_id' => $Qpermalink->valueInt('item_id'), 'name' => $Qcategories->value('categories_name'), 'menu_name' => $Qcategories->value('categories_menu_name'), 'query' => $Qpermalink->value('query'), 'permalink' => $Qpermalink->value('permalink'), 'image' => $Qcategories->value('categories_image'), 'count' => 0, 'mode' => $Qcategories->value('categories_mode'), 'link_target' => $Qcategories->valueInt('categories_link_target'), 'custom_url' => $Qcategories->value('categories_custom_url'), 'status' => $Qcategories->valueInt('categories_status'), 'nav' => $Qcategories->valueInt('categories_visibility_nav'), 'box' => $Qcategories->valueInt('categories_visibility_box'), 'access_levels' => $Qcategories->value('access_levels'));
         }
         if ($this->_show_total_products === true) {
             $this->_calculateProductTotals();
         }
         if (utility::isB2B() && !isset($_SESSION['admin'])) {
             $catArr = array();
             $gAccess = explode(';', $lC_Customer->getCustomerGroupAccess());
             foreach ($this->_data as $parent_id => $data) {
                 foreach ($data as $categories_id => $cData) {
                     $cAccess = explode(';', $cData['access_levels']);
                     foreach ($gAccess as $key => $gLevel) {
                         if (in_array($gLevel, $cAccess)) {
                             $catArr[$parent_id][$categories_id] = $cData;
                             break;
                         }
                     }
                 }
             }
             $this->_data = $catArr;
         }
         if ($lC_Cache->isEnabled()) {
             $lC_Cache->write($this->_data);
         }
     }
 }
Exemplo n.º 4
0
<?php

/**
  @package    catalog::admin::applications
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: main.php v1.0 2013-08-08 datazen $
*/
require_once $lC_Vqmod->modCheck('includes/applications/orders/classes/orders.php');
require_once $lC_Vqmod->modCheck('includes/applications/manufacturers/classes/manufacturers.php');
if (utility::isPro() == true || utility::isB2B() == true) {
    $note = '';
} else {
    $note = '<p class="message icon-speech orange-gradient">&nbsp;' . $lC_Language->get('text1') . '<span class="upsellinfo" upselltitle="' . $lC_Language->get('text_class_upsell_title') . '" upselldesc="' . $lC_Language->get('text_additional_images_upsell_desc') . '"></span>' . lc_go_pro() . '&nbsp;&nbsp;' . $lC_Language->get('text2') . '<span class="upsellinfo" upselltitle="' . $lC_Language->get('text_class_upsell_title') . '" upselldesc="' . $lC_Language->get('text_class_upsell_desc') . '"></span>' . lc_go_pro() . $lC_Language->get('text3') . '</p>';
}
$breakout = '<span class="breakout-wrapper">
               <span class="anthracite with-small-padding no-wrap" name="breakout_by" id="breakout_by">' . $lC_Language->get("text_breakout_by") . '</span>
               <label class="no-wrap">
                 <input type="radio" class="radio" id="breakout" name="breakout" value = "class">
                 <span class="anthracite with-small-padding space">' . $lC_Language->get("text_class") . '</span>
                 ' . lc_go_pro() . '
               </label>
               <label class="no-wrap">
                 <input type="radio" class="radio" id="breakout" name="breakout" value="supplier">
                 <span class="anthracite with-small-padding">' . $lC_Language->get("text_supplier") . '</span>
                 <span class="upsellinfo" upselltitle="' . $lC_Language->get('text_class_upsell_title') . '" upselldesc="' . $lC_Language->get('text_class_upsell_desc') . '"></span>
                 ' . lc_go_pro() . '
               </label>
Exemplo n.º 5
0
 public function format($number, $currency_code = '', $currency_value = '')
 {
     global $lC_Language;
     if (empty($currency_code) || $this->exists($currency_code) == false) {
         $currency_code = isset($_SESSION['currency']) ? $_SESSION['currency'] : DEFAULT_CURRENCY;
     }
     if (empty($currency_value) || is_numeric($currency_value) == false) {
         $currency_value = $this->currencies[$currency_code]['value'];
     }
     $number_value = number_format(lc_round($number * $currency_value, $this->currencies[$currency_code]['decimal_places']), $this->currencies[$currency_code]['decimal_places'], $lC_Language->getNumericDecimalSeparator(), $lC_Language->getNumericThousandsSeparator());
     // rounding rule
     if ((utility::isPro() === true || utility::isB2B() === true) && defined('PRO_SETTINGS_ROUNDING_RULES') && PRO_SETTINGS_ROUNDING_RULES != '') {
         // determine the current price parts
         $currentPriceValue = lc_round($number * $currency_value, $this->currencies[$currency_code]['decimal_places']);
         $priceParts = explode('.', $currentPriceValue);
         $dollarPrice = $priceParts[0];
         $centsPrice = $priceParts[1];
         // get the rounding rules
         $rules = unserialize(PRO_SETTINGS_ROUNDING_RULES);
         if (is_array($rules[$this->getCode()])) {
             if ($rules[$this->getCode()]['status'] == 'on' || $rules[$this->getCode()]['status'] == '1') {
                 $roundto = $rules[$this->getCode()]['roundto'];
                 $level = $rules[$this->getCode()]['level'];
                 switch ($level) {
                     case '0':
                         // ###.#0
                         $number_value = number_format((double) (substr((string) $number_value, 0, -($level + 1)) . str_replace(array('.', '#'), '', $roundto)), DECIMAL_PLACES);
                         break;
                     case '1':
                         // ###.00
                         $number_value = number_format((double) (substr((string) $number_value, 0, -($level + 1)) . str_replace(array('.', '#'), '', $roundto)), DECIMAL_PLACES);
                         break;
                     case '2':
                         // ##0.00
                         if (strstr($roundto, '.')) {
                             $parts = explode('.', $roundto);
                             $rDollar = (string) $parts[0];
                             $rCents = (string) $parts[1];
                             $number_value = (double) (substr($dollarPrice, 0, -1) . $rDollar . '.' . $rCents);
                         }
                         break;
                     case '3':
                         // #00.00
                         if (strstr($roundto, '.')) {
                             $parts = explode('.', $roundto);
                             $rDollar = (string) $parts[0];
                             $rCents = (string) $parts[1];
                             $number_value = (double) (substr($dollarPrice, 0, -2) . $rDollar . '.' . $rCents);
                         }
                         break;
                     case '4':
                         // 000.00
                         if (strstr($roundto, '.')) {
                             $parts = explode('.', $roundto);
                             $rDollar = (string) $parts[0];
                             $rCents = (string) $parts[1];
                             $number_value = (double) (substr($dollarPrice, 0, -3) . $rDollar . '.' . $rCents);
                         }
                         break;
                 }
             }
         }
     }
     return $this->currencies[$currency_code]['symbol_left'] . $number_value . $this->currencies[$currency_code]['symbol_right'];
 }
Exemplo n.º 6
0
echo $lC_Currencies->getSymbolLeft();
?>
</span>
        <input type="text" onfocus="this.select();" onchange="updatePricingDiscountDisplay();" class="input-unstyled" name="products_base_price" id="products_base_price" value="<?php 
echo isset($pInfo) ? number_format(lc_round($pInfo->get('products_price'), DECIMAL_PLACES), DECIMAL_PLACES) : null;
?>
" class="input strong" onblur="$('#products_price0').val(this.value);" />
      </div>    
      <?php 
echo lc_show_info_bubble($lC_Language->get('info_bubble_pricing_base_price'), null, 'info-spot on-left grey margin-left');
?>
    </div>

    <div class="upsellwrapper field-block field-block-product button-height">
      <?php 
if (utility::isPro() === false || utility::isB2B() === false) {
    ?>
        <label upselltitle="<?php 
    echo $lC_Language->get('text_group_pricing');
    ?>
" upselldesc="<?php 
    echo $lC_Language->get('text_group_pricing_desc');
    ?>
" for="" class="label upsellinfo"><b><?php 
    echo $lC_Language->get('text_group_pricing');
    ?>
</b></label>
      <?php 
}
?>
      <label for="groups_pricing_switch" class="label"><b><?php 
Exemplo n.º 7
0
 public static function getProVersionTag()
 {
     global $lC_Language;
     if (utility::isB2B()) {
         return '<small class="tag orange-gradient mid-margin-left mid-margin-right">B2B</small>' . $lC_Language->get('text_version') . ' ' . utility::getB2BVersion();
     } else {
         if (utility::isPro()) {
             return '<small class="tag red-gradient mid-margin-left mid-margin-right">PRO</small>' . $lC_Language->get('text_version') . ' ' . utility::getProVersion();
         }
     }
 }
Exemplo n.º 8
0
asort($define_list);
$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
    if ($value > 0) {
        $column_list[] = $key;
    }
}
if ($Qlisting->numberOfRows() > 0) {
    $output = '';
    $show_price = true;
    $show_buy_now = true;
    while ($Qlisting->next()) {
        // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW
        $lC_Product = new lC_Product($Qlisting->valueInt('products_id'));
        if (utility::isB2B() && $lC_Customer->isLoggedOn() === false) {
            $access = defined('B2B_SETTINGS_GUEST_CATALOG_ACCESS') && B2B_SETTINGS_GUEST_CATALOG_ACCESS > 0 ? (int) B2B_SETTINGS_GUEST_CATALOG_ACCESS : 0;
            if ($access < 66) {
                $show_price = false;
            }
            if ($access < 99) {
                $show_buy_now = false;
            }
        }
        if (strtotime($lC_Product->getDateAvailable()) <= strtotime(lC_Datetime::getShort())) {
            $output .= '<div class="product-listing-module-items">';
            for ($col = 0, $n = sizeof($column_list); $col < $n; $col++) {
                switch ($column_list[$col]) {
                    case 'PRODUCT_LIST_MODEL':
                        $output .= '<div class="product-listing-module-model">' . $lC_Product->getModel() . '</div>' . "\n";
                        break;
Exemplo n.º 9
0
 public static function getSimpleOptionsPricingTbody($options, $customers_group_id)
 {
     global $lC_Currencies, $pInfo;
     if ($customers_group_id == '') {
         return false;
     }
     $gData = lC_Customer_groups_Admin::getData($customers_group_id);
     $baselineDiscount = (double) $gData['baseline_discount'];
     $basePrice = isset($pInfo) ? (double) $pInfo->get('products_price') : 0.0;
     $tbody = '';
     if (isset($options) && !empty($options)) {
         foreach ($options as $key => $so) {
             if (isset($so['title']) && $so['title'] != NULL) {
                 $items = '';
                 if (is_array($so['values'])) {
                     foreach ($so['values'] as $k => $v) {
                         if ($v['options_id'] == $so['options_id'] && $v['products_id'] == $pInfo->get('products_id') && $customers_group_id == $v['customers_group_id']) {
                             //                if ($customers_group_id == DEFAULT_CUSTOMERS_GROUP_ID || (utility::isPro() === true && utility::isB2B() === true)) {
                             $mod = isset($v['price_modifier']) && !empty($v['price_modifier']) ? number_format($v['price_modifier'], DECIMAL_PLACES) : '0.00';
                             //                } else {
                             //                  $mod = number_format(round(($basePrice * $baselineDiscount) * .01, DECIMAL_PLACES), DECIMAL_PLACES);
                             //                }
                             $items .= '<tr class="trp-' . $v['options_id'] . '">' . '  <td class="element">' . $v['title'] . '</td>' . '  <td>' . '    <div id="div_' . $v['customers_group_id'] . '_' . $v['options_id'] . '_' . $v['values_id'] . '" class="icon-plus-round icon-green icon-size2" style="display:inline;">' . '      <div class="inputs' . ($customers_group_id != DEFAULT_CUSTOMERS_GROUP_ID && utility::isB2B() === false ? ' disabled' : '') . '" style="display:inline; padding:8px 0;">' . '        <span class="mid-margin-left no-margin-right">' . $lC_Currencies->getSymbolLeft() . '</span>' . '        <input type="text" class="input-unstyled" onfocus="$(this).select()" value="' . $mod . '" onblur="showSimpleOptionsPricingSymbol(this, \'' . $v['customers_group_id'] . '_' . $v['options_id'] . '_' . $v['values_id'] . '\');" id="simple_options_entry_price_modifier_' . $v['customers_group_id'] . '_' . $v['options_id'] . '_' . $v['values_id'] . '" name="simple_options_entry_price_modifier[' . $v['customers_group_id'] . '][' . $v['options_id'] . '][' . $v['values_id'] . ']" ' . ($customers_group_id != DEFAULT_CUSTOMERS_GROUP_ID && utility::isB2B() === false ? ' DISABLED' : '') . '>' . '      </div>' . '    </div>' . '  </td>' . '</tr>';
                         }
                     }
                 }
                 $tbody .= '<tr id="trp-' . $customers_group_id . '-' . $so['options_id'] . '" class="trp-' . $so['options_id'] . '"><td width="100px" class="strong">' . $so['title'] . '</td></tr>' . $items;
             }
         }
     }
     return $tbody;
 }
Exemplo n.º 10
0
 public function getPriceInfo($product_id, $customers_group_id = 1, $data)
 {
     global $lC_Specials, $lC_Database, $lC_Language, $lC_Customer, $lC_Services, $lC_Currencies, $lC_ShoppingCart, $lC_Tax;
     $quantity = isset($data['quantity']) && $data['quantity'] != null ? (int) $data['quantity'] : 1;
     // #### SET BASE PRICE #### //
     $base_price = $this->getBasePrice($product_id);
     // check for variant
     if (isset($data['variants']) && is_array($data['variants'])) {
         $vpID = (int) self::getProductVariantID($data['variants']);
         if (isset($vpID) && is_numeric($vpID)) {
             $base_price = self::getProductPrice($vpID);
         }
     }
     // added for localization
     if (isset($_SESSION['localization']['base_price_modifier']) && $_SESSION['localization']['base_price_modifier'] > 0) {
         $modified_amt = round($base_price * (double) $_SESSION['localization']['base_price_modifier'] / 100, DECIMAL_PLACES);
         $base_price = $base_price + $modified_amt;
     }
     $price = (double) $base_price;
     // options modifiers
     if (is_array($data['simple_options']) && count($data['simple_options']) > 0) {
         $modTotal = 0;
         foreach ($data['simple_options'] as $options_id => $values_id) {
             $QsimpleOptions = $lC_Database->query("select * from :table_products_simple_options_values where customers_group_id = :customers_group_id and options_id = :options_id and values_id = :values_id and products_id = :products_id limit 1");
             $QsimpleOptions->bindTable(':table_products_simple_options_values', TABLE_PRODUCTS_SIMPLE_OPTIONS_VALUES);
             $QsimpleOptions->bindInt(':customers_group_id', $customers_group_id);
             $QsimpleOptions->bindInt(':products_id', $product_id);
             $QsimpleOptions->bindInt(':options_id', $options_id);
             $QsimpleOptions->bindInt(':values_id', $values_id);
             $QsimpleOptions->setDebug(true);
             $QsimpleOptions->execute();
             $modTotal = (double) $modTotal + $QsimpleOptions->valueDecimal('price_modifier');
             $QsimpleOptions->freeResult();
         }
     }
     // if has special price, base price becomes special price
     $special_price = 0.0;
     if ($lC_Services->isStarted('specials') && $lC_Specials->isActive($product_id)) {
         $special_price = $lC_Specials->getPrice($product_id);
         $price = (double) $special_price < (double) $price ? (double) $special_price : (double) $price;
     }
     // if has qty price breaks, adjust base price to break price
     $qpbText = '';
     if ($this->hasQtyPriceBreaks($product_id, $customers_group_id)) {
         $qpbArr = $this->getQtyPriceBreaks($product_id, $customers_group_id);
         usort($qpbArr, "self::_usortBreakPoint");
         $maxBreak = end($qpbArr);
         $cnt = 0;
         foreach ($qpbArr as $key => $value) {
             if ((int) $value['qty_break'] <= (int) $quantity) {
                 if ($lC_Services->isStarted('specials') && $lC_Specials->isActive($product_id)) {
                     $price = $special_price < (double) $value['price_break'] ? $special_price : (double) $value['price_break'];
                 } else {
                     $price = (double) $value['price_break'];
                 }
                 $cnt = $key;
             }
         }
         if (defined('PRODUCT_PRICING_QPB_FORMAT') && PRODUCT_PRICING_QPB_FORMAT != NULL) {
             switch (PRODUCT_PRICING_QPB_FORMAT) {
                 case 'None':
                     $listing = $lC_Currencies->displayPrice($price, DECIMAL_PLACES);
                     break;
                 case 'Starts At':
                     $listing = '<div class="margin-top-neg"><span class="lt-blue">' . $lC_Language->get('pricing_starts_at') . '</span><p class="lead small-margin-bottom small-margin-top-neg">' . $lC_Currencies->displayPrice($this->getBasePrice(), $this->getTaxClassID()) . '</p></div>';
                     break;
                 case 'Low As':
                     $listing = '<div class="margin-top-neg"><span class="lt-blue">' . $lC_Language->get('pricing_low_as') . '</span><p class="lead small-margin-bottom small-margin-top-neg">' . $lC_Currencies->displayPrice($maxBreak['price_break'] < $price ? $maxBreak['price_break'] : $price, $this->getTaxClassID()) . '</p></div>';
                     break;
                 default:
                     $listing = $lC_Currencies->displayPrice($maxBreak['price_break'] < $price ? $maxBreak['price_break'] : $price, $this->getTaxClassID()) . ' - ' . $lC_Currencies->displayPrice($price, $this->getTaxClassID());
             }
         }
         // if has special and qpb determine the next break point based off special price and adjust $cnt
         if ($special_price != 0.0) {
             $cnt = 0;
             usort($qpbArr, "self::_usortBreakPoint");
             foreach ($qpbArr as $key => $value) {
                 if ((int) $value['price_break'] < $special_price) {
                     $cnt = $key;
                     break;
                 }
             }
         } else {
             if ($quantity > 1 && $quantity >= $qpbArr[$cnt]['qty_break']) {
                 $cnt++;
             }
         }
         $youSave = (int) $quantity == 1 ? round((1 - (double) $qpbArr[$cnt]['price_break'] / (double) $this->getBasePrice()) * 100, DECIMAL_PLACES) : ((int) $quantity >= (int) $maxBreak['qty_break'] ? round((1 - (double) $maxBreak['price_break'] / (double) $this->getBasePrice()) * 100, DECIMAL_PLACES) : round((1 - (double) $qpbArr[$cnt]['price_break'] / (double) $this->getBasePrice()) * 100, DECIMAL_PLACES));
         $qpbData = array('nextBreak' => (int) $quantity == 1 ? (int) $qpbArr[$cnt]['qty_break'] : ($quantity >= (int) $maxBreak['qty_break'] ? $maxBreak['qty_break'] : $qpbArr[$cnt]['qty_break']), 'nextPrice' => (int) $quantity == 1 ? number_format($qpbArr[$cnt]['price_break'] + $modTotal, DECIMAL_PLACES) : ((int) $quantity >= $maxBreak['qty_break'] ? number_format($maxBreak['price_break'] + $modTotal, DECIMAL_PLACES) : number_format($qpbArr[$cnt]['price_break'] + $modTotal, DECIMAL_PLACES)), 'youSave' => number_format($youSave, 0) . '%', 'listing' => $listing);
     }
     $price = $price + $modTotal;
     // overrides
     if (utility::isB2B() && $_GET['action'] != 'cart_add') {
         if (defined('B2B_SETTINGS_SHOW_GUEST_ONLY_MSRP') && B2B_SETTINGS_SHOW_GUEST_ONLY_MSRP == '1' && $lC_Customer->isLoggedOn() === false) {
             $price = $this->getMSRP();
         }
         if (defined('B2B_SETTINGS_SHOW_RETAIL_ONLY_MSRP') && B2B_SETTINGS_SHOW_RETAIL_ONLY_MSRP == '1' && $lC_Customer->isLoggedOn() === true && $lC_Customer->getCustomerGroup() == DEFAULT_CUSTOMERS_GROUP_ID) {
             $price = $this->getMSRP();
         }
     }
     $tax = 0;
     $taxRate = 0;
     $priceWithTax = $price;
     if (DISPLAY_PRICE_WITH_TAX == 1 || $_SESSION['localization']['show_tax'] == 1) {
         $taxClassID = $lC_ShoppingCart->getShippingMethod('tax_class_id') != NULL ? $lC_ShoppingCart->getShippingMethod('tax_class_id') : $this->_data['tax_class_id'];
         $countryID = $lC_ShoppingCart->getShippingAddress('country_id') != NULL ? $lC_ShoppingCart->getShippingAddress('country_id') : STORE_COUNTRY;
         $zoneID = $lC_ShoppingCart->getShippingAddress('zone_id') != NULL ? $lC_ShoppingCart->getShippingAddress('zone_id') : STORE_ZONE;
         $taxRate = $lC_Tax->getTaxRate($taxClassID, $countryID, $zoneID);
         $tax = $lC_Tax->calculate($price, $taxRate);
         $priceWithTax = lc_round($price + $tax, DECIMAL_PLACES);
     }
     if ($lC_Services->isStarted('specials') && $lC_Specials->isActive($product_id)) {
         $formatted = '<s>' . $lC_Currencies->displayPrice($this->getBasePrice() + $modTotal, $this->_data['tax_class_id']) . '</s> <span class="product-special-price">' . $lC_Currencies->displayPrice($price, $this->_data['tax_class_id']) . '</span>';
     } else {
         $formatted = $lC_Currencies->displayPrice($price, $this->getTaxClassID());
     }
     // #### DISCOUNTS #### //
     /*
     // set the adjusted base price var
     $base_price = $price;    
     // if logged in and has a group baseline discount, apply to price
     if ($lC_Customer->isLoggedOn()) {
       $baseline_discount = $lC_Customer->getBaselineDiscount($customers_group_id);
       $price = round((float)$base_price * ((float)$baseline_discount * .01), DECIMAL_PLACES); 
     }
     */
     $return = array('qoh' => $this->getQuantity(), 'base' => number_format($this->getBasePrice(), DECIMAL_PLACES), 'price' => number_format($price, DECIMAL_PLACES), 'tax' => number_format($tax, DECIMAL_PLACES), 'formatted' => $formatted, 'modTotal' => $modTotal, 'qpbData' => $qpbData);
     //echo "<pre>return ";
     //print_r($return);
     //echo "</pre>";
     //die('55');
     return $return;
 }
Exemplo n.º 11
0
 function &execute($max_entries = MAX_DISPLAY_SEARCH_RESULTS)
 {
     global $lC_Database, $lC_Language, $lC_CategoryTree, $lC_Image, $lC_Customer;
     $sqlQuery = 'select SQL_CALC_FOUND_ROWS distinct p.products_id from :table_products p left join :table_product_attributes pa on (p.products_id = pa.products_id) left join :table_templates_boxes tb on (pa.id = tb.id and tb.code = "manufacturers"), :table_products_description pd';
     if ($this->hasCategory()) {
         $sqlQuery .= ' , :table_categories c, :table_products_to_categories p2c';
     }
     $sqlQuery .= ' where p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id';
     if ($this->hasCategory()) {
         $sqlQuery .= ' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id';
     }
     $Qlisting = $lC_Database->query($sqlQuery);
     $Qlisting->bindTable(':table_products', TABLE_PRODUCTS);
     $Qlisting->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
     $Qlisting->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
     $Qlisting->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     if ($this->hasCategory()) {
         $Qlisting->bindTable(':table_categories', TABLE_CATEGORIES);
     }
     if ($this->hasCategory()) {
         $Qlisting->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
     }
     $Qlisting->bindInt(':default_flag', 1);
     $Qlisting->bindInt(':language_id', $lC_Language->getID());
     if ($this->hasCategory()) {
         if ($this->isRecursive()) {
             $subcategories_array = array($this->_category);
             $Qlisting->appendQuery('and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and p2c.categories_id in (:categories_id)');
             $Qlisting->bindRaw(':categories_id', implode(',', $lC_CategoryTree->getChildren($this->_category, $subcategories_array)));
         } else {
             $Qlisting->appendQuery('and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = :language_id and p2c.categories_id = :categories_id');
             $Qlisting->bindInt(':language_id', $lC_Language->getID());
             $Qlisting->bindInt(':categories_id', $this->_category);
         }
     }
     if ($this->hasManufacturer()) {
         $Qlisting->appendQuery('and pa.id = tb.id and pa.value = :manufacturers_id');
         $Qlisting->bindInt(':manufacturers_id', $this->_manufacturer);
     }
     if (utility::isB2B()) {
         $chkSQL = $Qlisting->getQuery();
         $Qchk = $lC_Database->query($chkSQL);
         $Qchk->execute();
         $rows_before = $Qchk->numberOfRows();
         $Qchk->freeResult();
         $Qlisting->appendQuery($lC_Customer->getCustomerGroupAccessSql());
         $rows_after = $Qlisting->numberOfRows();
         $_SESSION['has_hidden_products'] = $rows_before != $rows_after ? true : false;
     }
     $Qlisting->appendQuery('order by');
     if (isset($this->_sort_by)) {
         $Qlisting->appendQuery(':order_by :order_by_direction');
         $Qlisting->bindRaw(':order_by', $this->_sort_by);
         $Qlisting->bindRaw(':order_by_direction', $this->_sort_by_direction == '-' ? 'desc' : '');
     } else {
         $Qlisting->appendQuery('pd.products_name :order_by_direction');
         $Qlisting->bindRaw(':order_by_direction', $this->_sort_by_direction == '-' ? 'desc' : '');
     }
     $Qlisting->setBatchLimit(isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1, $max_entries);
     $Qlisting->execute();
     return $Qlisting;
 }
Exemplo n.º 12
0
}

function toggleSecurityInfo() {
  var open = $('.security-info-text-container').is(':visible');
  if (!open) {
    $('.security-info-text-container').slideDown();
    $('#arrow').removeClass('arrow-down').addClass('arrow-up');
  } else {
    $('.security-info-text-container').slideUp();
    $('#arrow').removeClass('arrow-up').addClass('arrow-down');
  }  
}

$("input:radio[name=payment_method]").click(function() {
  var isB2B = '<?php 
echo utility::isB2B() === true ? 1 : 0;
?>
';  
  if (isB2B == 1) { 
    processTermsSelect();
  }  
});

function processTermsSelect() {
  var selectedPayMethod = $("input:radio[name=payment_method]:checked").val();
  var selectedPayTermID = $('#payment_terms :selected').val();
  
  // adjust payment terms selection array  
  updatePaymentTermsSelectHtml(selectedPayMethod, selectedPayTermID);  
}
Exemplo n.º 13
0
  @package    catalog::admin::templates
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: header.php v1.0 2013-08-08 datazen $
*/
?>
<!-- Title bar -->
<header role="banner" id="title-bar">
  <div class="relative">
    <a id="logoRef" style="" href="<?php 
echo lc_href_link_admin(FILENAME_DEFAULT);
?>
"><img id="logoImg" src="./templates/default/img/logo.png" border="0"></a>
    <?php 
if (utility::isB2B() === true) {
    echo '<span style="vertical-align:50%;"><span class="tag orange-gradient glossy" style="padding-top:2px; font-size:1.0em;">B2B</span></span>';
} else {
    if (utility::isPro() === true) {
        echo '<span style="vertical-align:50%;"><span class="tag red-gradient glossy" style="padding-top:2px; font-size:1.0em;">PRO</span></span>';
    }
}
?>
  </div>
</header>
<?php 
if ($lC_MessageStack->size('header') > 0) {
    echo $lC_MessageStack->get('header');
}