Results 1 to 5 of 5
  1. #1

    Default Get products from one current manufacturer

    Hi is there a way to show all products from one manufacturer, and that manufaturer is manufacturer of the curently watched produt?

    something simmilar to the sugestion here http://www.zen-cart.com/showthread.php?120738-Current-Category-Product-List-Sidebox

    but for manufacturers not for categories?

    Many regards to all.
    Why i love perfumes from parfumite.info is because they smell nice. Why I use zen-cart is because it is the most advanced free and codder friendly system i know that cat make bg-parfum.info rank well in google.

  2. #2
    Join Date
    Jul 2012
    Posts
    3,315
    Plugin Contributions
    5

    Default Re: Get products from one current manufacturer

    Quote Originally Posted by perfumbg View Post
    Hi is there a way to show all products from one manufacturer, and that manufaturer is manufacturer of the curently watched produt?

    something simmilar to the sugestion here http://www.zen-cart.com/showthread.php?120738-Current-Category-Product-List-Sidebox

    but for manufacturers not for categories?

    Many regards to all.
    I haven't tried it, but I would say that the following should work... I made it based on what I think it should look like to work... There may be some extra information being returned by the select query..

    in includes/modules/sideboxes create manlist.php(short for manufacturerlist) and include this code:

    PHP Code:
    <?php      require($template->get_template_dir('tpl_manlist.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes') . '/tpl_manlist.php');      $title '';     $title_link false;      require($template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);      ?>
    And then:
    Then in includes/templates/YOUR_TEMPLATE/sideboxes create tpl_manlist.php and add this:

    PHP Code:
     <?php 
    /** 
     * Product Listing Sidebox by Current Manufacturer
     * 
     */ 

      
    $content ''
      
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">'
         
        
    $prolist_query "select  

                products.products_image, products_description.products_name, products_to_categories.*, categories_description.categories_id, categories_description.categories_name, 
                categories.categories_image, categories.categories_id, manufacturers.*, manufacturers_info.manufacturers_url 
                 
                from products, products_description, products_to_categories, categories_description, categories,  manufacturers, manufacturers_info 
                 
                where products.manufacturers_id = '
    $manufacturers_id
                and products.products_id = products_to_categories.products_id 
                and products_description.products_id = products_to_categories.products_id 
                and products.manufacturers_id = manufacturers.manufacturers_id
                and manufacturers.manufacturers_id = manufacturers_info.manufacturers_id
                and products.products_id = products_description.products_id 
                 
                order by products_description.products_name 
                "

         
            
    $prolist $db->Execute($prolist_query); 
             
        if (!
    $prolist->fields['manufacturers_image'] == null){ 
            
    $content .= '<div class="manimage">' zen_image(DIR_WS_IMAGES $prolist->fields['manufacturers_image'], '<h2>' $prolist->fields['manufacturers_name'] . '</h2>''class="listingManProductImage"') . '</div>'
        }else{ 
            
    $content .= '<h2>' $prolist->fields['manufacturers_name'] . '</h2>'
        } 
         
         while (!
    $prolist->EOF) { 
           
    $content .=  '<a href="' zen_href_link(zen_get_info_page($prolist->fields['products_id']), ($_GET['cPath'] > 'cPath=' $_GET['cPath'] . '&' '') . 'products_id=' $prolist->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $prolist->fields['products_image'], $prolist->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a>'
           
    $prolist->MoveNext(); 
       }; 
         
      
    $content .= '</div>'
         
         
    ?>
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3

    Default Re: Get products from one current manufacturer

    Thanks a lot I will try it :)
    Why i love perfumes from parfumite.info is because they smell nice. Why I use zen-cart is because it is the most advanced free and codder friendly system i know that cat make bg-parfum.info rank well in google.

  4. #4

    Default Re: Get products from one current manufacturer

    It does the job but returns every product 30 or 40 times, and shows only when you are on manufacturers page, not on products_info...

    I will try to modify it a bit but, i dont understand very well msql.

    Thanks a lot.
    Why i love perfumes from parfumite.info is because they smell nice. Why I use zen-cart is because it is the most advanced free and codder friendly system i know that cat make bg-parfum.info rank well in google.

  5. #5

    Default Re: Get products from one current manufacturer

    Hi again i tried a litle harder and here is a working sollution if somebody needs it

    PHP Code:
    $prolist_query "select 

                products.products_image, products_description.products_name, products_to_categories.*, categories_description.categories_id
                
                from products, products_description, products_to_categories, categories_description
                
                where products.manufacturers_id = '" 
    zen_get_products_manufacturers_id((int)$_GET['products_id']) . "'
                and categories_description.categories_id = '
    $current_category_id'
                and products.products_status = 1
                and categories_description.categories_id = products_to_categories.categories_id
                and products_description.products_id = products_to_categories.products_id
                and products.products_id = products_description.products_id
                
                order by products_description.products_name
                LIMIT 4
                "

    If you lant more than 4 products you can change the LIMIT at the bottom to the desired number of products.
    Why i love perfumes from parfumite.info is because they smell nice. Why I use zen-cart is because it is the most advanced free and codder friendly system i know that cat make bg-parfum.info rank well in google.

 

 

Similar Threads

  1. v138a get manufacturer id from product
    By perfumbg in forum General Questions
    Replies: 3
    Last Post: 21 Nov 2014, 06:37 AM
  2. how do mass delete all products from one manufacturer?
    By alibaba99 in forum Setting Up Categories, Products, Attributes
    Replies: 18
    Last Post: 17 Feb 2013, 09:36 AM
  3. v150 Transfer current store from one domain to another?
    By gatorbows in forum General Questions
    Replies: 4
    Last Post: 18 Feb 2012, 07:34 AM
  4. Listing on index only the products from one manufacturer?
    By adrian_hs in forum Customization from the Admin
    Replies: 0
    Last Post: 8 May 2009, 09:17 AM
  5. copy attributes from a products to all products from a certain manufacturer?
    By dedj in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 5 Sep 2007, 03:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •