| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Best Sellers for the Month Only | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
![]() THis sure would have been a nice mod. Too bad it doesn't work on the latest versions of X-Cart. *sad face*
- Shannon
__________________
- www.TheShotList.com X-Cart version 4.0.13 PHP 4.3.10 MySQL 4.0.23 Web server Apache Operation system Linux Perl 5.008004 XML parser (expat) 1.95.6 |
|||||||
#12
|
|||||||
|
|||||||
![]() Hi Jon,
Nice mod. ![]()
__________________
X-Cart 5.3.5.4 |
|||||||
#13
|
|||||||||
|
|||||||||
![]() If somebody is interested you can PM me for a quote for 4.x, but I don't have the time to make it without necessity to do so.
You can prevent your page from jumping to the type by adding this code to your <a href tag: Code:
Prevents the link from doing what it's supposed to. |
|||||||||
#14
|
|||||||
|
|||||||
![]() Thanks Jon, love your work mate! Oh, and btw, worked great too!
__________________
X-Cart 5.3.5.4 |
|||||||
#15
|
|||||||
|
|||||||
![]() yages,
I think the reason why you see that error is because ... On v4.0.x.. you need Code:
instead of Code:
After I corrected to that, I don't see the error message no more. My site is still at testing stage, and there is no product sold, so I don't see any change this MOD does to my site just yet. Let me know if anyone has a working demo site with standard template.
__________________
X-Cart Gold 4.0.17 |
|||||||
#16
|
|||||||
|
|||||||
![]() I tried to install this mod but it would not work
Maybe this could be the problem My home.php looks like this # # $Id: home.php,v 1.44.2.2 2005/01/12 07:41:51 svowl Exp $ # header("Location: ../home.php".(!empty($QUERY_STRING) ? "?".$QUERY_STRING : "")); ?> where do I put the code require $xcart_dir."/bestsellers_month.php";
__________________
yages x-cart version 4.5.5 |
|||||||
#17
|
|||||||
|
|||||||
![]() Thanks! This is excellent.
I made one change so it's the last month's bestsellers, not just since the first of the current month: Code:
I removed the month_cat, since I want all categories included. I also checked orders' status (for Processed or Completed in my case): Code:
And finally, I modified skin1/modules/Bestsellers/menu_bestsellers.tpl, rather than changing welcome.tpl. Just change all instances of $bestsellers to $month_bestsellers. Best, Stefan
__________________
Gold 4.0.17 On Sale, Smart Search, X-AOM, X-SpecialOffers, XNews, DSEFU, and custom mods/tweaks |
|||||||
#18
|
|||||||||
|
|||||||||
![]() I changed this for xcart 4.1.3
shopcart/bestsellers_month.php <? $start_date = strtotime("-1 month"); # LAST MONTH PRODUCTS $end_date = strtotime("now"); # TODAY - NOW $amount_prod_to_show = '6'; # AMOUNT OF PRODUCTS TO SHOW $query = "SELECT $sql_tbl[products].*, $sql_tbl[pricing].*, $sql_tbl[order_details].productid, $sql_tbl[order_details].orderid, $sql_tbl[orders].orderid, $sql_tbl[orders].date, count($sql_tbl[order_details].productid) as sold FROM $sql_tbl[pricing], $sql_tbl[products], $sql_tbl[orders], $sql_tbl[order_details] WHERE ($sql_tbl[orders].status='C' OR $sql_tbl[orders].status='P') AND $sql_tbl[orders].date > '$start_date' AND $sql_tbl[orders].date < '$end_date' AND $sql_tbl[order_details].orderid=$sql_tbl[orders].orderid AND $sql_tbl[products].productid=$sql_tbl[order_details].productid AND $sql_tbl[pricing].productid=$sql_tbl[products].productid AND $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail>0 GROUP BY $sql_tbl[order_details].productid ORDER BY sold DESC LIMIT $amount_prod_to_show"; $month_sellers = func_query($query); $smarty->assign("month_sellers",$month_sellers); ?> In the shopcart/home.php add require "./bestsellers_month.php"; In the shopcart/skin1/customer/main/welcome.tpl add {if $month_sellers ne ""} {include file="modules/Bestsellers/bestsellers_month.tpl" products=$month_sellers featured="Y"} <br />{/if} Also add the above if you want it to be displayed in your subcategories to shopcart/skin1/customer/main/subcategories.tpl I also made in shopcart/skin1/modules/bestsellers/bestsellers_month.tpl file which is: bestsellers_month.tpl {if $month_sellers} {capture name=bestsellers} <TABLE border="0" cellpadding="0" cellspacing="0"> <tr> {foreach from=$month_sellers item=bestseller} <TD width="100" align="center" valign="top"> <div align="center">{if $config.Bestsellers.bestsellers_thumbnails eq "Y"} <a href="product.php?productid={$bestseller.productid }&cat={$cat}&bestseller">{include file="product_thumbnail.tpl" productid=$bestseller.productid image_x=50 product=$bestseller.product alt=$bestseller.fulldescr|replace:"":""}</a> <br /> {/if} <b><a href="product.php?productid={$bestseller.productid }&cat={$cat}&bestseller">{$bestseller.prod uct}</a></b><br /> {$lng.lbl_our_price}: {include file="currency.tpl" value=$bestseller.price}<br /> </div></td> <TD width="10"></TD> {/foreach} </tr> </table> {/capture} {include file="dialog.tpl" title="This Months Hottest Sellers!" content=$smarty.capture.bestsellers extra='width="100%"'} {/if} You can see the finished product at http://www.theshisha.com/shopcart/home.php?cat=255 It will also display at the top of every categories, to see this go to http://www.theshisha.com/shopcart/home.php?cat=272
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24 PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART Shop carts at http://www.nightscene.co.uk/shop/home.php http://www.theshisha.net/shopcart/home.php http://www.system-maintenance.com/maint/home.php http://www.tabac4u.com |
|||||||||
#19
|
|||||||
|
|||||||
![]() Thank you so much for sharing the original, and everyone who posted 4x revisions. I haven't tried this yet, so may come back with questions
![]()
__________________
Starting again with XCart 4.1.6 gold ... |
|||||||
#20
|
|||||||||
|
|||||||||
![]() Glad to see people are still benefiting from this, thanks for posting the updates
![]() |
|||||||||
|
|||
X-Cart forums © 2001-2020
|