Author Topic: CSS Classes for Category Lists and Related Products  (Read 6750 times)

_fD_

  • Jr. Member
  • **
  • Posts: 118
    • Printdesign :: Joomla! CMS Webdesign :: Apple Computer Support
CSS Classes for Category Lists and Related Products
« on: May 07, 2006, 23:08:59 pm »
Problem:

          o Without CSS no menu styling.
          o Solution:
            Add the classes following:

            Category list
            File: «/administrator/components/com_virtuemart/classes/ps_product_category.php»
            There take the categories.
            Line: ab 852 (the category table with or without pictures)

            function get_child_list($category_id) {
               global $sess, $ps_product, $VM_LANG;
               $ps_vendor_id = $_SESSION["ps_vendor_id"];
               $db = new ps_DB;

               $html = "";

               $q = "SELECT category_id, ** SNIP**
               $q .= "WHERE #__{vm}_cate ** SNIP**
               $q .= "AND #__{vm}_catego ** SNIP**
               $q .= "AND #__{vm}_catego ** SNIP**
               $q .= "AND #__{vm}_catego ** SNIP**
               $q .= "ORDER BY #__{vm}_c ** SNIP**
               $db->setQuery($q);
               $db->query();

               if( $db->num_rows() > 0 ) {
                  $iCol = 1;
                  $categories_per_row = 3; <- Nur 3 Kategorien (Platz)
                  $cellwidth = intval( 100 / $categories_per_row );
                  $html .= '<h4 class="shop_cattitle">'; <- Klasse für Titel
                  $html .= $VM_LANG->_PHPSHOP_MORE_CATEGORIES.'</h4>';
                  $html .= '<table width="100%" cellspacing="4"
                  cellpadding="0" class="category_tab">'; <- Tabellenklasse
                     
                  while($db->next_record()) {
                     if ($iCol == 1) {
                        $html.= "<tr>\n";
                     }
                     $html.= '<td align="center" valign="top" width= ** SNIP **
                     <a title=" ** SNIP ** id")) .'" class="category_link">';
                     ^-Linkklasse
             

                     if ( $db->f("category_thumb_image") ) {
                        $html.= $ps_product->image_tag( ** SNIP **
                        $html.= "<br/>"; <- ein <br/> rausnehmen
                     }
                     $html.= $db->f("category_name");
                     $html.= ps_product_category::products_ ** SNIP **

                     $html.= "</a>\n";
                     $html .= "</td>\n";

                     if ($iCol == $categories_per_row) {
                        $html.= "</tr>\n";
                        $iCol = 1;
                     }
                     else {
                        $iCol++;
                     }
                  }
                  if ($db->num_rows() < $categories_per_row) {
                     $html.= "</tr>\n";
                  }
                  $html.= "</table>";
               }

               return $html;

          o Then the next shop.browse:
            File: «administrator/components/com_virtuemart/html/shop.browse.php»
            Line: 24

            echo '<h3 class="shop_cattitle">'.$VM_LANG->_PHPSHOP_BROWSE_LBL."</h3>\n";

            and File: «administrator/components/com_virtuemart/html/shop.index.php»
            Line:  38-40

            <table width="100%" cellspacing="0" cellpadding="4" class="category_tab"> 
              <tr>
                <td colspan="<?php echo $categories_per_row ?>">
               <h3 class="shop_indextitle"><?php echo $VM_LANG->_PHPSHOP_CATEGORIES ?>
               </h3></td>
              </tr>

            and lines: 53-54

                    <td style="text-align:center;" width="<?php echo $cellwidth ?>%" valign="top">
                      <a title="<?php echo $catname ?>" href="<?php echo $sess->
                  url(URL."index.php?option=com_virtuemart&amp;page=shop.
                  browse&amp;category_id=".$db->f("category_id")); ?>" class="category_link">



            Related Products:
            File: «administrator/components/com_virtuemart/html/shop.product_details.php»
            Lines: 106-107

                $related_product_html .= "<h3 class=\"shop_cattitle\">"
               .$VM_LANG->_PHPSHOP_RELATED_PRODUCTS_HEADING."</h3>\n";
                $related_product_html .= "<table width=\"100%\" align=\"center\" valign=\"top\"
               cellspacing=\"4\" cellpadding=\"5\" class=\"product_tab\"><tr>\n";

Thats it. Hope works ;-).

Bye, Urs