Exemple #1
0
    function fetchElement($name, $value, &$node, $control_name)
    {
        $output = '
		<input type="text" class="text_area" value="" id="pluginstiendaproductPrice" name="plugins[tiendaproductPrice]">
		<span class="k2Note">' . JText::_('Set Normal Price Now Special Prices Later') . '</span>
		';
        $id = JRequest::getInt('cid');
        if ($id) {
            $K2Item = JTable::getInstance('K2Item', 'Table');
            $K2Item->load($id);
            $params = new K2Parameter($K2Item->plugins, JPATH_PLUGINS . '/k2/tienda.xml', 'tienda');
            $productID = $params->get('productID');
            if ($productID) {
                Tienda::load('TiendaUrl', 'library.url');
                Tienda::load("TiendaHelperProduct", 'helpers.product');
                $prices = TiendaHelperProduct::getPrices($productID);
                if (count($prices)) {
                    $output = '<div class="tiendaButton">' . TiendaUrl::popup("index.php?option=com_tienda&controller=products&task=setprices&id=" . $productID . "&tmpl=component", JText::_('COM_TIENDA_SET_PRICES')) . '</div>';
                    $output .= '<div>';
                    foreach (@$prices as $price) {
                        $output .= '
						<div>
							<span>' . TiendaHelperBase::currency($price->product_price) . '</span>
							<div class="tiendaButton"><a href="' . $price->link_remove . '&return=' . base64_encode("index.php?option=com_k2&view=item&cid=" . $id) . '">' . JText::_('Remove') . '</a></div>
						</div>';
                    }
                    $output .= '</div>';
                }
            }
        }
        return $output;
    }
 /**
  * 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::getCmd( '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->Quote('%' . $db->getEscaped($search, true) . '%', false);
         $where[] = 'LOWER( tbl.product_name ) LIKE ' . $db->Quote('%' . $db->getEscaped($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 #__tienda_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 #__tienda_products AS tbl' . ' LEFT JOIN #__tienda_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
     Tienda::load('TiendaHelperBase', 'helpers._base');
     foreach ($this->_list as $item) {
         $item->product_price = TiendaHelperBase::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;
 }
Exemple #3
0
		<?php 
        foreach ($priceRanges as $priceRange) {
            ?>
	
			<?php 
            if ($priceRange->total > 0) {
                ?>
		
			<li>
				<a href="<?php 
                echo JRoute::_($priceRange->link);
                ?>
">
					<span class="refinementLink">
						<?php 
                echo TiendaHelperBase::currency($priceRange->price_from) . ' - ' . TiendaHelperBase::currency($priceRange->price_to);
                ?>
					</span>
				</a>
				<span class="narrowValue">
					(<?php 
                echo $priceRange->total;
                ?>
)
				</span>							
			</li>	
			<?php 
            }
            ?>
		
		<?php 
Exemple #4
0
	<tr>
		<th style="width: 100px;" class="key">
			 <?php 
echo JText::_('COM_TIENDA_SHIPPING_TAX');
?>
:
		</th>
		<td>
		    <?php 
echo TiendaHelperBase::currency(@$this->shipping_total->shipping_tax_total);
?>
		</td>
	</tr>
	<tr>
		<th style="width: 100px;" class="key">
			<label for="grand_total" style="color:#1432F2;font-size:16px;">
			 <?php 
echo JText::_('COM_TIENDA_GRAND_TOTAL');
?>
:
			</label>
		</th>
		<td style="color:#1432F2;font-size:16px;">
            <?php 
echo TiendaHelperBase::currency(@$totals->order_total);
?>
		</td>
	</tr>					
	</tbody>
</table>
Exemple #5
0
    if (strlen($item->manufacturer_name)) {
        echo $item->manufacturer_name;
    } else {
        echo ' - ' . JText::_('COM_TIENDA_NO_MANUFACTURER') . ' - ';
    }
    ?>
                </td>    
                <td style="text-align: center;">
                    <?php 
    echo @$item->count_items;
    ?>
                    
                </td>           
                <td style="text-align: center;">
                    <?php 
    echo @TiendaHelperBase::currency($item->price_total);
    ?>
                </td>
            </tr>
            <?php 
    $k = 1 - $k;
    ?>
            <?php 
}
?>

            <?php 
if (!count(@$items)) {
    ?>
            <tr>
                <td colspan="10" align="center">
Exemple #6
0
				<?php 
if ($display_credits) {
    ?>
				<div class="reset marginbot"></div>
				<?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_TIENDA_STORE_CREDIT');
        ?>
</h3>
		                <div id="credit_help"><?php 
        echo sprintf(JText::_('COM_TIENDA_YOU_HAVE_STORE_CREDIT'), TiendaHelperBase::currency($this->userinfo->credits_total, Tienda::getInstance()->get('default_currencyid', 1)));
        ?>
</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_TIENDA_APPLY_CREDIT_TO_ORDER');
        ?>
"  onClick="tiendaAddCredit( document.adminForm );"/>
		                </div>
		            </div>
		        <?php 
    }
    ?>
		        <div id='applied_credit' style="display: none;"></div>				
				<?php 
Exemple #7
0
 public function deleteCartItem()
 {
     $response = new stdClass();
     $response->html = '';
     $response->error = false;
     $user = JFactory::getUser();
     $model = $this->getModel('carts');
     $table = $model->getTable();
     $id = JRequest::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_TIENDA_CARTITEM_DELETED');
         } else {
             $response->html = JText::_('COM_TIENDA_DELETE_FAILED');
             $response->error = true;
         }
     } else {
         $response->html = JText::_('COM_TIENDA_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();
         Tienda::load('TiendaHelperUser', 'helpers.user');
         Tienda::load('TiendaHelperTax', 'helpers.tax');
         if ($show_tax) {
             $taxes = TiendaHelperTax::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 = TiendaHelperBase::currency($response->subtotal);
     }
     echo json_encode($response);
     return;
 }
Exemple #8
0
<?php

/*Layout for displaying refreshed total amount.*/
defined('_JEXEC') or die('Restricted access');
JHTML::_('stylesheet', 'menu.css', 'media/com_tienda/css/');
JHTML::_('script', 'tienda.js', 'media/com_tienda/js/');
JHTML::_('script', 'joomla.javascript.js', 'includes/js/');
Tienda::load('TiendaGrid', 'library.grid');
$state = @$this->state;
$order = @$this->order;
$items = @$this->orderitems;
echo TiendaHelperBase::currency($items);
Exemple #9
0
            <?php 
        } else {
            ?>
                <div id="payment_paypal">
                    <div class="prepayment_message">
                        <?php 
            echo JText::_('COM_TIENDA_PAYPAL_PAYMENT_STANDARD_PREPARATION_MESSAGE');
            ?>
                    </div>
                    <div class="prepayment_action">
                        <div style="float: left; padding: 10px;"><input type="image" src="<?php 
            echo $vars->img_url_std;
            ?>
" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" /></div>
                        <div style="float: left; padding: 10px;"><?php 
            echo "<b>" . JText::_('COM_TIENDA_CHECKOUT_AMOUNT') . ":</b> " . TiendaHelperBase::currency(@$vars->orderpayment_amount);
            ?>
</div>
                        <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
                        <div style="clear: both;"></div>
                    </div>
                </div>
            <?php 
        }
        ?>
            <?php 
        break;
}
?>

<!--PAYPAL VARIABLES-->
Exemple #10
0
            (<?php 
    echo $item->recurring_payments . " " . JText::_('COM_TIENDA_PAYMENTS');
    ?>
, <?php 
    echo $item->recurring_period_interval . " " . JText::_('COM_TIENDA_PERIOD_UNIT_' . $item->recurring_period_unit) . " " . JText::_('COM_TIENDA_PERIODS');
    ?>
) 
            <?php 
    if ($item->recurring_trial) {
        ?>
                <br/>
                <?php 
        echo JText::_('COM_TIENDA_TRIAL_PERIOD_PRICE');
        ?>
: <?php 
        echo TiendaHelperBase::currency($item->recurring_trial_price);
        ?>
                (<?php 
        echo "1 " . JText::_('COM_TIENDA_PAYMENT');
        ?>
, <?php 
        echo $item->recurring_trial_period_interval . " " . JText::_('COM_TIENDA_PERIOD_UNIT_' . $item->recurring_period_unit) . " " . JText::_('COM_TIENDA_PERIOD');
        ?>
)
            <?php 
    }
    ?>
 
            </div>
        </div>
    <?php 
Exemple #11
0
 /**
  * Displays a product category
  *
  * (non-PHPdoc)
  * @see tienda/admin/TiendaController#display($cachable)
  */
 function display($cachable = false, $urlparams = false)
 {
     JRequest::setVar('view', $this->get('suffix'));
     JRequest::setVar('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.tienda.products.state.' . $this->itemid;
     $session->set($ns, $state);
     $app = JFactory::getApplication();
     $ns_general = $app->getName() . '::' . 'com.tienda.products.state';
     $session->set($ns_general, $state);
     // get the category we're looking at
     $filter_category = $model->getState('filter_category', JRequest::getVar('filter_category'));
     JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/models');
     $cmodel = JModel::getInstance('Categories', 'TiendaModel');
     $cat = $cmodel->getTable();
     $cat->load($filter_category);
     // set the title based on the selected category
     $title = empty($cat->category_name) ? JText::_('COM_TIENDA_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 = JRequest::getInt('Itemid');
         $items = Tienda::getClass("TiendaHelperCategory", 'helpers.category')->getPathName($filter_category, 'array');
         if (!empty($items)) {
             // add the categories to the pathway
             Tienda::getClass("TiendaHelperPathway", 'helpers.pathway')->insertCategories($items, $category_itemid);
         }
         // add the item being viewed to the pathway
         $pathway_values = $pathway->getPathway();
         $pathway_names = Tienda::getClass("TiendaHelperBase", 'helpers._base')->getColumn($pathway_values, 'name');
         $pathway_links = Tienda::getClass("TiendaHelperBase", '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 = Tienda::getClass("TiendaHelperRoute", '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()) {
         JRequest::setVar('page', 'category');
         // for "getCartButton"
         $this->display_cartbutton = Tienda::getInstance()->get('display_category_cartbuttons', '1');
         foreach ($items as $item) {
             $item->itemid_string = null;
             $item->itemid = (int) Tienda::getClass("TiendaHelperRoute", '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_tienda&view=products&filter_category={$filter_category}&filter_price_from=&filter_price_to=";
         $from = TiendaHelperBase::currency($model->getState('filter_price_from'));
         $to = $model->getState('filter_price_to') > 0 ? TiendaHelperBase::currency($model->getState('filter_price_to')) : JText::_('COM_TIENDA_MAXIMUM_PRICE');
         $view->assign('remove_pricefilter_url', $url);
         $view->assign('pricefilter_applied', true);
         $view->assign('filterprice_from', $from);
         $view->assign('filterprice_to', $to);
     }
     if (Tienda::getInstance()->get('enable_product_compare', '1')) {
         Tienda::load("TiendaHelperProductCompare", 'helpers.productcompare');
         $compareitems = TiendaHelperProductCompare::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(Tienda::getPath('categories_templates'));
     // but add back the template overrides folder to give it priority
     $template_overrides = JPATH_BASE . '/templates/' . $app->getTemplate() . '/html/com_tienda/' . $view->getName();
     $view->addTemplatePath($template_overrides);
     // using a helper file, we determine the category's layout
     $layout = Tienda::getClass('TiendaHelperCategory', 'helpers.category')->getLayout($cat->category_id);
     $view->setLayout($layout);
     $view->display();
     $this->footer();
     return;
 }
Exemple #12
0
				<td style="text-align: center; width: 33%;"><h3><?php 
    echo TiendaSelect::range(@$state->stats_interval, 'stats_interval', $attribs);
    ?>
</h3></td>
				<?php 
} else {
    ?>
				<td style="text-align: center; width: 33%;"><h3><?php 
    echo TiendaSelect::range(@$state->stats_interval, 'stats_interval', $attribs, null, true);
    ?>
</h3></td>
				<?php 
}
?>
				<td style="text-align: center; width: 33%;"><h3><?php 
echo TiendaHelperBase::currency(@$this->sum);
?>
</h3></td>
				<td style="text-align: center; width: 33%;"><h3><?php 
echo TiendaHelperBase::number(@$this->total, array('num_decimals' => '0'));
?>
</h3></td>
			</tr>
			</tbody>
			</table>

            <div class="section">
                <?php 
$chart = new HighRoller();
$chart->chart->renderTo = 'chart';
$chart->chart->type = 'mixed';
Exemple #13
0
    ?>
                    </div>
                </td>
				<td style="text-align: center;">
                    <?php 
    echo $item->product_model;
    ?>
                </td>
                <td style="text-align: center;">
                    <?php 
    echo $item->product_sku;
    ?>
                </td>
                <td style="text-align: right;">
                   <?php 
    echo TiendaHelperBase::currency($item->total_value);
    ?>
                </td>
                <td style="text-align: center;">
                   <?php 
    echo $item->product_quantity;
    ?>
                </td>
            </tr>
            <?php 
    ++$i;
    $k = 1 - $k;
    ?>
            <?php 
}
?>
Exemple #14
0
$document->addStyleSheet(JURI::root(true) . '/modules/mod_tienda_cart/tmpl/tienda_cart.css');
$html = $ajax ? '' : '<div id="tiendaUserShoppingCart">';
$html .= '<span class="CartItems">';
if ($num > 0) {
    $qty = 0;
    foreach ($items as $item) {
        $qty = $qty + $item->orderitem_quantity;
    }
    $html .= '<span class="qty">' . $qty . '</span> ';
    $html .= $qty == 1 ? JText::_('COM_TIENDA_ITEM') : JText::_('COM_TIENDA_ITEMS');
} elseif ($display_null == '1') {
    $text = JText::_($null_text);
    $html .= $text;
}
$html .= '</span>';
$html .= '<span class="CartTotal">' . JText::_('COM_TIENDA_TOTAL') . ':<span>' . TiendaHelperBase::currency($orderTable->order_total) . '</span> ' . '</span> ';
$html .= '<span class="CartView">';
if ($params->get('display_lightbox') == '1') {
    $lightbox_attribs = array();
    $lightbox['update'] = false;
    if ($lightbox_width = Tienda::getInstance()->get('lightbox_width')) {
        $lightbox_attribs['width'] = $lightbox_width;
    }
    $html .= TiendaUrl::popup("index.php?option=com_tienda&view=carts&task=confirmAdd&tmpl=component", JText::_('COM_TIENDA_VIEW_YOUR_CART'), $lightbox_attribs);
} else {
    $html .= '<a id="cartLink" href="' . JRoute::_("index.php?option=com_tienda&view=carts") . '">' . JText::_('COM_TIENDA_VIEW_YOUR_CART') . '</a>';
}
$html .= '</span>';
$html .= '<span class="CartCheckout">' . '<a id="checkoutLink" href="' . JRoute::_("index.php?option=com_tienda&view=checkout") . '">' . JText::_('COM_TIENDA_CHECKOUT') . '</a>' . '</span>';
$html .= '<div class="reset"></div>';
if ($ajax) {
Exemple #15
0
    ?>
				</a>	
			</td>
			<td style="text-align: center;">
				<?php 
    echo empty($item->volume) ? 0 : $item->number_of_orders;
    ?>
			</td>
			<td style="text-align: center;">
				<?php 
    echo empty($item->volume) ? 0 : $item->volume;
    ?>
			</td>
			<td style="text-align: right;">
				<?php 
    echo TiendaHelperBase::currency($item->spent);
    ?>
			</td>

		</tr>
		<?php 
    ++$i;
    $k = 1 - $k;
    ?>
		<?php 
}
?>

		<?php 
if (!count(@$items)) {
    ?>
Exemple #16
0
 function getFilters()
 {
     $filters = array();
     if (!empty($this->_filter_category) && !empty($this->category_current)) {
         $catObj = new stdClass();
         $catObj->label = JText::_('COM_TIENDA_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_TIENDA_PRICE');
         $priceObj->value = TiendaHelperBase::currency($this->_filter_price_from) . ' - ' . TiendaHelperBase::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(), 'tienda_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_TIENDA_RATING');
         $ratingObj->value = TiendaHelperProduct::getRatingImage((double) $this->_filter_rating) . ' ' . JText::_('COM_TIENDA_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_TIENDA_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_TIENDA_MANUFACTURER');
             $brandObj->value = $this->brands[$this->_filter_manufacturer];
             $brandObj->link = $this->_link . '&filter_category=' . $this->_filter_category . '&filter_manufacturer=';
             $filters[] = $brandObj;
         }
     }
     return $filters;
 }
Exemple #17
0
    echo $key;
    ?>

                </td>

                <td style="text-align: center;">
                    <?php 
    echo $item->num;
    ?>
                </td>
                <td style="text-align: center;">
                    <?php 
    //echo $item->order_total;
    ?>
					<?php 
    echo TiendaHelperBase::currency($item->amount, '', $options);
    ?>
                </td>
				<td>
				</td>
 
            </tr>
            <?php 
    ++$i;
    $k = 1 - $k;
    ?>
            <?php 
}
?>

            <?php 
Exemple #18
0
    ?>
					<span style="float: right;">
						[<?php 
    echo TiendaUrl::popup("index.php?option=com_tienda&view=shipping&task=view&id={$id}&shippingTask=setRates&tmpl=component&sid={$item->shipping_method_weightbased_id}", JText::_('Set Rates'));
    ?>
]
					</span>
				</td>
				<td style="text-align: center;">
					<?php 
    echo TiendaHelperBase::currency($item->shipping_method_price_start);
    ?>
				</td>
				<td style="text-align: center;">
					<?php 
    echo (double) $item->shipping_method_price_end ? TiendaHelperBase::currency($item->shipping_method_price_end) : JText::_('Infinity');
    ?>
				</td>
				<td style="text-align: center;"><?php 
    echo $item->tax_class_name;
    ?>
				</td>
				<td style="text-align: center;"><?php 
    echo TiendaGrid::boolean($item->shipping_method_weightbased_enabled);
    ?>
				</td>
			</tr>
			<?php 
    $i = $i + 1;
    $k = 1 - $k;
    ?>
Exemple #19
0
    echo TiendaHelperBase::currency($row->order_credit, $row->currency);
    ?>
            </th>
        </tr>
        <?php 
}
?>
        <tr>
            <th colspan="2" style="font-size: 120%; text-align: right;">
            <?php 
