importing csv (magento) - magento

I have a certain attribute dealer_country in my website, which is a dropdown attribute containing a list of all countries. However, in my csv file, the dealer_country attribute will be containing country codes(in 2-letter format). Would it be possible to import with this condition?

Yes. There is an easy way and a hard way.
If programming is your bag then you can get your attribute hooked up to the Magento country codes and have it return country names on the front end.
It would take a while to write such an ideal solution. However you can use a 3rd party import tool like 'Magmi' to get your products in without having to define your attribute values first.
Once in you can edit your attribute entries for country and, in the second column put the country names to be shown on the front end. e.g. for 'GB' in column one you have 'United Kingdom of Great Britain and Northern Ireland' in column two. Or for 'LY' you can add 'The Great Socialist People's Libyan Arab Jamahiriya' for column two... Oops!
http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Main_Page

Related

line break in csv file content

Guys i need to create a very simple csv file with some product details in order to import them to an online shopping site. Each product has 3 attributes: name, description and price.
The csv file would look like this:
product 1,product description,100
product 2,product description,100
product 3,product description,100
I have 2 problems:
1) each product description has more than one line, something like
This the product's description.
This is a cool feature.
This is another feature.
Product made in the US.
How can i keep/add this formatting in the csv file?
2) second problem, most product descriptions contain a comma "," in there, like:
This product is great, reliable and also cheap.
How can i add these commas to the description without breaking the csv format?
And a final question: some product descriptions have more than 800 or even 100 characters. Is it possible to add that much characters in a field in a csv?
A workaround for the first problem is to use HTML <br/> tags instead of line breaks. That's what I'm doing, at least until I find a better solution.
So you would change:
This the product's description.
This is a cool feature.
This is another feature.
Product made in the US.
to:
This the product's description.<br/>This is a cool feature.<br/>This is another feature.<br/>Product made in the US.
As for the second problem: in my tests, Magento didn't seem to have any trouble with commas within fields. But you can always change the delimiter Magento uses. I usually use tab (\t). Make sure to use Magento's advanced import features in System > Import/Export > Dataflow-Profiles.

Google Spreadsheets multiple/scenario filter dropdown

