/**
  * Method to get content article data for the frontpage
  *
  * @since 1.5
  */
 function getList()
 {
     $where = array();
     $mainframe = JFactory::getApplication();
     if (!empty($this->_list)) {
         return $this->_list;
     }
     // Initialize variables
     $db = $this->getDBO();
     $filter = null;
     // Get some variables from the request
     //		$sectionid			= JRequest::getVar( 'sectionid', -1, '', 'int' );
     //		$redirect			= $sectionid;
     //		$option				= JRequest::get( 'option' );
     $filter_order = $mainframe->getUserStateFromRequest('userelement.filter_order', 'filter_order', '', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest('userelement.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest('userelement.limitstart', 'limitstart', 0, 'int');
     $search = $mainframe->getUserStateFromRequest('userelement.search', 'search', '', 'string');
     $search = JString::strtolower($search);
     if (!$filter_order) {
         $filter_order = 'tbl.product_id';
     }
     $order = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
     $all = 1;
     // Keyword filter
     if ($search) {
         $where[] = 'LOWER( tbl.product_id ) LIKE ' . $db->q('%' . $db->escape($search, true) . '%', false);
         $where[] = 'LOWER( tbl.product_name ) LIKE ' . $db->q('%' . $db->escape($search, true) . '%', false);
     }
     // Build the where clause of the query
     $where = count($where) ? ' WHERE ' . implode(' OR ', $where) : '';
     // Get the total number of records
     $query = 'SELECT COUNT(tbl.product_id)' . ' FROM #__citruscart_products AS tbl' . $where;
     $db->setQuery($query);
     $total = $db->loadResult();
     // Create the pagination object
     jimport('joomla.html.pagination');
     $this->_page = new JPagination($total, $limitstart, $limit);
     // Get the products
     $query = 'SELECT tbl.*, pp.* ' . ' FROM #__citruscart_products AS tbl' . ' LEFT JOIN #__citruscart_productprices pp ON pp.product_id = tbl.product_id ' . $where . $order;
     $db->setQuery($query, $this->_page->limitstart, $this->_page->limit);
     $this->_list = $db->loadObjectList();
     //currency formatting
     Citruscart::load('CitruscartHelperBase', 'helpers._base');
     foreach ($this->_list as $item) {
         $item->product_price = CitruscartHelperBase::currency($item->product_price);
     }
     // If there is a db query error, throw a HTTP 500 and exit
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
         return false;
     }
     return $this->_list;
 }
예제 #2
0
</label></td>
</tr>
<tr>
    <th><a href="<?php 
echo $stats->link;
?>
"><?php 
echo JText::_('COM_CITRUSCART_LIFETIME_SALES');
?>
</a></th>
    <td style="text-align: right;"><?php 
echo CitruscartHelperBase::number($stats->lifetime->num, $options_int);
?>
</td>
	<td style="text-align: right;"><?php 
echo CitruscartHelperBase::number($stats->lifetime->average_daily, $options_decimal);
?>
</td>
	<td style="text-align: right;"><label class="label label-warning"><?php 
echo CitruscartHelperBase::currency($stats->lifetime->average, '', $options_decimal);
?>
</label></td>
    <td style="text-align: right;"><label class="label label-success"><?php 
echo CitruscartHelperBase::currency($stats->lifetime->amount, '', $options_decimal);
?>
</label></td>
</tr>

</tbody>
</table>
예제 #3
0
?>

    <?php 
if ($this->defines->get('display_credits', '0') && (double) $this->userinfo->credits_total > (double) '0.00') {
    ?>

        <fieldset id="opc-credit-form">
            <div id="opc-credit-validation"></div>

            <div id="credits_form">
                <label for="apply_credit_amount"><?php 
    echo JText::_('COM_CITRUSCART_STORE_CREDIT');
    ?>
</label>
                <div class="help-block"><?php 
    echo sprintf(JText::_('COM_CITRUSCART_YOU_HAVE_STORE_CREDIT'), CitruscartHelperBase::currency($this->userinfo->credits_total, $this->defines->get('default_currencyid', '1')));
    ?>
</div>
                <div class="input-append" id="opc-credit-input">
                    <input class="span2" type="text" id="apply_credit_amount" name="apply_credit_amount" />
                    <button id="opc-credit-button" class="btn" type="button"><?php 
    echo JText::_("COM_CITRUSCART_APPLY_CREDIT_TO_ORDER");
    ?>
</button>
                </div>

            </div>
            <div id='opc-credits'></div>
        </fieldset>

    <?php 
        <div class='onDisplayProductAttributeOptions_wrapper'>
        <?php 
    echo $this->onDisplayProductAttributeOptions;
    ?>
        </div>
    <?php 
}
?>

    <?php 
echo JText::_('COM_CITRUSCART_QUANTITY');
?>
    <input type="text" name="quantity" value="1" size="10" />
    <br/>
    <?php 
echo JText::_('COM_CITRUSCART_BASE_PRICE');
?>
: <?php 
echo CitruscartHelperBase::currency($row->price);
?>
    <br/>

    <input type="submit" name="add_to_cart" value="<?php 
echo JText::_('COM_CITRUSCART_ADD_TO_ORDER');
?>
" class="btn btn-success" />
    <input type="hidden" name="task" id="task" value="addtocart" />
    <input type="hidden" name="product_id" value="<?php 
echo $row->product_id;
?>
" />
예제 #5
0
<?php

/*------------------------------------------------------------------------
# com_citruscart - citruscart
# ------------------------------------------------------------------------
# author    Citruscart Team - Citruscart http://www.citruscart.com
# copyright Copyright (C) 2014 - 2019 Citruscart.com All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://citruscart.com
# Technical Support:  Forum - http://citruscart.com/forum/index.html
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
/*Layout for displaying refreshed total amount.*/
JHTML::_('stylesheet', 'menu.css', 'media/citruscart/css/');
JHtml::_('script', 'media/citruscart/js/citruscart.js', false, false);
JHTML::_('script', 'joomla.javascript.js', 'includes/js/');
Citruscart::load('CitruscartGrid', 'library.grid');
$state = $this->state;
$order = $this->order;
$items = $this->orderitems;
echo CitruscartHelperBase::currency($items);
예제 #6
0
        echo $rate['tax'];
        ?>
,<?php 
        echo $rate['extra'];
        ?>
, '<?php 
        echo $rate['code'];
        ?>
');" <?php 
        echo $checked;
        ?>
 /> <?php 
        echo $rate['name'];
        ?>
 ( <?php 
        echo CitruscartHelperBase::currency($rate['total']);
        ?>
 )<br />
            <br/>
            <?php 
    }
} else {
    ?>
        <div class="note">
        <?php 
    echo JText::_('COM_CITRUSCART_NO_SHIPPING_NOTE');
    ?>
        </div>
        <?php 
}
$setval = false;
예제 #7
0
	        <div id='applied_credit' style="display: none;"></div>
	        <div class="reset"></div>
        <?php 
}
?>

	   <div id="payment_info" class="address">
		<h3><?php 
echo JText::_('COM_CITRUSCART_BILLING_INFORMATION');
?>
</h3>
		<strong><?php 
echo JText::_('COM_CITRUSCART_TOTAL_AMOUNT_DUE');
?>
</strong>:<span id='totalAmountDue'><?php 
echo CitruscartHelperBase::currency($this->order->order_total);
?>
</span><br/>
		<?php 
if (!empty($this->showBilling)) {
    ?>
        <strong><?php 
    echo JText::_('COM_CITRUSCART_BILLING_ADDRESS');
    ?>
</strong>:<br/>
                    <?php 
    echo $billing_info['first_name'] . " " . $billing_info['last_name'] . "<br/>";
    echo $billing_info['address_1'] . ", ";
    echo $billing_info['address_2'] ? $billing_info['address_2'] . ", " : "";
    echo $billing_info['city'] . ", ";
    echo $billing_info['zone_name'] . " ";
예제 #8
0
 function getFilters()
 {
     $filters = array();
     if (!empty($this->_filter_category) && !empty($this->category_current)) {
         $catObj = new stdClass();
         $catObj->label = JText::_('COM_CITRUSCART_CATEGORY');
         $catObj->value = $this->category_current->category_name;
         $catObj->link = $this->_link . '&filter_category=';
         $filters[] = $catObj;
     }
     if (!empty($this->_filter_price_from) || !empty($this->_filter_price_to)) {
         $priceObj = new stdClass();
         $priceObj->label = JText::_('COM_CITRUSCART_PRICE');
         $priceObj->value = CitruscartHelperBase::currency($this->_filter_price_from) . ' - ' . CitruscartHelperBase::currency($this->_filter_price_to);
         $priceObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_price_from=0&filter_price_to=';
         $filters[] = $priceObj;
     }
     if (!empty($this->_filter_attribute_set)) {
         $options = explode(',', $this->_filter_option_set);
         $session = JFactory::getSession();
         $saveOptions = $session->get('options', array(), 'Citruscart_layered_nav');
         $trackOpts = array();
         $link = '';
         $newOPT = array();
         $listPAO = array();
         $listPA = array();
         if (isset($saveOptions[$this->_filter_category])) {
             foreach ($saveOptions[$this->_filter_category] as $saveOption) {
                 if (in_array($saveOption->productattributeoption_id, $options)) {
                     $listPAO[] = $saveOption->productattributeoption_id;
                     $listPA[] = $saveOption->productattribute_id;
                     $newOPT[$saveOption->productattributeoption_name]->istopa[] = $saveOption->productattribute_id;
                     $newOPT[$saveOption->productattributeoption_name]->istopao[] = $saveOption->productattributeoption_id;
                 }
             }
         }
         foreach ($options as $option) {
             if (empty($this->_options[$option])) {
                 continue;
             }
             $combination = $this->_options[$option]->attributename . '::' . $this->_options[$option]->productattributeoption_name;
             if (!in_array($combination, $trackOpts)) {
                 $trackOpts[] = $combination;
                 $attriObj = new stdClass();
                 $attriObj->label = $this->_options[$option]->attributename;
                 $attriObj->value = $this->_options[$option]->productattributeoption_name;
                 //create option set
                 $option_set = array_diff($listPAO, $newOPT[$attriObj->value]->istopao);
                 //create attribute set
                 $attribute_set = array_diff($listPA, $newOPT[$attriObj->value]->istopa);
                 $attriObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_attribute_set=' . implode(',', $attribute_set) . '&filter_option_set=' . implode(',', $option_set);
                 $filters[] = $attriObj;
             }
         }
     }
     if ($this->_filter_rating && $this->_params->get('filter_rating')) {
         $ratingObj = new stdClass();
         $ratingObj->label = JText::_('COM_CITRUSCART_RATING');
         $ratingObj->value = CitruscartHelperProduct::getRatingImage((double) $this->_filter_rating) . ' ' . JText::_('COM_CITRUSCART_AND_UP');
         $ratingObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_rating=0';
         $filters[] = $ratingObj;
     }
     if ($this->_multi_mode) {
         if (!empty($this->_filter_manufacturer_set)) {
             $brandSet = explode(',', $this->_filter_manufacturer_set);
             foreach ($brandSet as $brand) {
                 $brandObj = new stdClass();
                 $brandObj->label = JText::_('COM_CITRUSCART_MANUFACTURER');
                 $brandObj->value = $this->brands[$brand];
                 $brandObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_manufacturer_set=' . implode(',', array_diff($brandSet, array($brand)));
                 $filters[] = $brandObj;
             }
         }
     } else {
         if (!empty($this->_filter_manufacturer)) {
             $brandObj = new stdClass();
             $brandObj->label = JText::_('COM_CITRUSCART_MANUFACTURER');
             $brandObj->value = $this->brands[$this->_filter_manufacturer];
             $brandObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_manufacturer=';
             $filters[] = $brandObj;
         }
     }
     return $filters;
 }
예제 #9
0
        <div class="reset"></div>
        <?php 
if ($display_credits && isset($this->userinfo)) {
    ?>
        <?php 
    if ($this->userinfo->credits_total > '0.00') {
        ?>
            	<!-- STORE CREDITS -->
		<div id="credits_area" class="address">
			<div id="credits_form">
		        <h3><?php 
        echo JText::_('COM_CITRUSCART_STORE_CREDIT');
        ?>
</h3>
		        <div id="credit_help"><?php 
        echo sprintf(JText::_('COM_CITRUSCART_YOU_HAVE_STORE_CREDIT'), CitruscartHelperBase::currency($this->userinfo->credits_total));
        ?>
</div>
		       	<div id="credit_message"></div>
		        <input type="text" name="apply_credit_amount" id="apply_credit_amount" value="" />
		    	<input type="button" name="credit_submit" value="<?php 
        echo JText::_('COM_CITRUSCART_APPLY_CREDIT_TO_ORDER');
        ?>
"  onClick="CitruscartAddCredit( document.adminForm );"/>
			</div>
		</div>
		<?php 
    }
    ?>
		<div id='applied_credit' style="display: none;"></div>
        <div class="reset"></div>
예제 #10
0
/*------------------------------------------------------------------------
# com_citruscart
# ------------------------------------------------------------------------
# author   Citruscart Team  - Citruscart http://www.citruscart.com
# copyright Copyright (C) 2014 Citruscart.com All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://citruscart.com
# Technical Support:  Forum - http://citruscart.com/forum/index.html
-------------------------------------------------------------------------*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
JHtml::_('stylesheet', 'media/citruscart/css/citruscart.css');
Citruscart::load('CitruscartHelperBase', 'helpers._base');
jimport('joomla.html');
?>

<?php 
$rates = array();
foreach ($vars->rates as $rate) {
    $r = new JObject();
    $r->value = $rate->shipping_rate_id;
    $r->text = CitruscartHelperBase::currency($rate->shipping_rate_price, $vars->order->currency_id);
    $rates[] = $r;
}
?>
<div class="shipping_rates">
<?php 
echo JHTML::_('select.radiolist', $rates, 'shipping_rate', array());
?>
</div>
예제 #11
0
                    <?php 
    if (strlen($item->manufacturer_name)) {
        echo $item->manufacturer_name;
    } else {
        echo ' - ' . JText::_('COM_CITRUSCART_NO_MANUFACTURER') . ' - ';
    }
    ?>
                </td>
                <td style="text-align: center;">
                    <?php 
    echo $item->count_items;
    ?>
                </td>
                <td style="text-align: center;">
                    <?php 
    echo CitruscartHelperBase::currency($item->price_total);
    ?>
                </td>
            </tr>
            <?php 
    $k = 1 - $k;
    ?>
            <?php 
}
?>

            <?php 
if (!count($items)) {
    ?>
            <tr>
                <td colspan="10" align="center">
예제 #12
0
</h4>
	<ul id="citruscart_browse_pricerange">
		<?php 
        foreach ($priceRanges as $priceRange) {
            ?>
			<?php 
            if ($priceRange->total > 0) {
                ?>
			<li>
				<a href="<?php 
                echo JRoute::_($priceRange->link);
                ?>
">
					<span class="refinementLink">
						<?php 
                echo CitruscartHelperBase::currency($priceRange->price_from) . ' - ' . CitruscartHelperBase::currency($priceRange->price_to);
                ?>
					</span>
				</a>
				<span class="narrowValue">
					(<?php 
                echo $priceRange->total;
                ?>
)
				</span>
			</li>
			<?php 
            }
            ?>
		<?php 
        }
예제 #13
0
				<td class="dashboard_profits_data float-shadow"><h3><?php 
    echo CitruscartSelect::range($state->stats_interval, 'stats_interval', $attribs);
    ?>
</h3></td>
				<?php 
} else {
    ?>
				<td class="dashboard_profits_data float-shadow"><h3><?php 
    echo CitruscartSelect::range($state->stats_interval, 'stats_interval', $attribs, null, true);
    ?>
</h3></td>
				<?php 
}
?>
				<td class="dashboard_profits_data float-shadow"><h1><?php 
echo CitruscartHelperBase::currency($this->sum);
?>
</h1></td>
				<td class="dashboard_profits_data float-shadow"><h1><?php 
echo CitruscartHelperBase::number($this->total, array('num_decimals' => '0'));
?>
</h1></td>
			    <td class="dashboard_profits_data"><h1><?php 
echo CitruscartHelperBase::number($this->orderedItems, array('num_decimals' => '0'));
?>
</h1></td>
			    
			</tr>
			</tbody>
			</table>
            <div class="section">
예제 #14
0
    }
    ?>
                </td>
                <td style="text-align: center;">
                    <a href="<?php 
    echo $item->link;
    ?>
">
                        <?php 
    echo JText::_($item->credittype_name);
    ?>
                    </a>
                </td>
				<td style="text-align: center;">
					<h2 class="badge badge-success"><?php 
    echo CitruscartHelperBase::currency($item->credit_amount);
    ?>
</h2>
				</td>
                <td style="text-align: center;">
                   <?php 
    echo JHTML::_('date', $item->created_date, $date_format);
    ?>
                </td>
                <td style="text-align: center;">
                    <?php 
    echo CitruscartGrid::boolean($item->credit_enabled);
    ?>
                </td>
                <td style="text-align: center;">
                    <?php 
예제 #15
0
                    ?>
</th>
		</tr>
  	<?php 
                }
            }
        }
        break;
    case 4:
        // All in One Line
        if ($row->order_tax) {
            ?>
    <tr>
	    <th colspan="2" style="text-align: right;">
     	<?php 
            if (!empty($this->show_tax)) {
                echo JText::_('COM_CITRUSCART_PRODUCT_TAX_INCLUDED') . ":";
            } else {
                echo JText::_('COM_CITRUSCART_PRODUCT_TAX') . ":";
            }
            ?>
			</th>
   		<th style="text-align: right;"><?php 
            echo CitruscartHelperBase::currency($row->order_tax);
            ?>
</th>
   	</tr>
		<?php 
        }
        break;
}
예제 #16
0
 public function deleteCartItem()
 {
     $input = JFactory::getApplication()->input;
     $response = new stdClass();
     $response->html = '';
     $response->error = false;
     $user = JFactory::getUser();
     $model = $this->getModel('carts');
     $table = $model->getTable();
     $id = $input->getInt('cartitem_id');
     $keys = array('user_id' => $user->id, 'cart_id' => $id);
     $table->load($keys);
     if (!empty($table->cart_id)) {
         if ($table->delete()) {
             $response->html = JText::_('COM_CITRUSCART_CARTITEM_DELETED');
         } else {
             $response->html = JText::_('COM_CITRUSCART_DELETE_FAILED');
             $response->error = true;
         }
     } else {
         $response->html = JText::_('COM_CITRUSCART_INVALID_REQUEST');
         $response->error = true;
     }
     // we deleted the item so we have to recalculate the subtotal
     $response->subtotal = 0;
     if ($response->error == false) {
         $show_tax = $this->defines->get('display_prices_with_tax');
         $model = $this->getModel($this->get('suffix'));
         $this->_setModelState();
         $items = $model->getList();
         Citruscart::load('CitruscartHelperUser', 'helpers.user');
         Citruscart::load('CitruscartHelperTax', 'helpers.tax');
         if ($show_tax) {
             $taxes = CitruscartHelperTax::calculateTax($items, 2);
         }
         foreach ($items as $item) {
             if ($show_tax) {
                 $item->product_price += $taxes->product_taxes[$item->product_id];
             }
             $response->subtotal += $item->product_price * $item->product_qty;
         }
         $response->subtotal = CitruscartHelperBase::currency($response->subtotal);
     }
     echo json_encode($response);
     return;
 }
예제 #17
0
        ?>
    					<br/>
    					&nbsp;&nbsp;&bull;&nbsp;&nbsp;<?php 
        echo $item->email . ' [ ' . $item->user_username . ' ]';
        ?>
    					<br/>
					<?php 
    }
    ?>
				</td>
				<td style="text-align: center;">
				    <?php 
    $currency = !empty($item->currency) ? $item->currency : '';
    ?>
					<label class="label label-warning"><?php 
    echo CitruscartHelperBase::currency($item->orderpayment_amount, $currency);
    ?>
</label>
                    <?php 
    if (!empty($item->commissions)) {
        ?>
                        <br/>
                        <?php 
        JHTML::_('behavior.tooltip');
        ?>
                        <a href="index.php?option=com_amigos&view=commissions&filter_orderid=<?php 
        echo $item->order_id;
        ?>
" target="_blank">
                            <img src='<?php 
        echo JURI::root(true);
예제 #18
0
?>
                    </a>
                </td>
            </tr>
            <?php 
if ($display_credits) {
    ?>
            <tr>
                <th style="width: 100px;">
                    <?php 
    echo JText::_('COM_CITRUSCART_AVAILABLE_STORE_CREDIT');
    ?>
                </th>
                <td>
                    <?php 
    echo CitruscartHelperBase::currency($this->userinfo->credits_total);
    ?>
                </td>
            </tr>
            <?php 
}
?>
            </tbody>
            </table>

		<?php 
$modules = JModuleHelper::getModules("citruscart_dashboard_main");
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$attribs = array();
$attribs['style'] = 'xhtml';
예제 #19
0
 /**
  * Displays a product category
  *
  * (non-PHPdoc)
  * @see Citruscart/admin/CitruscartController#display($cachable)
  */
 function display($cachable = false, $urlparams = false)
 {
     $input = JFactory::getApplication()->input;
     $input->set('view', $this->get('suffix'));
     $input->set('search', false);
     $view = $this->getView($this->get('suffix'), JFactory::getDocument()->getType());
     $model = $this->getModel($this->get('suffix'));
     $state = $this->_setModelState();
     $session = JFactory::getSession();
     $app = JFactory::getApplication();
     $ns = $app->getName() . '::' . 'com.citruscart.products.state.' . $this->itemid;
     $session->set($ns, $state);
     $app = JFactory::getApplication();
     $ns_general = $app->getName() . '::' . 'com.citruscart.products.state';
     $session->set($ns_general, $state);
     // get the category we're looking at
     $filter_category = $model->getState('filter_category', $input->getString('filter_category'));
     JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/models');
     $cmodel = JModelLegacy::getInstance('Categories', 'CitruscartModel');
     $cat = $cmodel->getTable();
     $cat->load($filter_category);
     // set the title based on the selected category
     $title = empty($cat->category_name) ? JText::_('COM_CITRUSCART_ALL_CATEGORIES') : JText::_($cat->category_name);
     $level = !empty($filter_category) ? $filter_category : '1';
     // breadcrumb support
     $app = JFactory::getApplication();
     $pathway = $app->getPathway();
     // does this item have its own itemid?  if so, let joomla handle the breadcrumb,
     // otherwise, help it out a little bit
     $category_itemid = $this->router->category($filter_category, true);
     if (!$category_itemid) {
         $category_itemid = $input->getInt('Itemid');
         $items = Citruscart::getClass("CitruscartHelperCategory", 'helpers.category')->getPathName($filter_category, 'array');
         if (!empty($items)) {
             // add the categories to the pathway
             Citruscart::getClass("CitruscartHelperPathway", 'helpers.pathway')->insertCategories($items, $category_itemid);
         }
         // add the item being viewed to the pathway
         $pathway_values = $pathway->getPathway();
         $pathway_names = Citruscart::getClass("CitruscartHelperBase", 'helpers._base')->getColumn($pathway_values, 'name');
         $pathway_links = Citruscart::getClass("CitruscartHelperBase", 'helpers._base')->getColumn($pathway_values, 'link');
         $cat_url = "index.php?Itemid={$category_itemid}";
         if (!in_array($cat->category_name, $pathway_names)) {
             $pathway->addItem($title);
         }
     }
     $cat->itemid = $category_itemid;
     // get the category's sub categories
     $cmodel->setState('filter_level', $level);
     $cmodel->setState('filter_enabled', '1');
     $cmodel->setState('order', 'tbl.lft');
     $cmodel->setState('direction', 'ASC');
     if ($citems = $cmodel->getList()) {
         foreach ($citems as $item) {
             $item->itemid_string = null;
             $item->itemid = Citruscart::getClass("CitruscartHelperRoute", 'helpers.route')->category($item->category_id, true);
             if (!empty($item->itemid)) {
                 $item->itemid_string = "&Itemid=" . $item->itemid;
             }
         }
     }
     $this->_list = true;
     // if you want to display a slightly differen add-to-cart area for list view, check this boolean
     // get the products to be displayed in this category
     if ($items = $model->getList()) {
         $input->set('page', 'category');
         // for "getCartButton"
         $this->display_cartbutton = Citruscart::getInstance()->get('display_category_cartbuttons', '1');
         foreach ($items as $item) {
             $item->itemid_string = null;
             $item->itemid = (int) Citruscart::getClass("CitruscartHelperRoute", 'helpers.route')->product($item->product_id, null, true);
             if (!empty($item->itemid)) {
                 $item->itemid_string = "&Itemid=" . $item->itemid;
             }
         }
     }
     if ($model->getState('filter_price_from') > '0' || $model->getState('filter_price_to') > '0') {
         $url = "index.php?option=com_citruscart&view=products&filter_category={$filter_category}&filter_price_from=&filter_price_to=";
         $from = CitruscartHelperBase::currency($model->getState('filter_price_from'));
         $to = $model->getState('filter_price_to') > 0 ? CitruscartHelperBase::currency($model->getState('filter_price_to')) : JText::_('COM_CITRUSCART_MAXIMUM_PRICE');
         $view->assign('remove_pricefilter_url', $url);
         $view->assign('pricefilter_applied', true);
         $view->assign('filterprice_from', $from);
         $view->assign('filterprice_to', $to);
     }
     if (Citruscart::getInstance()->get('enable_product_compare', '1')) {
         Citruscart::load("CitruscartHelperProductCompare", 'helpers.productcompare');
         $compareitems = CitruscartHelperProductCompare::getComparedProducts();
         $view->assign('compareitems', $compareitems);
     }
     $view->assign('level', $level);
     $view->assign('title', $title);
     $view->assign('cat', $cat);
     $view->assign('citems', $citems);
     $view->assign('items', $items);
     $view->set('_doTask', true);
     $view->setModel($model, true);
     // add the media/templates folder as a valid path for templates
     $view->addTemplatePath(Citruscart::getPath('categories_templates'));
     // but add back the template overrides folder to give it priority
     $template_overrides = JPATH_BASE . '/templates/' . $app->getTemplate() . '/html/com_citruscart/' . $view->getName();
     $view->addTemplatePath($template_overrides);
     // using a helper file, we determine the category's layout
     $layout = Citruscart::getClass('CitruscartHelperCategory', 'helpers.category')->getLayout($cat->category_id);
     $view->setLayout($layout);
     $view->display();
     $this->footer();
     return;
 }
예제 #20
0
		                <?php 
    }
    ?>
	                </td>
                    <td style="text-align: center; vertical-valign: top;">
                        <input name="quantity[<?php 
    echo $item->product_id;
    ?>
]" value="<?php 
    echo $item->orderitem_quantity;
    ?>
" style="width: 30px;" type="text" />
                    </td>
                    <td style="text-align: right; vertical-valign: top;">
                        <?php 
    echo CitruscartHelperBase::currency($item->orderitem_final_price);
    ?>
                    </td>
                </tr>
            <?php 
    $i = $i + 1;
    $k = 1 - $k;
    ?>
            <?php 
}
?>
            <?php 
if (empty($items)) {
    ?>
	            <tr>
	            <td colspan="5" align="center">
예제 #21
0
        echo $item->shipping_address_2 ? $item->shipping_address_2 . ", " : "";
        echo $item->shipping_city . ", ";
        echo $item->shipping_zone_name . " ";
        echo $item->shipping_postal_code . " ";
        echo $item->shipping_country_name;
    }
    ?>
                    <?php 
    if (!empty($item->order_number)) {
        echo "<br/><b>" . JText::_('COM_CITRUSCART_ORDER_NUMBER') . "</b>: " . $item->order_number;
    }
    ?>
				</td>
				<td style="text-align: center;">
					<label class="label label-warning"><?php 
    echo CitruscartHelperBase::currency($item->order_total, $item->currency);
    ?>
</label>
                    <?php 
    if (!empty($item->commissions)) {
        ?>
                        <br/>
                        <?php 
        JHTML::_('behavior.tooltip');
        ?>
                        <a href="index.php?option=com_amigos&view=commissions&filter_orderid=<?php 
        echo $item->order_id;
        ?>
" target="_blank">
                            <img src='<?php 
        echo JURI::root(true);
예제 #22
0
            (<?php 
    echo $item->recurring_payments . " " . JText::_('COM_CITRUSCART_PAYMENTS');
    ?>
, <?php 
    echo $item->recurring_period_interval . " " . JText::_('COM_CITRUSCART_PERIOD_UNIT_' . $item->recurring_period_unit) . " " . JText::_('COM_CITRUSCART_PERIODS');
    ?>
)
            <?php 
    if ($item->recurring_trial) {
        ?>
                <br/>
                <?php 
        echo JText::_('COM_CITRUSCART_TRIAL_PERIOD_PRICE');
        ?>
: <?php 
        echo CitruscartHelperBase::currency($item->recurring_trial_price);
        ?>
                (<?php 
        echo "1 " . JText::_('COM_CITRUSCART_PAYMENT');
        ?>
, <?php 
        echo $item->recurring_trial_period_interval . " " . JText::_('COM_CITRUSCART_PERIOD_UNIT_' . $item->recurring_period_unit) . " " . JText::_('COM_CITRUSCART_PERIOD');
        ?>
)
            <?php 
    }
    ?>
            </div>
        </div>
    <?php 
}
예제 #23
0
 /**
  * Get the price range based on the Highest and lowest prices
  * @return array
  */
 function getPriceRange()
 {
     // Check the registry to see if our Citruscart class has been overridden
     if (!class_exists('Citruscart')) {
         JLoader::register("Citruscart", JPATH_ADMINISTRATOR . "/components/com_citruscart/defines.php");
     }
     // load the config class
     Citruscart::load('Citruscart', 'defines');
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables');
     JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/models');
     $ranges = array();
     $link = '';
     // get the model
     $model = JModelLegacy::getInstance('Products', 'CitruscartModel');
     $app = JFactory::getApplication();
     $ns = $app->getName() . '::' . 'com.citruscart.model.' . $model->getTable()->get('_suffix');
     //check if we are in the manufacturer view
     $view = JRequest::getWord('view');
     if ($view == 'manufacturers') {
         //get the current manufacturer
         $filter_manufacturer = $app->getUserStateFromRequest($ns . '.manufacturer', 'filter_manufacturer', '', 'int');
         if (empty($filter_manufacturer)) {
             return '';
         }
         $model->setState('filter_manufacturer', $filter_manufacturer);
         //create link to be concatinated
         $link = '&view=manufacturers&layout=products&task=products&filter_manufacturer=' . $filter_manufacturer;
     } else {
         //get the current category
         $filter_category = $app->getUserStateFromRequest($ns . '.category', 'filter_category', '', 'int');
         if (empty($filter_category)) {
             return '';
         }
         $model->setState('filter_category', $filter_category);
         //create link to be concatinated
         $link = '&filter_category=' . $filter_category;
     }
     //set the direction of the price
     $model->setState('order', 'price');
     $model->setState('direction', 'DESC');
     //get items
     $items = $model->getList();
     //check if we dont have product in the category
     if (empty($items)) {
         $ranges[$link] = JText::_('COM_CITRUSCART_NO_AVAILABLE_PRODUCT');
         return $ranges;
     }
     //get the highest price
     $priceHigh = abs($items['0']->price);
     //get the lowest price
     $priceLow = count($items) == 1 ? 0 : abs($items[count($items) - 1]->price);
     $range = (abs($priceHigh) - abs($priceLow)) / 4;
     //rounding
     $roundRange = $this->_priceRound($range, $this->params->get('round_digit'), true);
     $roundPriceLow = $this->_priceRound($priceLow, $this->params->get('round_digit'));
     $upperPrice = $this->params->get('filter_upper_limit');
     //load the helper base class
     Citruscart::load('CitruscartHelperBase', 'helpers._base');
     $ranges[$link . '&filter_price_from=' . $roundPriceLow . '&filter_price_to=' . $roundRange] = CitruscartHelperBase::currency($roundPriceLow) . ' - ' . CitruscartHelperBase::currency($roundRange);
     $ranges[$link . '&filter_price_from=' . $roundRange . '&filter_price_to=' . $roundRange * 2] = CitruscartHelperBase::currency($roundRange) . ' - ' . CitruscartHelperBase::currency($roundRange * 2);
     $ranges[$link . '&filter_price_from=' . $roundRange * 2 . '&filter_price_to=' . $roundRange * 3] = CitruscartHelperBase::currency($roundRange * 2) . ' - ' . CitruscartHelperBase::currency($roundRange * 3);
     $ranges[$link . '&filter_price_from=' . $roundRange * 3 . '&filter_price_to=' . $upperPrice] = CitruscartHelperBase::currency($roundRange * 3) . ' - ' . CitruscartHelperBase::currency($upperPrice);
     $ranges[$link . '&filter_price_from=' . $upperPrice] = JText::_('COM_CITRUSCART_MORE_THAN_') . CitruscartHelperBase::currency($upperPrice);
     return $ranges;
 }
예제 #24
0
 public function setShippingMethod()
 {
     $input = JFactory::getApplication()->input;
     $this->setFormat();
     $session = JFactory::getSession();
     $response = $this->getResponseObject();
     $post = $input->getArray($_POST);
     $errorMessage = '';
     if (empty($post['shipping_plugin'])) {
         $errorMessage = '<ul class="text-error">';
         $errorMessage .= "<li>" . JText::_("COM_CITRUSCART_PLEASE_SELECT_SHIPPING_METHOD") . "</li>";
         $errorMessage .= '</ul>';
         $response->goto_section = 'shipping-method';
         $response->summary->html = $errorMessage;
         echo json_encode($response);
         return;
     }
     $value = $post['shipping_plugin'];
     $parts = explode('.', $value);
     $plugin = $parts[0];
     $key = $parts[1];
     $shippingRates = unserialize($session->get('citruscart.opc.shippingRates'));
     $currency = Citruscart::getInstance()->get('default_currencyid', 1);
     $rate = !empty($shippingRates[$key]) ? $shippingRates[$key] : null;
     $summary = $rate ? $rate['name'] . " (" . CitruscartHelperBase::currency($rate['total'], $currency) . ")" : null;
     $requireShipping = unserialize($session->get('citruscart.opc.requireShipping'));
     if ($requireShipping && empty($rate)) {
         $response->goto_section = 'shipping-method';
         $response->summary->id = 'opc-shipping-method-validation';
         $response->summary->html = JText::_("COM_CITRUSCART_INVALID_SHIPPING_RATE");
     } else {
         $response->goto_section = 'payment';
         $response->summary->html = $summary;
         $session->set('citruscart.opc.shippingMethod', serialize($rate));
     }
     echo json_encode($response);
 }