echo JText::_('COM_TIENDA_TOTAL');
?>
            </th>
            <th style="font-size: 120%; text-align: right;">
            <?php 
echo TiendaHelperBase::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('onAfterDisplayOrderPrintOrderItems', array($row));
?>
    
    <?php 
// fire plugin event here to enable extending the form
Exemple #20
0
    Tienda::load('TiendaHelperShipping', 'helpers.shipping');
    $id = JRequest::getInt('id', '0');
    ?>
                        <span style="float: right;">[<?php 
    echo TiendaUrl::popup("index.php?option=com_tienda&view=shipping&task=view&id={$id}&shippingTask=setRates&tmpl=component&sid={$item->shipping_method_id}", JText::_('Set Rates'));
    ?>
]</span>
                        <?php 
    if ($shipping_method_type = TiendaHelperShipping::getType($item->shipping_method_type)) {
        echo "<b>" . JText::_('COM_TIENDA_TYPE') . "</b>: " . $shipping_method_type->title;
    }
    if ($item->subtotal_minimum > '0') {
        echo "<br/><b>" . JText::_('COM_TIENDA_MINIMUM_ORDER_REQUIRED') . "</b>: " . TiendaHelperBase::currency($item->subtotal_minimum);
    }
    if ($item->subtotal_maximum > '-1') {
        echo "<br/><b>" . JText::_('COM_TIENDA_SHIPPING_METHODS_SUBTOTAL_MAX') . "</b>: " . TiendaHelperBase::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 TiendaGrid::boolean($item->shipping_method_enabled);
    ?>
				</td>
			</tr>
Exemple #21
0
        ?>
</b>: <?php 
        echo $item->orderitem_sku;
        ?>
                    <?php 
    }
    ?>
				</td>
                <td style="text-align: center;">
                    <?php 
    echo $item->orderitem_quantity;
    ?>
                </td>
				<td style="text-align: center;">
				    <?php 
    echo TiendaHelperBase::currency($item->orderitem_price);
    ?>
				</td>
				<td style="text-align: center;">
					<?php 
    echo $item->orderitem_status;
    ?>
				</td>
				<td style="text-align: center;">
					<?php 
    echo $item->transaction_status;
    ?>
				</td>
			</tr>
			<?php 
    $i = $i + 1;
Exemple #22
0
 /**
  * Get the price range based on the Highest and lowest prices   
  * @return array
  */
 function getPriceRange()
 {
     // Check the registry to see if our Tienda class has been overridden
     if (!class_exists('Tienda')) {
         JLoader::register("Tienda", JPATH_ADMINISTRATOR . "/components/com_tienda/defines.php");
     }
     // load the config class
     Tienda::load('Tienda', 'defines');
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/tables');
     JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/models');
     $ranges = array();
     $link = '';
     // get the model
     $model = JModel::getInstance('Products', 'TiendaModel');
     $app = JFactory::getApplication();
     $ns = $app->getName() . '::' . 'com.tienda.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_TIENDA_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
     Tienda::load('TiendaHelperBase', 'helpers._base');
     $ranges[$link . '&filter_price_from=' . $roundPriceLow . '&filter_price_to=' . $roundRange] = TiendaHelperBase::currency($roundPriceLow) . ' - ' . TiendaHelperBase::currency($roundRange);
     $ranges[$link . '&filter_price_from=' . $roundRange . '&filter_price_to=' . $roundRange * 2] = TiendaHelperBase::currency($roundRange) . ' - ' . TiendaHelperBase::currency($roundRange * 2);
     $ranges[$link . '&filter_price_from=' . $roundRange * 2 . '&filter_price_to=' . $roundRange * 3] = TiendaHelperBase::currency($roundRange * 2) . ' - ' . TiendaHelperBase::currency($roundRange * 3);
     $ranges[$link . '&filter_price_from=' . $roundRange * 3 . '&filter_price_to=' . $upperPrice] = TiendaHelperBase::currency($roundRange * 3) . ' - ' . TiendaHelperBase::currency($upperPrice);
     $ranges[$link . '&filter_price_from=' . $upperPrice] = JText::_('COM_TIENDA_MORE_THAN_') . TiendaHelperBase::currency($upperPrice);
     return $ranges;
 }
