Forums / All Other Contributions/Addons / Best sellers "page"

Best sellers "page"

Views: 20,057

Results 21 to 40 of 93
19 Jan 2008, 10:19 AM
#21
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Best sellers "page"

$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

19 Jan 2008, 11:34 AM
#22
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

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. :smile:

19 Jan 2008, 7:30 PM
#23
jacka avatar

jacka

Zen Follower

Join Date:
Nov 2007
Location:
Dallas, Texas USA
Posts:
180
Plugin Contributions:
0

Re: Best sellers "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

19 Jan 2008, 8:10 PM
#24
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

19 Jan 2008, 10:37 PM
#25
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

yellow1912:

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.

26 Jan 2008, 2:16 PM
#26
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

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

26 Jan 2008, 11:18 PM
#27
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

barricades:

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.

27 Jan 2008, 1:29 PM
#28
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

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

27 Jan 2008, 10:21 PM
#29
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

barricades:

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)

28 Jan 2008, 1:31 PM
#30
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

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/index.php?main_page=index&cPath=2_20

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

Is there an easy way to fix that?

Thanks for all this

28 Jan 2008, 9:24 PM
#31
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

barricades:

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/index.php?main_page=index&cPath=2_20

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

Is there an easy way to fix that?

Thanks for all this

You can try adding this to your css file:

#productListing {margin-left: 1em; }

Although this will move over the products just a little bit on the rest of your pages too because the Best Sellers page uses the same template and has none of its own id's or classes (as far as I know).

If 1em isn't enough, just keep increasing it a little (1.1, 1.2, etc.) until you can see the line and then check your regular product pages to see if it looks okay too. I'm not the best when it comes to CSS!

29 Jan 2008, 12:13 PM
#32
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: Best sellers "page"

That worked great. Thank you so much. I'm still learning (only been at this since the summer) so it's great that the kind people on this forum are patient and willing to answer what must be, for them, simple questions.

thanks
craftzombie

31 Jan 2008, 8:25 AM
#33
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

barricades:

That worked great. Thank you so much. I'm still learning (only been at this since the summer) so it's great that the kind people on this forum are patient and willing to answer what must be, for them, simple questions.

thanks
craftzombie

No problem! I've been at it for a year and a half now and I'm still learning too. :smile:

3 Feb 2008, 1:40 PM
#34
co13 avatar

co13

New Zenner

Join Date:
Feb 2008
Posts:
7
Plugin Contributions:
0

Re: Best sellers "page"

hi guys, i have a question
1)how can i change products in bestsellers? where do i must change that?

  1. how do i proper install that mod? just replace the files?
3 Feb 2008, 4:08 PM
#35
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: Best sellers "page"

co13

1 - not sure what you mean, can you explain
2 - there is a readme file in the mod files when you download it. Follow that. You won't actually be replacing files but it will add extra files into some already existing folders

4 Feb 2008, 1:19 AM
#36
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

co13:

hi guys, i have a question
1)how can i change products in bestsellers? where do i must change that?

The purpose of this mod is to show the best sellers. It is pulling the top selling items from your database. If you want to show specific products, maybe you should use Featured Products instead. For best sellers, you can exclude certain products from appearing, but I don't believe you can choose which products appear. If you do not have a lot of products, I suppose you can exclude a bunch of them to obtain your goal, but thats too much work when you can just use Featured Products instead.

8 Feb 2008, 12:23 PM
#37
co13 avatar

co13

New Zenner

Join Date:
Feb 2008
Posts:
7
Plugin Contributions:
0

Re: Best sellers "page"

thnx, i should use featured prods instead, ... i have tryied but no solutions, it was put by default some best sell prods, dont know how to delete or change the more selled prods

8 Feb 2008, 2:35 PM
#38
aipman1 avatar

aipman1

New Zenner

Join Date:
Feb 2008
Posts:
3
Plugin Contributions:
0

Re: Best sellers "page"

it took some doing and adjusting, but I got the page and a link to it working well. Good show on this - hope to see it continued and cleaned up, made a bit more out-the-box easy.

25 Feb 2008, 11:48 AM
#39
rlparker avatar

rlparker

New Zenner

Join Date:
Jan 2008
Posts:
45
Plugin Contributions:
0

Re: Best sellers "page"

hi,

i've installed this mod and it works great except for one thing, The headings, which work as a filter on the normal products page just appear as text in the best sellers page.

Any idea how I can make these work correctly on this page ?

Thanks

Rachael

25 Feb 2008, 9:00 PM
#40
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: Best sellers "page"

rlparker:

hi,

i've installed this mod and it works great except for one thing, The headings, which work as a filter on the normal products page just appear as text in the best sellers page.

Any idea how I can make these work correctly on this page ?

Thanks

Rachael

Do have a link? I'm a little confused by the "headings, which work as a filter" statement. Do you mean in terms of search engines and font size or am I just barking up the wrong tree??