Loaded Commerce Community

Banner


Board index » Web Design and Development » Contribution Announcements

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Products Extra Fields Import/Export [Free]
PostPosted: Fri Apr 11, 2008 9:17 pm 
Offline
CRE Newbie
User avatar

Joined: Fri Apr 11, 2008 8:57 pm
Posts: 5
I was tasked with setting up an easier way to do bulk additions of Product Extra Fields data utilizing Excel or OpenOffice and came up with the following solution.

It could be much more polished but it works and as such felt that I should open it up for others to use/modify to their hearts content.

I will not be charging for this for a couple of reasons:
1. I wrote it for the company so I have already been paid =P
2. I don’t want to

The code is GPL and as such you can utilize it under those terms.

I will attach the README here since no one is going to read it in the ZIP anyway ;)

Link to Download Location

Enjoy,
Jonathan

##############################
# Installation #
##############################
For installation please see the included INSTALL file.

###############################
# CRE Version #
###############################
This was written and tested on the following CRE Loaded
CRE Loaded6 v6.2 Pro[13.1 (SP1)]

###############################
# PHP Version #
###############################
This was written and tested on PHP Version 4
Will work on PHP4 and PHP5
###############################
# BACKUP #
###############################
Before you go any further BACKUP your catalogs database
right now, I am serious. While I want you to find this
contribution to be useful I also know that it is likely
not perfect and may well foobar your data pretty badly
if it is run in a way I did not originally design it for.

Again, please make a BACKUP now ...

###############################
# What it does #
###############################
This contribution deals with the Products Extra Fields.
It will export/import all Product Extra Fields Names/Data
for all of the products in your database. Please note that
the file structure MUST be maintained.

Please note that the only type of file currently being
supported is the TAB Delimited file. This is done because
your Extra Fields may well have a comma or two in them and
that would break the import. I may add other file types in
the future, but for the time being just export your
spreadsheet as a TAB Delimited file.

##############################
# Exporting #
##############################
A File is simply created for you based on the already
existing data in your product database.

##############################
# Importing #
##############################
There is no defined limit on the number of Names you can
have going accross the first line of the file. Also,
if the name does not exist in the database it will be
created for you. You also have the option to turn on the
Product Extra Fields that has just been created by checking
the box to do so on the import page.

#################################
# Language Support #
#################################
I am a native english speaker and only deal with stores that
are presented in english at this time. I have included support
for dealing with other language types. I have no tested it
extensivly and while it *SHOULD* work in theory I make no
promises to it not breaking your database.

##############################
# The End #
##############################
Jonathan Crosby [ Email in Actual README ]


Top
 Profile  
 
 Post subject: Re: Products Extra Fields Import/Export [Free]
PostPosted: Tue Apr 22, 2008 10:31 pm 
Offline
CRE Newbie
User avatar

Joined: Fri Apr 11, 2008 8:57 pm
Posts: 5
Fixed a problem with how the language was set, so download the package again and overwrite :D

- jonathan


Top
 Profile  
 
 Post subject: Re: Products Extra Fields Import/Export [Free]
PostPosted: Thu May 01, 2008 11:38 pm 
Offline
CRE Newbie
User avatar

Joined: Fri Apr 11, 2008 8:57 pm
Posts: 5
Fixed a problem with allowing empty strings to be written to the database, oops :wink:

- jonathan


Top
 Profile  
 
 Post subject: Re: Products Extra Fields Import/Export [Free]
PostPosted: Wed Jul 09, 2008 5:08 am 
Offline
CRE Newbie
User avatar

Joined: Thu Jul 06, 2006 12:00 am
Posts: 8
Hi Jonathon,

Thanks very much for your contribution! I can't believe it's not included as standard with CRELoaded (it should be included for any 'serious' implementation of an online store).

My client requested the functionality and I've found your solution which looks great. I can't wait to try it.

Did you base it on this oscommerce contribution, or is it totally new? -

http://www.oscommerce.com/community/con ... 75/page,26

Thanks,

Nick Forde
Aussiecom Internet Consulting
http://www.aussiecom.com.au


Top
 Profile  
 
 Post subject: Re: Products Extra Fields Import/Export [Free]
PostPosted: Thu Aug 07, 2008 10:06 pm 
Offline
CRE Newbie
User avatar

Joined: Fri Apr 11, 2008 8:57 pm
Posts: 5
I too was a little surprised there was not a way to import/export...

It was based only on the specific requirements presented to me (file structure, layout, etc) at the time ... so I did not base it on any preexisting code, which is probly why it's so rough ;)

*Edit : (well, that is not entirely true ... I did use the function from the easypopulate to make things a little easier)

if you have any problems just send an email to the address in the README and I will check into it for you. I wrote it in a hurry and though it holds solid for us with all our sites it might need to be tweaked slightly to work better for whatever it is you are trying to get done.

Either way it's nice to know someone found it useful :)

Thanks,
- jonathan


Top
 Profile  
 
 Post subject: Re: Products Extra Fields Import/Export [Free]
PostPosted: Wed Nov 25, 2009 2:45 pm 
Offline
CRE Newbie
User avatar

Joined: Thu Nov 19, 2009 8:49 am
Posts: 17
Just wanted to say thank you for this contribution! Works Great!
----
update:
Perhaps I spoke too soon. The export worked great, but when I tried to import, I received this error:

Quote:
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 '' at line 1

select * from products_to_products_extra_fields where products_id = 9 and products_extra_fields_id =

[TEP STOP]


I have been going at it for about 30 minutes and just wanted to see if someone can tell me what that means. I found the php code that it derives from:
Code:
/Now that we peiced that together we gotta figure out if we need to delete anything
                        //So we are about to his the database 1 time for each entry...
                        $theCheckSQL = 'select * from '.TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS.' where products_id = '.$theProductsExtraFieldsData[0].' and products_extra_fields_id = '.$theRealNamesArray[trim($theNames[$y])];                                                 
                        $theCheckNumRows = tep_db_num_rows(tep_db_query($theCheckSQL));
                           
                        if($theCheckNumRows > 0) {
                            $theDeleteSQL = "delete from ".TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS." where products_id = ".$theProductsExtraFieldsData[0]." and products_extra_fields_id = ".$theRealNamesArray[trim($theNames[$y])];
                            array_push($theDeleteArray,$theDeleteSQL);
                            $deleteMe = true;
                        }

                    }
                   
                }
            }


Is there anything wrong with it?


Top
 Profile  
 
 Post subject: Re: Products Extra Fields Import/Export [Free]
PostPosted: Thu Jan 14, 2010 2:27 pm 
Offline
CRE Newbie
User avatar

Joined: Thu Nov 19, 2009 8:49 am
Posts: 17
Is anyone else using this?...successfully?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

Board index » Web Design and Development » Contribution Announcements

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
It is currently Mon May 21, 2012 8:29 pm
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy