Advertisement
Guest User

Untitled

a guest
Mar 10th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.22 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. defined ('_JEXEC') or die('Restricted access');
  5. JHTML::_ ('behavior.modal');
  6.  
  7. include('productsviewarray.php');
  8.  
  9. $js = "
  10. jQuery(document).ready(function () {
  11.     jQuery('.orderlistcontainer').hover(
  12.         function() { jQuery(this).find('.orderlist').stop().show()},
  13.         function() { jQuery(this).find('.orderlist').stop().hide()}
  14.     )
  15. });
  16. ";
  17.  
  18. $app = JFactory::getApplication();
  19. $document = JFactory::getDocument ();
  20. $document->addScriptDeclaration ($js);
  21.  
  22. $getTemplateName  = $app->getTemplate('template')->template;
  23.  
  24. if (empty($this->keyword) and !empty($this->category)) {
  25.     ?>
  26. <div class="category_description">
  27.     <?php echo $this->category->category_description; ?>
  28. </div>
  29. <?php
  30. }
  31.  
  32. /* Show child categories */
  33.  
  34. if (VmConfig::get ('showCategory', 1) and empty($this->keyword)) {
  35.     if (!empty($this->category->haschildren)) {
  36.  
  37.         // Category and Columns Counter
  38.         $iCol = 1;
  39.         $iCategory = 1;
  40.  
  41.         // Calculating Categories Per Row
  42.         $categories_per_row = VmConfig::get ('categories_per_row', 3);
  43.         //$category_cellwidth = ' width' . floor (100 / $categories_per_row);
  44.  
  45.         if ($categories_per_row == 4) { $category_cellwidth = 'span3'; }
  46.         elseif ($categories_per_row == 3) { $category_cellwidth = 'span4'; }
  47.         elseif ($categories_per_row == 2) { $category_cellwidth = 'span6'; }
  48.         elseif ($categories_per_row == 1) { $category_cellwidth = 'span12'; }
  49.        
  50.         // Separator
  51.         $verticalseparator = " vertical-separator";
  52.         ?>
  53.  
  54.         <div class="category-view">
  55.  
  56.         <?php // Start the Output
  57.         if (!empty($this->category->children)) {
  58.             foreach ($this->category->children as $category) {
  59.  
  60.                 // Show the horizontal seperator
  61.                 if ($iCol == 1 && $iCategory > $categories_per_row) {
  62.                     ?>
  63.                     <div class="horizontal-separator"></div>
  64.                     <?php
  65.                 }
  66.  
  67.                 // this is an indicator wether a row needs to be opened or not
  68.                 if ($iCol == 1) {
  69.                     ?>
  70.             <div class="row-fluid">
  71.             <?php
  72.                 }
  73.  
  74.                 // Show the vertical seperator
  75.                 if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
  76.                     $show_vertical_separator = ' ';
  77.                 } else {
  78.                     $show_vertical_separator = $verticalseparator;
  79.                 }
  80.  
  81.                 // Category Link
  82.                 $caturl = JRoute::_ ('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id);
  83.  
  84.                 // Show Category
  85.                 ?>
  86.                 <div class="category floatleft <?php echo $category_cellwidth . $show_vertical_separator ?>">
  87.                     <div class="spacer">
  88.                         <h2 class="category-view-title">
  89.                             <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
  90.                            
  91.                            
  92.                                 <?php // if ($category->ids) {
  93.                                 echo $category->images[0]->displayMediaThumb ("", FALSE);
  94.                                 //} ?>
  95.                                
  96.                             <br />
  97.                             <span class="cat-title"><?php echo $category->category_name ?></span>
  98.                                
  99.                             </a>
  100.                         </h2>
  101.                     </div>
  102.                 </div>
  103.                 <?php
  104.                 $iCategory++;
  105.  
  106.                 // Do we need to close the current row now?
  107.                 if ($iCol == $categories_per_row) {
  108.                     ?>
  109.                     <div class="clear"></div>
  110.         </div>
  111.             <?php
  112.                     $iCol = 1;
  113.                 } else {
  114.                     $iCol++;
  115.                 }
  116.             }
  117.         }
  118.         // Do we need a final closing row tag?
  119.         if ($iCol != 1) {
  120.             ?>
  121.             <div class="clear"></div>
  122.         </div>
  123.     <?php } ?>
  124.     </div>
  125.  
  126.     <?php
  127.     }
  128. }
  129. ?>
  130. <div class="browse-view">
  131. <?php
  132.  
  133. if (!empty($this->keyword)) {
  134.     ?>
  135. <h3><?php echo $this->keyword; ?></h3>
  136.     <?php
  137. } ?>
  138. <?php if (!empty($this->keyword)) {
  139.  
  140.     $category_id  = vRequest::getInt ('virtuemart_category_id', 0); ?>
  141. <form action="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=category&limitstart=0', FALSE); ?>" method="get">
  142.  
  143.     <!--BEGIN Search Box -->
  144.     <div class="virtuemart_search">
  145.         <?php echo $this->searchcustom ?>
  146.         <br/>
  147.         <?php echo $this->searchCustomValues ?>
  148.         <input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>"/>
  149.         <input type="submit" value="<?php echo vmText::_ ('COM_VIRTUEMART_SEARCH') ?>" class="button" onclick="this.form.keyword.focus();"/>
  150.     </div>
  151.     <input type="hidden" name="search" value="true"/>
  152.     <input type="hidden" name="view" value="category"/>
  153.     <input type="hidden" name="option" value="com_virtuemart"/>
  154.     <input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/>
  155.  
  156. </form>
  157. <!-- End Search Box -->
  158.     <?php } ?>
  159.  
  160. <?php // Show child categories
  161. if (!empty($this->products)) {
  162.     ?>
  163. <div class="orderby-displaynumber row-fluid">
  164.     <div class="span7 floatleft">
  165.         <?php echo $this->orderByList['orderby']; ?>
  166.         <?php echo $this->orderByList['manufacturer']; ?>
  167.  
  168.         <ul class="view-as">
  169.         <?php
  170.         while(list($key, $val) = each($styleSheets)){
  171.             echo "<li class='".$val["class"]."'><a href='".JURI::base(true)."/templates/". $getTemplateName ."/productsview.php?SETSTYLE=".$key."' title='".$val["title"]."'>".$val["text"]."</a></li>";
  172.         }
  173.         ?>
  174.         </ul>
  175.     </div>
  176.    
  177.     <div class="span5 floatright display-number"><span class="display-results-no"><?php echo $this->vmPagination->getResultsCounter ();?></span><?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>
  178.     <div class="vm-pagination">
  179.         <?php echo $this->vmPagination->getPagesLinks (); ?>
  180.         <span style="float:right"><?php echo $this->vmPagination->getPagesCounter (); ?></span>
  181.     </div>
  182.  
  183.     <div class="clear"></div>
  184. </div> <!-- end of orderby-displaynumber -->
  185.  
  186. <h1><?php echo $this->category->category_name; ?></h1>
  187.  
  188.     <?php
  189.     // Category and Columns Counter
  190.     $iBrowseCol = 1;
  191.     $iBrowseProduct = 1;
  192.  
  193.     // Calculating Products Per Row
  194.     $BrowseProducts_per_row = $this->perRow;
  195.     //$Browsecellwidth = ' width' . floor (100 / $BrowseProducts_per_row);
  196.    
  197.         if ($BrowseProducts_per_row == 4) { $Browsecellwidth = 'span3'; }
  198.         elseif ($BrowseProducts_per_row == 3) { $Browsecellwidth = 'span4'; }
  199.         elseif ($BrowseProducts_per_row == 2) { $Browsecellwidth = 'span6'; }
  200.         elseif ($BrowseProducts_per_row == 1) { $Browsecellwidth = 'span12'; }
  201.  
  202.     // Separator
  203.     $verticalseparator = " vertical-separator";
  204.  
  205.     $BrowseTotalProducts = count($this->products);
  206.  
  207.     // Start the Output
  208.     foreach ($this->products as $product) {
  209.  
  210.         // Show the horizontal seperator
  211.         if ($iBrowseCol == 1 && $iBrowseProduct > $BrowseProducts_per_row) {
  212.             ?>
  213.         <div class="horizontal-separator"></div>
  214.             <?php
  215.         }
  216.  
  217.         // this is an indicator wether a row needs to be opened or not
  218.         if ($iBrowseCol == 1) {
  219.             ?>
  220.     <div class="row-fluid">
  221.     <?php
  222.         }
  223.  
  224.         // Show the vertical seperator
  225.         if ($iBrowseProduct == $BrowseProducts_per_row or $iBrowseProduct % $BrowseProducts_per_row == 0) {
  226.             $show_vertical_separator = ' ';
  227.         } else {
  228.             $show_vertical_separator = $verticalseparator;
  229.         }
  230.  
  231.         // Show Products
  232.         ?>
  233.         <div class="product floatleft <?php echo $Browsecellwidth . $show_vertical_separator ?>">
  234.             <div class="spacer">
  235.                 <div class="spacer-handler pr-img-handler">
  236.                
  237.                     <a href="<?php echo $product->link;?>">
  238.                     <?php
  239.                         echo $product->images[0]->displayMediaThumb ('class="browseProductImage" border="0" title="' . $product->product_name . '" ', FALSE, 'class="modal"');
  240.                     ?>
  241.                     </a>
  242.                    
  243.                             <div class="popout-price">
  244.                                 <div class="popout-price-buttons-handler">
  245.                                     <?php
  246.                                     if ($product->images) {
  247.                                         echo '<div class="show-pop-up-image">'.$product->images[0]->displayMediaThumb( 'class="featuredProductImage"',true,'class="modal"' ).'</div>';
  248.                                     }
  249.                                     echo JHTML::link ( JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id ), vmText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name, 'class' => 'product-details' ) );               
  250.                                     ?>
  251.                                 </div>
  252.                             </div>
  253.                    
  254.                 </div>
  255.  
  256.                 <h2 class="h-pr-title"><?php echo JHTML::link ($product->link, $product->product_name); ?></h2>
  257.                
  258.                 <?php // Product Short Description
  259.                 if (!empty($product->product_s_desc)) {
  260.                     ?>
  261.                     <p class="product_s_desc">
  262.                         <?php echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 120, '...') ?>
  263.                     </p>
  264.                     <?php } ?>
  265.                    
  266.                     <div class="h-pr-details">
  267.                         <div class="action-handler">
  268.                             <div class="product-price-1 marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
  269.                             <?php
  270.                             if ($this->show_prices == '1') {
  271.                                 if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
  272.                                     echo vmText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
  273.                                 }
  274.                                 //todo add config settings
  275.                                 if ($this->showBasePrice) {
  276.                                     echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
  277.                                     echo $this->currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $product->prices);
  278.                                 }
  279.                                 echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
  280.                                 if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
  281.                                     echo '<div class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</div>";
  282.                                 }
  283.                                 if (round($product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
  284.                                     echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
  285.                                 }
  286.                                 echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
  287.                                 if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
  288.                                     echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
  289.                                 } else {
  290.                                     echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
  291.                                 }
  292.                                 echo $this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
  293.                                 echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
  294.                                 $unitPriceDescription = vmText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit);
  295.                                 echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $product->prices);
  296.                             } ?>
  297.  
  298.                             </div>
  299.                            
  300.  
  301.                            
  302.                         <?php
  303.                             if ( VmConfig::get ('display_stock', 1)) { ?>
  304.                             <!--                        if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')){?> -->
  305.                             <div class="paddingtop8">
  306.                                 <span class="stock-level"><?php echo vmText::_ ('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>
  307.                                 <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
  308.                             </div>
  309.                             <?php } ?>
  310.  
  311.                             <div class="vm3pr">
  312.                                 <?php echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product, 'position' => array('ontop', 'addtocart'))); ?>
  313.                             </div>
  314.                        
  315.                         </div>
  316.                     </div>
  317.  
  318.  
  319.             </div>
  320.             <!-- end of spacer -->
  321.         </div> <!-- end of product -->
  322.         <?php
  323.  
  324.         // Do we need to close the current row now?
  325.         if ($iBrowseCol == $BrowseProducts_per_row || $iBrowseProduct == $BrowseTotalProducts) {
  326.             ?>
  327.             <div class="clear"></div>
  328.    </div> <!-- end of row -->
  329.             <?php
  330.             $iBrowseCol = 1;
  331.         } else {
  332.             $iBrowseCol++;
  333.         }
  334.  
  335.         $iBrowseProduct++;
  336.     } // end of foreach ( $this->products as $product )
  337.     // Do we need a final closing row tag?
  338.     if ($iBrowseCol != 1) {
  339.         ?>
  340.     <div class="clear"></div>
  341.  
  342.         <?php
  343.     }
  344.     ?>
  345.  
  346. <div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks (); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter (); ?></span></div>
  347.  
  348.     <?php
  349. } elseif ($this->search !== NULL) {
  350.     echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : '');
  351. }
  352. ?>
  353. </div><!-- end browse-view -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement