Ejemplo n.º 1
0
    public function getProductsForm($catid, $replace)
    {
        $db = JFactory::getDbo();
        $configs = $this->getConfigs();
        $sql = 'SELECT
					`p`.*
				FROM
					`#__digicom_products` AS `p`
				WHERE
					p.access = 1 and p.published = 1 AND
					`p`.`catid`=' . $catid . '
				ORDER BY `p`.`name`';
        //echo $sql;die;
        $db->setQuery($sql);
        $items = $db->loadObjectList();
        $productfields = array();
        if (!count($items)) {
            return false;
        }
        $html = '<ul class="list-unstyled unstyled">';
        foreach ($items as $item) {
            $html .= '<li class="col-md-4 span4">';
            $productid = $item->id;
            $onsubmit = "";
            $html .= '
				<div class="thumbnail">
					<div class="caption">
						<h3>' . JHTML::_('string.truncate', $item->name, 18) . '</h3>
						<p data-toggle="tooltip" title="' . htmlentities($item->description) . '">
							' . JHTML::_('string.truncate', $item->description, 28) . '
						</p>
			';
            $link = JUri::root() . "index.php";
            $html .= "<form id=\"prform" . $item->id . "\" name=\"prform\" method=\"post\" action=\"{$link}\"" . $onsubmit . ">";
            if (isset($replace['align'])) {
                $align = " align='" . $replace['align'] . "' ";
            } else {
                $align = "";
            }
            $html .= "<input name=\"qty\" type=\"hidden\" value=\"1\">";
            $html .= "\r\n\t\t\t\t<input name=\"pid\" type=\"hidden\" id=\"product_id\" value=\"" . $item->id . "\">\r\n\t\t\t\t<input name=\"cid\" type=\"hidden\" value=\"" . $catid . "\">\r\n\t\t\t\t<input type=\"hidden\" name=\"view\" value=\"cart\"/>\r\n\t\t\t\t<input type=\"hidden\" name=\"task\" value=\"cart.add\"/>\r\n\t\t\t\t<input type=\"hidden\" name=\"option\" value=\"com_digicom\"/>\r\n\t\t\t\t<input type=\"hidden\" name=\"from_add_plugin\" value=\"1\"/>\r\n\t\t\t";
            $html .= '
					<button type="submit" role="button" name="Button" class="btn btn-default btn-block">
			';
            if ($item->price) {
                $html .= DigiComSiteHelperDigicom::format_price2($item->price, $configs->get('currency'), true, $configs) . ' | ';
            }
            $html .= '
						' . JText::_("PLG_CONTENT_DIGICOM_ADD_TO_CART_BTN_LBL") . '</button>
					</div>
				</div>
			';
            $html .= "</form>";
            $html .= '</li>';
        }
        $html .= '</ul>';
        return $html;
    }
Ejemplo n.º 2
0
</h3>
						<ul>
							<?php 
    foreach ($this->item->bundleitems as $key => $bitem) {
        $link = JRoute::_(DigiComHelperRoute::getProductRoute($bitem->id, $bitem->catid, $bitem->language));
        ?>
								<li>
									<a href="<?php 
        echo $link;
        ?>
"><?php 
        echo $bitem->name;
        ?>
</a>
									<span class="label"><?php 
        echo DigiComSiteHelperDigicom::format_price2($bitem->price, $conf->get('currency', 'USD'), true, $conf);
        ?>
</span>
								</li>
							<?php 
    }
    ?>
						</ul>
					</div>
					<?php 
}
?>

					<?php 
if ($this->configs->get('catalogue', 0) == '0') {
    ?>
Ejemplo n.º 3
0
		<?php 
}
?>

		<div class="products-list clearfix">
			<div class="row-fluid">
	            <ul class="thumbnails">
	              <?php 
$i = 0;
foreach ($this->items as $key => $item) {
    if (!($i % $column)) {
        echo '</ul></div><div class="row-fluid"><ul class="thumbnails">';
    }
    // echo ( $i == $this->configs->get('category_cols') ) ? '<div class="clearfix"></div>' : '';
    if ($item->price > 0) {
        $price = DigiComSiteHelperDigicom::format_price2($item->price, $this->configs->get('currency', 'USD'), true, $this->configs);
    } else {
        $price = '<span class="label label-success">' . JText::_('COM_DIGICOM_PRODUCT_PRICE_FREE') . '</span>';
    }
    $link = JRoute::_(DigiComHelperRoute::getProductRoute($item->id, $item->catid, $item->language));
    ?>
				  <li class="<?php 
    echo $bsGrid[$column];
    ?>
">
	                <div class="thumbnail">
	                	<!-- Product Image -->
	                  	<?php 
    if (!empty($item->images)) {
        ?>
					  	<a href="<?php