예제 #25
0
                        <?php 
    Citruscart::load('CitruscartHelperShipping', 'helpers.shipping');
    ?>
                        <span style="float: right;">[<?php 
    echo CitruscartUrl::popup("index.php?option=com_citruscart&controller=shippingmethods&task=setrates&id=" . $item->shipping_method_id . "&tmpl=component", "Set Rates");
    ?>
]</span>
                        <?php 
    if ($shipping_method_type = CitruscartHelperShipping::getType($item->shipping_method_type)) {
        echo "<b>" . JText::_('COM_CITRUSCART_TYPE') . "</b>: " . $shipping_method_type->title;
    }
    if ($item->subtotal_minimum > '0') {
        echo "<br/><b>" . JText::_('COM_CITRUSCART_MINIMUM_ORDER_REQUIRED') . "</b>: " . CitruscartHelperBase::currency($item->subtotal_minimum);
    }
    if ($item->subtotal_maximum > '-1') {
        echo "<br/><b>" . JText::_('COM_CITRUSCART_SHIPPING_METHODS_SUBTOTAL_MAX') . "</b>: " . CitruscartHelperBase::currency($item->subtotal_maximum);
    }
    ?>
                    </div>
				</td>
				<td style="text-align: center;">
				    <?php 
    echo $item->tax_class_name;
    ?>
				</td>
				<td style="text-align: center;">
					<?php 
    echo CitruscartGrid::enable($item->shipping_method_enabled, $i, 'shipping_method_enabled.');
    ?>
				</td>
			</tr>
예제 #26
0
?>
	</span>
</span>
               
<span class="left38 right">
	<span class="inner">
	<?php 
if (!empty($this->showShipping)) {
    echo CitruscartHelperBase::currency($order->order_shipping, $order->currency);
}
?>
	</span>
</span>                  
<span class="left62">
	<span class="inner">
	<?php 
if (!empty($this->showShipping) && $display_shipping_tax && $order->order_shipping_tax) {
    echo JText::_('COM_CITRUSCART_SHIPPING_TAX') . ":";
}
?>
	</span>
</span>                  
<span class="left38 right">
	<span class="inner">
	<?php 
if (!empty($this->showShipping) && $display_shipping_tax && $order->order_shipping_tax) {
    echo CitruscartHelperBase::currency((double) $order->order_shipping_tax, $order->currency);
}
?>
	</span>
</span>
예제 #27
0
                    <td colspan="2">
                        <input style="float: right;" type="submit" class="btn btn-success" value="<?php 
    echo JText::_('COM_CITRUSCART_UPDATE_QUANTITIES');
    ?>
" name="update" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="font-weight: bold;">
                        <?php 
    echo JText::_('COM_CITRUSCART_SUBTOTAL');
    ?>
                    </td>
                    <td style="text-align: right;">
                        <span id="totalAmountDue"><?php 
    echo CitruscartHelperBase::currency($subtotal);
    ?>