I can create drop down filter options for each of the dimensions in the spreadsheet: month, description, and type. using data validation and then sum(filter in Google Sheets. I want to include an option in the drop-down to include all months, include all types, etc. The end product would sum the amount based on the filters selected. I can sum(filter based on individual selections but my question is how to sum the amounts if one of the scenarios was: all months, groceries only, all descriptions.
https://docs.google.com/spreadsheet/ccc?key=0AgKUNhffHpmZdHZ3TGNXOUplN1R5UUlUSW5tVVp5b1E#gid=0
You'd have to use a Pivot Table. Then you have all this things in one view.
Select colums A to D. Go to Data/Pivot Table.
Add Month to Rows and Description to Colums (or vise versa) and add Amout to Values.
You'll see a total for all Descriptions/month and Grand total/month and /description.

Table Rates CSV format for zip codes

My CSV file have a format like this picture
I import successfully. But in cart page, I fill postcode 1500 then get estimate quote, nothing happen. I had to fill 1500-2170 then get quote, it show Price 500.
No shipping method show if I use postcode 1500 in my address. How to make it show or estimate by fill 1500 instead of 1500-2170.
The Zip/Postal Code on the Table Rates table does not accept a range of zip or postal codes. It only accepts the exact codes.
That is the following are valid entries for the Zip/Postal Code column:
1500
1501
1502
etc.
If you want to enter a range of zip or postal codes you need to install a module to allow this functionality. There is a module WebShopApps MatrixRate that adds this functionality:
http://www.magentocommerce.com/magento-connect/webshopapps/extension/604/webshopapps-matrixrate--the-original-multiple-table-rate-solution--certified-bug-free
The Zip/Postal Code does not allowed area range. You just given a exact code. Ex: Hyderabad: zipcode is: 500001. Once you try this method.

a bit of a string matching conundrum in excel-vba

i'm writing a program at work for a categorizing issue.
i get data in the form of CODE, DESCRIPTION, SUB-TOTAL for example:
LIQ013 COGNAC 25
LIQ023 VODKA 21
FD0001 PRETZELS 10
PP0502 NAPKINS 5
Now it all generally follows something like this...the problem is my company supplies numerous different bars. So there are like 800 records a month with data like this. My boss wants to breakdown the data so she knows how much we spend on a certain category each month. For example:
ALCOHOL 46
FOOD 10
PAPER 5
What I've thought of is I setup a sort of "data-base" which is really a csv text file that contains entries like this:
LIQ,COGNAC,ALCOHOL
LIQ,VODKA,ALCOHOL
FD,PRETZELS,FOOD
FD,POPCORN,FOOD
I've already written code that imports the database as a worksheet and separates each field into its own column. I want excel to look through the file and when it sees LIQ and COGNAC to assign it the ALCOHOL designator. That way I can use a pivot table to get the category sums. For example I want the final product to look like this:
LIQ013 COGNAC 25 ALCOHOL
LIQ023 VODKA 21 ALCOHOL
FD0001 PRETZELS 10 FOOD
PP0502 NAPKINS 5 PAPER
Does anyone have any suggestions? My worry is that a single point expression match to JUST the code i.e. just to LIQ without a match to COGNAC as well would maybe result in problems later when there are conflicting descriptions? I'd also like the user to be able to add ledger entries so that the database of recognized terms grows and becomes more expansive and hopefully more accurate.
EDIT
as per #Marc 's request i'm including my solution:
code file
please note that this is a pretty dumb-ed down solution. i removed a bunch of the fail-safes and other bits of code that were relevant to a robust code but not to our particular solution.
in order to get this to work there are two parts:
the first is the macro source code
the second is the actual file
because all the fail-safes are removed, the file needs to be imported to excel exactly the way it appears. i.e. Sheet1 on the googleDoc should be Sheet1 on the excel, start pasting data at cell "A1". before the macro is run, be sure to select cell "A1" in Sheet1. as i said, there are implementations in the finished product to make it more user friendly! enjoy!
EDIT2
These links suck. They don't paste well into excel.
If your comfortable with it I can email you the actual workbook. Which would help in preserving the formatting etc.
Use a lookup table in a separate sheet. Column A of the lookup sheet contains the lookup value (e.g. PRETZELS), Column B contains the category (FOOD, ALCOHOL, etc). In the cells where you want the category to show up in your original sheet (let's use D3 for the result where B3 holds the "PRETZELS" value), type this formula:
=VLOOKUP(B3,OtherSheet!$A$1:$B$500,2,FALSE)
That assumes that your lookup table is in range A1:B500 of a worksheet named "OtherSheet".
This formula tells Excel to find the lookup value (B3) in column A of your lookup and return the corresponding value from column B of your lookup table. Absolute references (the $) ensure that your formula won't increment cell references when you copy/paste the formula in other cells.
When you get new categories and/or inventory, you can update your lookup table in this one place by just adding new rows to it.

VB6 and data-bound MSHFlexGrid, moving and populating columns

I'm working on a VB6 program that connects to a SQL Server 2008 R2 database. In the past I have always used the MSFlexGrid control and populated it manually. Now, however, the guy who is paying me for this wants me to use data-bound grids instead, which forces me to use the MSHFlexGrid control because I'm using ADO and not DAO. So, I have two questions...
First, how would I move a column in a MSHFlexGrid? For example, if I wanted the third column to appear as the sixth column in the grid, is there a simple single line of code that would do that?
Second, believe it or not, I've never had to do anything in a grid other than display the data, as is, from a recordset. Now, however, I have a recordset with some fields that contain just ID numbers that refer to records in other files - for example, a field containing an ID number referring to a record in the Customers table, instead of the field containing the customer's name. What is the easiest way to, instead of having a column showing customer ID numbers from the recordset, having that column show customer names? I thought I read somewhere that there's a way to embed a sql command in a MSHFlexGrid column, but if there is I wouldn't know how to do it. Is this possible, or is there a simpler way to do it?
TIA,
Kevin
The column order would typically be handled by your SELECT statement.
Say you have a Pies table that has a FruitID foreign key related to the FruitID in a Fruits table:
SELECT PieID AS ID, Pie, Fruit FROM Pies LEFT OUTER JOIN Fruits
ON Pies.FruitID = Fruits.FruitID
This returns 3 items: ID, Pie, and Fruit in that order.
Moving columns after the query/display operation is rarely used, but yes ColPosition can be used for that.
Wow! VB6.... Back to the future! :-)
You can move Columns using the ColPosition Property.
This article shows how you could setup the grid to display hierarchical data.
If you just want to display the customer name on the same line as the main data then that is doable as well by just creating the proper SQL for your data source. For that matter you can control the column order the same way as well.
Now, how about considering upgrading to .Net? Just kidding..... No, I'm not. OK. I am, maybe. :-)

Resources