| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Bestsellers on ALL pages | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||||
|
|||||||||
The code I gave in this thread was written for 3.5.x So it looks like in 4.0.x you need to add an AND right after:
Code:
So that it looks like this now: Code:
I haven't tested this, so just let me know if it doesn't work. Thanks! Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002! We support X-cart versions 3.x through 5.x! Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more! Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com Please E-Mail us for questions/support! |
|||||||||
#22
|
|||||||
|
|||||||
I made the change, but still got the error when i click on a categorie:
INVALID SQL: 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 'GROUP BY xcart_products.productid ORDER BY xcart_products_categories.orderby' at line 1 SQL QUERY FAILURE: SELECT xcart_products.productid, xcart_products.product, xcart_products.productcode, xcart_products.avail, MIN(xcart_pricing.price) AS price, IF (xcart_classes.classid IS NULL,'','Y') as is_product_options, IF(xcart_variants.variantid IS NULL,'','Y') as is_variant FROM xcart_products, xcart_categories, xcart_products_categories, xcart_pricing LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid LEFT JOIN xcart_products_lng ON xcart_products.productid=xcart_products_lng.produc tid WHERE xcart_products.productid=xcart_products_categories .productid AND xcart_products_categories.categoryid=xcart_categor ies.categoryid AND xcart_products.productid=xcart_pricing.productid AND xcart_pricing.quantity=1 AND (xcart_pricing.membership='' OR xcart_pricing.membership='') AND (xcart_categories.membership='' OR xcart_categories.membership='') AND xcart_products.forsale='Y' AND xcart_pricing.variantid = 0 AND xcart_products.product_type <> 'C' AND xcart_products.product_type <> 'B' AND xcart_products.forsale='Y' and xcart_products.avail>0 and xcart_products.sales_stats > 0 AND xcart_categories.avail='Y' and price>0 group by xcart_products.productid order by sales_stats DESC, views_stats DESC limit 5 GROUP BY xcart_products.productid ORDER BY xcart_products_categories.orderby I don't get this error when go to the search page, but the bestsellers also don't show up there...
__________________
Version 4.0.14 |
|||||||
#23
|
|||||||||
|
|||||||||
ditto on the SQL error.
And a little more info on the error: Code:
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10 |
|||||||||
#24
|
|||||||||
|
|||||||||
That was a different sql error. Try this line instead. Again this is untested. I may have a few minutes at the end of the week to test this. Right now I'm swamped.
Code:
Thanks! Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002! We support X-cart versions 3.x through 5.x! Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more! Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com Please E-Mail us for questions/support! |
|||||||||
#25
|
|||||||||
|
|||||||||
Thanks for taking the time Carrie,
Unforturnately still get the SQL error: Code:
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10 |
|||||||||
#26
|
|||||||||
|
|||||||||
Sorry I had a typo. Been an intense week. or is it
Try this: Code:
Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002! We support X-cart versions 3.x through 5.x! Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more! Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com Please E-Mail us for questions/support! |
|||||||||
#27
|
|||||||
|
|||||||
Great mod! trying to get this to work on 4.0.18
It works but if you are viewing a product and click on one of the bestsellers that is in a different category, the category location does not update. exsample..you are viewing baby > diapers > product A and click on bestseller product B in catagory electronics > stereo > Product B the location would show baby > diapers > product B how can I fix this? Code:
__________________
Main Server (Dedicated) ---------------------------------------------------- Apache version 1.3.37 (Unix) PHP version 4.4.7 Database Server (Dedicated) ---------------------------------------------------- Apache version 1.3.37 (Unix) PERL version 5.8.8 PHP version 4.4.7 MySQL version 4.1.21-standard X-Cart Version ---------------------------------------------------- 4.0.17 Heavily Modded |
|||||||
#28
|
|||||||
|
|||||||
@TTHTG
you have an error in the code, everything looks fine on my XC I am using the latest version Thanks for mod
__________________
X-Cart version 4.0.19 |
|||||||
#29
|
|||||||
|
|||||||
Re: Bestsellers on ALL pages
Thanks for making this mod available. However, I find that if a category is empty it is showing all the products for the store, even though I have under Modules Options - the number of products in bestsellers list set to 10.
Is there something else that needs to be done? I have over 600 products and the list is very long since it is ignoring the limit I set in the Admin section. Any help will be greatly appreciated. Randal
__________________
*********************** Visit Our Other Web Sites! ∙ Nutritional Herbs and Supplements <a href="http://www.theherbsplace.com"> The Herbs Place </a> ∙ Frugal Ideas and a Forum To Submit Your Questions <a href="http://www.thefrugallife.com"> The Frugal Life </a> ∙ Healthy and Natural Pet Products <a href="http://www.healthypetcorner.com"> Healthy Pet Corner </a> *********************** Joined 08/02/05 X-Cart Gold Version 4.3.2 Linux RedHat Enterprise |
|||||||
#30
|
|||||||||
|
|||||||||
Re: Bestsellers on ALL pages
I changed this to work on x-cart 4.1.3 - You can see an example at http://www.theshisha.com/shopcart/home.php?cat=273
The end of my Bestsellers is: # SELECT RANDOM ITEMS IF STATS ARE TURNED OFF WHICH BESTSELLERS MODULE NEEDS TO WORK if(empty($bestsellers)) { # SEARCH PRODUCTS FOR SALE, AVAILABLE, CATEGORIES AVAILABLE, PRICE GREATER THAN 0 $price_product = 10; # PRODUCT PRICE MUST BE GREATER THAN 10 $search_query = " AND $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail>0 AND $sql_tbl[categories].avail='Y' AND price>$price_product"; $bestsellers = func_search_products($search_query, @$user_account["membershipid"], $order_by, $config["Bestsellers"]["number_of_bestsellers"]); } # This wants to go before: $smarty->assign("bestsellers",$bestsellers); ?> You might want to also look at the best sellers for the month thread at http://forum.x-cart.com/showpost.php?p=146486&postcount=18
__________________
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 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|