</span>
                    </td>
                </tr>
                <tr>
                	<td colspan="5" style="white-space: nowrap;">
                        <b><?php 
    echo JText::_('COM_CITRUSCART_TAX_AND_SHIPPING_TOTALS');
    ?>
</b>
                        <br/>
                        <?php 
    echo JText::_('COM_CITRUSCART_CALCULATED_DURING_CHECKOUT_PROCESS');
    ?>
              	 	</td>
예제 #28
0
    echo CitruscartHelperBase::currency($row->order_credit, $row->currency);
    ?>
                </th>
            </tr>
            <?php 
}
?>
            <tr>
                <th colspan="2" style="font-size: 120%; text-align: right;">
                <?php 
echo JText::_('COM_CITRUSCART_TOTAL');
?>
                </th>
                <th style="font-size: 120%; text-align: right;">
                <?php 
echo CitruscartHelperBase::currency($row->order_total, $row->currency);
?>
                </th>
            </tr>
            </tfoot>
            </table>
            </fieldset>
        </div>
        <?php 
// fire plugin event here to enable extending the form
JDispatcher::getInstance()->trigger('onAfterDisplayOrderViewOrderItems', array($row));
?>

    </td>
    <td style="width: 50%; vertical-align: top;">
예제 #29
0
                    ?>
)
				                <?php 
                }
                ?>
                            <?php 
            }
            ?>
                        <?php 
        } else {
            ?>
                            <?php 
            echo JText::_('COM_CITRUSCART_PRICE');
            ?>
: <?php 
            echo CitruscartHelperBase::currency($item->product_price);
            ?>
                        <?php 
        }
        ?>

                        <br/> <?php 
        echo CitruscartHelperProduct::getRatingImage($item->product_rating);
        ?>
  <br/>

					    <?php 
        if (!empty($this->onDisplayCartItem) && !empty($this->onDisplayCartItem[$i])) {
            ?>
					        <div class='onDisplayCartItem_wrapper_<?php 
            echo $i;
예제 #30
0
    echo $item->order_id;
    ?>
					<input type="hidden" name="cid[]" value="<?php 
    echo $item->order_id;
    ?>
"/>
				</td>
				<td>
				    <?php 
    echo JHTML::_('date', $item->created_date, Citruscart::getInstance()->get('date_format'));
    ?>
				</td>
				<td style="text-align: left;">
                    <?php 
    echo "<b>" . JText::_('COM_CITRUSCART_ORDER_ID') . "</b>: " . $item->order_id . "<br>";
    echo "<b>" . JText::_('COM_CITRUSCART_ORDER_AMOUNT') . "</b>: " . CitruscartHelperBase::currency($item->order_total) . "<br>";
    ?>
				</td>
                <td>
                    <?php 
    echo $item->user_name . ' [ ' . $item->user_id . ' ]';
    ?>
                    &nbsp;&nbsp;&bull;&nbsp;&nbsp;<?php 
    echo $item->email . ' [ ' . $item->user_username . ' ]';
    ?>
                    <br/>
                    <b><?php 
    echo JText::_('COM_CITRUSCART_SHIP_TO');
    ?>
</b>:
                    <?php