Page 3 of 10 FirstFirst 12345 ... LastLast
Results 21 to 30 of 93
  1. #21
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Best sellers "page"

    PHP Code:

    $limit 
    " LIMIT 50";
    if (
    BEST_SELLERS_SHOW_OUT_OF_STOCK == 'true') {

    $listing_sql "select distinct p.products_quantity, p.products_id, p.products_image, p.products_model, pd.products_name, p.products_ordered
                          from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd
                          where p.products_status = '1'
                          and p.products_ordered > 0
                          and p.products_id = pd.products_id
                          and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                          order by p.products_ordered desc, pd.products_name 
    $limit";
                          
    } else {
                          
    $listing_sql "select distinct p.products_quantity, p.products_id, p.products_image, p.products_model, pd.products_name, p.products_ordered
                          from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd
                          where p.products_status = '1'
                          and p.products_ordered > 0
                          and p.products_id = pd.products_id
                          and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                          and p.products_quantity > 0
                          and p.master_categories_id != 123
                          and p.products_id != 1992
                          order by p.products_ordered desc, pd.products_name 
    $limit";
                          
    }
    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
      
    'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
      
    'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
      
    'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
      
    'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
      
    'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
      
    'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

      
    /*                         ,
      'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
      */
      
    asort($define_list);
      
    reset($define_list);
      
    $column_list = array();
      foreach (
    $define_list as $key => $value)
      {
        if (
    $value 0$column_list[] = $key;
      }
    ?> 
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  2. #22
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: Best sellers "page"

    Thanks for the help, but I receive the same error I was getting before:

    "1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 15' at line 10
    in:
    [select distinct p.products_quantity, p.products_id, p.products_image, p.products_model, pd.products_name, p.products_ordered from products p, products_description pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '1' and p.products_quantity > 0 and p.master_categories_id != 123 and p.products_id != 1992 order by p.products_ordered desc, pd.products_name LIMIT 50 limit 0, 15]"

    The setting I have in the admin for product listing per page is 15. I suppose the product listing page and the best sellers page don't like competing over limits! If its an easy fix, then by all means feel free to let me know, but if its going to be a time-consuming pain, please don't hesitate to ignore me! It's not a huge deal or anything.

  3. #23
    Join Date
    Nov 2007
    Location
    Dallas, Texas USA
    Posts
    183
    Plugin Contributions
    0

    Default Best sellers on Home page (main page)?

    I have a new site with no best seller history. My vendor has a best seller list, which is called from the main db on their site and is the same db that I use. Mine is a dupe of theirs, but on my server.

    Is it possible to create a best sellers Product Listing on the Home page that would have a different layout from the other product pages and would call from the main db?

    I'm not good at databases, so I don't know if I would have to manually add these products and links or just what. Suggestions?

    Ref: http://artbeautiful.com

  4. #24
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Best sellers "page"

    @JackA: Check Best Seller reloaded mod.
    @craftzombie: This mod simply queries all products, sort them by number of purchased.
    To make it light weight, I used the product listing template, so adding a limit into the query seems to break things a bit. It's not that hard to fix, it's rather complex and I want to leave it there for now.

    Hint: you can either:
    1. check the code of ZC featured product listing or all product listing and copy it.
    2. Overwrite includes/modules/product_listing.php
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #25
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: Best sellers "page"

    Quote Originally Posted by yellow1912 View Post
    Hint: you can either:
    1. check the code of ZC featured product listing or all product listing and copy it.
    2. Overwrite includes/modules/product_listing.php
    Since I have no clue how to go about doing what you suggested, I decided to be sneaky and I did this instead:

    1. Made a copy of tpl_modules_product_listing.php and renamed it tpl_modules_product_listing2.php

    2. changed tpl_best_sellers_default.php to show tpl_modules_product_listing2.php

    3. removed productsListingTopNumber and productsListingListingTopLinks from tpl_modules_product_listing2.php and replaced them by manually adding links to
    main_page=best_sellers
    main_page=best_sellers&page=2

    So now I am only showing them 30 of the bestsellers, even though the file is actually bringing up over 1200. Unfortunately, by doing it this way you cannot tell which page you are on unless you look at the web address in the top of your browser. But with only 2 pages, I don't think thats a big deal.

    Its enough to make me shut up about this and move on to something else!

    Thanks for all of your help.

  6. #26

    Default Re: Best sellers "page"

    Hi, thanks for what looks to be a cracking mod. Just what the doctor ordered. But I wonder if anyone who is a bit more technically minded than me can tell me in what file do i need to place the - <?php echo zen_href_link(FILENAME_BEST_SELLERS); ?> - so that the link for the page appears at the bottom of my categories sidebox under the rest of the categories?

    Thanks for any help

    dave
    Last edited by barricades; 26 Jan 2008 at 03:17 PM. Reason: typos

  7. #27
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: Best sellers "page"

    Quote Originally Posted by barricades View Post
    Hi, thanks for what looks to be a cracking mod. Just what the doctor ordered. But I wonder if anyone who is a bit more technically minded than me can tell me in what file do i need to place the - <?php echo zen_href_link(FILENAME_BEST_SELLERS); ?> - so that the link for the page appears at the bottom of my categories sidebox under the rest of the categories?

    Thanks for any help

    dave
    Try this...

    in includes/templates/your_template/sideboxes/tpl_categories.php

    directly underneath

    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '<br />' . "\n";

    add:

    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_BEST_SELLERS) . '">' . Best Sellers . '</a>' . '<br />' . "\n";

    This will probably only work if you have specials set to "true". If you don't, then you can add it underneath one of the other sections like New Products. I tried adding it on its own, but I kept getting a blank page. I don't know enough PHP to figure out how to do it any other way, but this is the way I have it on my page and its working fine.

  8. #28

    Default Re: Best sellers "page"

    Thanks. I've tried that but i get Parse error: parse error, unexpected T_STRING etc...

    The place I put it in is:

    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_BEST_SELLERS) . '">' . Best Sellers . '</a>' . '<br />' . "\n";
    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";

    }

    I just copied and pasted the code you told me to, but I know very little about php. Have i missed something obvious?

    Thanks for replying

  9. #29
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: Best sellers "page"

    Quote Originally Posted by barricades View Post
    Thanks. I've tried that but i get Parse error: parse error, unexpected T_STRING etc...

    The place I put it in is:

    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_BEST_SELLERS) . '">' . Best Sellers . '</a>' . '<br />' . "\n";
    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";

    }

    I just copied and pasted the code you told me to, but I know very little about php. Have i missed something obvious?

    Thanks for replying
    Sorry about that. Its the space between Best and Sellers. Do this instead. The placement you have underneath New products is fine, just change it to this instead:

    Where it says Best Sellers, change it to CATEGORIES_BOX_HEADING_BEST_SELLERS

    so it will look like this:

    $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_BEST_SELLERS) . '">' . CATEGORIES_BOX_HEADING_BEST_SELLERS . '</a>' . '<br />' . "\n";

    Then open up includes/languages/your_template/english
    and add

    define('BOX_HEADING_BEST_SELLERS', 'Best Sellers');
    define('CATEGORIES_BOX_HEADING_BEST_SELLERS', 'Best Sellers');

    preferably near the other ones (New Products, Specials, etc.) just to keep things organized. In my file, those start at around line 87. I think you can put it anywhere though, I'm just being anal.

    (You can do all of this, or you can keep it the way you have it and make Best Sellers into one word and you won't get the error anymore)

  10. #30

    Default Re: Best sellers "page"

    Woo Hoo! Thanks for that CraftZombie. That seems to have done the trick.

    The only thing wrong now (which i suppose isn't that important) is that the images on the bestseller page now kinda cover a wee line I had.

    normally the page displays like this http://www.traditionalirishgifts.com...dex&cPath=2_20

    but on the bestsellers page the images cover the line btw the sideboxes and the main page http://www.traditionalirishgifts.com...e=best_sellers

    Is there an easy way to fix that?

    Thanks for all this

 

 
Page 3 of 10 FirstFirst 12345 ... LastLast

Similar Threads

  1. v139h restoring "Products Ordered" list anr therefore best sellers box
    By freedude in forum General Questions
    Replies: 1
    Last Post: 17 Jun 2012, 06:00 PM
  2. Why "Best Sellers" linked to "Specials" (sales module?)?
    By Cluelessjt in forum Basic Configuration
    Replies: 1
    Last Post: 29 Aug 2010, 02:54 AM
  3. Display "Best Sellers" like "What's New" or "Specials" lists.
    By jsmooth in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Jun 2010, 12:06 AM
  4. "Best sellers" scrolling sidebox thumbnail problem
    By chris32882 in forum Addon Sideboxes
    Replies: 29
    Last Post: 15 Feb 2009, 12:56 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR