Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Random Manufacturers in Manufacturer menu box

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 07-01-2007, 03:52 PM
  BCSE's Avatar 
BCSE BCSE is online now
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,060
 

Default Re: Random Manufacturers in Manufacturer menu box

Yes if you just find
ORDER BY <Something here>
you can replace that with
ORDER BY Rand()

Hope that helps!

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!
Reply With Quote
  #12  
Old 08-01-2007, 12:21 PM
 
MBA MBA is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 245
 

Default Re: Random Manufacturers in Manufacturer menu box

Quote:
Originally Posted by BCSE
Here's a quick mod to show random manufacturers in the Manufacturer menu box. Great for stores that have lots of manufacturers.

Open up modules/Manufacturers/customer_manufacturers.php
Find this line:
Code:
$manufacturers_menu = func_query("SELECT * FROM $sql_tbl[manufacturers] USE INDEX (avail) WHERE avail = 'Y' ORDER BY orderby LIMIT ".($config['Modules']['manufacturers_limit']));

Change it to this:
Code:
$manufacturers_menu = func_query("SELECT * FROM $sql_tbl[manufacturers] USE INDEX (avail) WHERE avail = 'Y' ORDER BY RAND() LIMIT ".($config['Modules']['manufacturers_limit'])); # BCSE changed

Carrie

Hi Carrie,

I assume one could list specific manufacturers in the manufacturer menu box by using the ORDER BY, but how would I call manufacturerid=21 and manufacturerid=832 specifically? Hope this isn't a huge deviation from the topic?
__________________
xCart Pro Version 4.0.17, 4.0.19, 4.1.8, 4.1.10, 4.1.11, 4.1.12 - retired
xCart Pro Version 4.3.1 - production
xCart Pro Version 4.5.1 - testing
RHEL Platform
Reply With Quote
  #13  
Old 08-02-2007, 06:55 PM
 
MBA MBA is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 245
 

Default Re: Random Manufacturers in Manufacturer menu box

onto it here -

SELECT 'manufacturer_id' FROM 'xcart_manfacturers' WHERE 'manufacturer_id'
= 53 or WHERE 'manufacturer_id' = 60 or WHERE 'manufacturer_id' = 100

ORDER BY 'manufacturer_id'

The syntax isn't exactly right, but this should do it. Would someone help me with the syntax of the php as the is driving me nuts?
__________________
xCart Pro Version 4.0.17, 4.0.19, 4.1.8, 4.1.10, 4.1.11, 4.1.12 - retired
xCart Pro Version 4.3.1 - production
xCart Pro Version 4.5.1 - testing
RHEL Platform
Reply With Quote
  #14  
Old 08-02-2007, 07:18 PM
  BCSE's Avatar 
BCSE BCSE is online now
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,060
 

Default Re: Random Manufacturers in Manufacturer menu box

Try this
SELECT 'manufacturer_id' FROM 'xcart_manfacturers' WHERE 'manufacturer_id'
= 53 or 'manufacturer_id' = 60 or 'manufacturer_id' = 100 ORDER BY 'manufacturer_id'

Basically take out the extra "where"'s

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!
Reply With Quote
  #15  
Old 08-08-2007, 08:26 PM
 
MBA MBA is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 245
 

Default Re: Random Manufacturers in Manufacturer menu box

Quote:
Originally Posted by BCSE
Try this
SELECT 'manufacturer_id' FROM 'xcart_manfacturers' WHERE 'manufacturer_id'
= 53 or 'manufacturer_id' = 60 or 'manufacturer_id' = 100 ORDER BY 'manufacturer_id'

Basically take out the extra "where"'s

Carrie

Bingo! Did it. Cheers.
__________________
xCart Pro Version 4.0.17, 4.0.19, 4.1.8, 4.1.10, 4.1.11, 4.1.12 - retired
xCart Pro Version 4.3.1 - production
xCart Pro Version 4.5.1 - testing
RHEL Platform
Reply With Quote
  #16  
Old 08-10-2007, 01:27 PM
  BCSE's Avatar 
BCSE BCSE is online now
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,060
 

Default Re: Random Manufacturers in Manufacturer menu box

Great!

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!
Reply With Quote
  #17  
Old 10-28-2013, 01:45 PM
  RPMOffroad's Avatar 
RPMOffroad RPMOffroad is offline
 

Member
  
Join Date: Sep 2013
Posts: 18
 

Default Re: Random Manufacturers in Manufacturer menu box

Carrie you've done so much for me already ( the whole image checker module revamp you did last week) I hate to ask for any more. Is there a updated version of this for 4.4.5? The customer_manufacturers.php is a little different in this version.
__________________
X-Cart version 4.6.6
X-Cart Gold
Product Configurator
Feature Comparison

Website Manager
www.RPMOFFROAD.com
Reply With Quote
  #18  
Old 10-28-2013, 07:17 PM
  BCSE's Avatar 
BCSE BCSE is online now
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,060
 

Default Re: Random Manufacturers in Manufacturer menu box

Hi! Boy you dug up an OLD thread.

For 4.4.5, look in the modules/Manufacturers/func.php and look for:
Code:
function func_get_manufacturers_list($avail_only = false, $limit = 0) {

Below that you will see:
Code:
. " ORDER BY orderby, manufacturer"
replace the orderby, manufacturer with Rand() like this:
Code:
. " ORDER BY Rand()"

I haven't tried it but it should work unless I missed something obvious.

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!
Reply With Quote
  #19  
Old 10-29-2013, 05:14 AM
  RPMOffroad's Avatar 
RPMOffroad RPMOffroad is offline
 

Member
  
Join Date: Sep 2013
Posts: 18
 

Thumbs up Re: Random Manufacturers in Manufacturer menu box

Its confirmed, you are a X-Cart Goddess!! Thanks again Carrie. Its amazing what you can do with this stuff!! Any testing on anything you want to do I am your guinea pig.
__________________
X-Cart version 4.6.6
X-Cart Gold
Product Configurator
Feature Comparison

Website Manager
www.RPMOFFROAD.com
Reply With Quote
  #20  
Old 10-30-2013, 08:03 AM
  BCSE's Avatar 
BCSE BCSE is online now
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,060
 

Default Re: Random Manufacturers in Manufacturer menu box

Quote:
Originally Posted by RPMOffroad
Its confirmed, you are a X-Cart Goddess!! Thanks again Carrie. Its amazing what you can do with this stuff!! Any testing on anything you want to do I am your guinea pig.

Thanks! You're so kind! I'm glad it worked!

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!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:12 AM.

   

 
X-Cart forums © 2001-2020