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

Bulk Add Featured Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 02-25-2006, 09:54 AM
 
dutrowllc dutrowllc is offline
 

Member
  
Join Date: Jan 2006
Location: Washington DC
Posts: 16
 

Default Bulk Add Featured Products

For those of us who need many featured products or to edit featured products list frequently, the interface to add featured products one by one is not sufficient. I spent the last few hours trying to figure out how to bulk add/delete featured products, this is the fruits of my labor:

The best way to add featured products seems to be directly through the database.

The database table is called: xcart_featured_products
The fields that it has are:
productid: Product ID (I'm pretty sure this is the primary key)
categoryid: ID of the category that you want the featured item to be in. If you want it to be featured at root level, then the value should be "0"
product_order: The standard seems to be doing this by 10's, so the first one should be 10, the second 20 and so on. I think you can leave this blank or make them all the same number if you want them to appear in as they are in the database though.
avail: Availability "Y" if the product is available "N" if it is not.

Originally I tried to add all of these in a .CSV file through the SQL program that my hosting supplied. I had trouble with this, so instead I used Microsoft Excel to create a long statement that added them all individually and this worked fine. This is the syntax for the statement:

INSERT INTO xcart_featured_products
VALUES ('productid','categoryid','product_order','avail') ;

This is a sample of what my statement looked like. I found that I had to have a new "INSERT INTO" statement for each line that I wanted to add:

INSERT INTO xcart_featured_products
VALUES ('101','0','10','Y');
INSERT INTO xcart_featured_products
VALUES ('102','0','20','Y');
INSERT INTO xcart_featured_products
VALUES ('103','0','20','Y');

You can use the Excel function "CONCATENATE" to pull all the strings together into a statement.

KeyWords/Phrases
Bulk Add Featured Products
Add Multiple Featured Products
Add Featured Products in Bulk
Edit Featured Products
Featured Product List
__________________
version 4.0.17
X-Affiliate

www.AssholeTShirts.com (probably not safe for work)
Reply With Quote
  #2  
Old 03-28-2006, 05:38 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Moving to Custom Mods
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-14-2007, 08:44 AM
 
paperlion paperlion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 89
 

Default Re: Bulk Add Featured Products

This looks like a good workaround and I'd like to try it. Not sure how to understand the Excel strings and statements though. Would be great if this could be explained in terms of cells, etc. - maybe if a sample csv file could be posted here?

thanks.
__________________
Gold 4.0.19
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 12:09 PM.

   

 
X-Cart forums © 2001-2020