Exemple #23
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, Tienda::getInstance()->get('date_format'));
    ?>
				</td>
				<td style="text-align: left;">
                    <?php 
    echo "<b>" . JText::_('COM_TIENDA_ORDER_ID') . "</b>: " . $item->order_id . "<br>";
    echo "<b>" . JText::_('COM_TIENDA_ORDER_AMOUNT') . "</b>: " . TiendaHelperBase::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_TIENDA_SHIP_TO');
    ?>
</b>:
                    <?php 
Exemple #24
0
/**
 * @version		1.0
 * @package		K2 Tienda plugin
 * @author    	JoomlaWorks http://www.joomlaworks.gr
 * @copyright	Copyright (c) 2006 - 2010 JoomlaWorks Ltd. All rights reserved.
 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<div class="product_buy">
	<div>
		<form action="" method="post" class="adminform" name="adminForm" enctype="multipart/form-data">

			<!--base price-->
			<span class="product_price"><?php 
echo TiendaHelperBase::currency($product->price);
?>
</span>

			<!--attribute options-->
			<div id='product_attributeoptions'>
			<?php 
$attributes = TiendaHelperProduct::getAttributes($product->product_id);
foreach ($attributes as $attribute) {
    ?>
				<div class="pao" id='productattributeoption_<?php 
    echo $attribute->productattribute_id;
    ?>
'>
					<?php 
    echo TiendaSelect::productattributeoptions($attribute->productattribute_id, '', 'attribute_' . $attribute->productattribute_id);
Exemple #25
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_TIENDA_ORDER_NUMBER') . "</b>: " . $item->order_number;
    }
    ?>
				</td>
                <td style="text-align: center;">
					<?php 
    echo TiendaHelperBase::currency($item->order_total, $item->currency);
    ?>
                    <?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);
        ?>
Exemple #26
0
        echo $rate['tax'];
        ?>
,<?php 
        echo $rate['extra'];
        ?>
, '<?php 
        echo $rate['code'];
        ?>
');" <?php 
        echo $checked;
        ?>
 /> <?php 
        echo $rate['name'];
        ?>
 ( <?php 
        echo TiendaHelperBase::currency($rate['total']);
        ?>
 )<br />
            <br/>
            <?php 
    }
} else {
    ?>
        <div class="note">
        <?php 
    echo JText::_('COM_TIENDA_NO_SHIPPING_NOTE');
    ?>
        </div>
        <?php 
}
$setval = false;
Exemple #27
0
				<?php 
            if ($show_addtocart) {
                ?>
					<div id="product_buy_<?php 
                echo $item->product_id;
                ?>
" class="product_buy">
						<?php 
                echo TiendaHelperProduct::getCartButton($item->product_id, 'product_buy', array());
                ?>
					</div>					
				<?php 
            } else {
                ?>
				<?php 
                echo TiendaHelperBase::currency($item->product_price);
                ?>
	
				<?php 
            }
            ?>
					
				</td>
					<?php 
        }
        ?>
		
			</tr>
			<?php 
    }
    ?>
Exemple #28
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_TIENDA_STORE_CREDIT');
    ?>
</label>
                <div class="help-block"><?php 
    echo sprintf(JText::_('COM_TIENDA_YOU_HAVE_STORE_CREDIT'), TiendaHelperBase::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_TIENDA_APPLY_CREDIT_TO_ORDER");
    ?>
</button>
                </div>                
                
            </div>
            <div id='opc-credits'></div>
        </fieldset>
			
    <?php 
Exemple #29
0
    ?>
                <tr>
                	<td colspan="3" style="font-weight: bold; white-space: nowrap;">
                        <?php 
    echo JText::_('COM_TIENDA_STORE_CREDIT');
    ?>
                    </td>
                    <td colspan="3" style="text-align: right;">
                       - <?php 
    echo TiendaHelperBase::currency($order->order_credit);
    ?>
                    </td>
                </tr> 
                <?php 
}
?>
                <tr>
                	<td colspan="3" style="font-weight: bold; white-space: nowrap;">
                        <?php 
echo JText::_('COM_TIENDA_TOTAL');
?>
                    </td>
                    <td colspan="3" style="text-align: right;">
                        <?php 
echo TiendaHelperBase::currency($order->order_total);
?>
                    </td>
                </tr>                
        </table>        
</div>
Exemple #30
0
 public function setShippingMethod()
 {
     $this->setFormat();
     $session = JFactory::getSession();
     $response = $this->getResponseObject();
     $post = JRequest::get('post');
     $errorMessage = '';
     if (empty($post['shipping_plugin'])) {
         $errorMessage = '<ul class="text-error">';
         $errorMessage .= "<li>" . JText::_("COM_TIENDA_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('tienda.opc.shippingRates'));
     $currency = Tienda::getInstance()->get('default_currencyid', 1);
     $rate = !empty($shippingRates[$key]) ? $shippingRates[$key] : null;
     $summary = $rate ? $rate['name'] . " (" . TiendaHelperBase::currency($rate['total'], $currency) . ")" : null;
     $requireShipping = unserialize($session->get('tienda.opc.requireShipping'));
     if ($requireShipping && empty($rate)) {
         $response->goto_section = 'shipping-method';
         $response->summary->id = 'opc-shipping-method-validation';
         $response->summary->html = JText::_("COM_TIENDA_INVALID_SHIPPING_RATE");
     } else {
         $response->goto_section = 'payment';
         $response->summary->html = $summary;
         $session->set('tienda.opc.shippingMethod', serialize($rate));
     }
     echo json_encode($response);
 }