I am new to Magento and I have a question about products import. I have the xls file with over 9K positions (products) wich I need to import. For each product in this file there are basically sku, name, price and descriprion attributes. I am familiar with the basics of import/export in Magento. I’ve already exported some test products into csv file to get the structure for import csv. This file of course contains much more attributes than the one i need to import. So my obvious question is: how can I create valid import csv from my xls file (not by hand of course)? The only solution I can see right now is to write some php code that will extract data from the xls file, add required attributes from export csv and save it as csv. Are there other solutions to my problem? Sorry if I am asking some obviuos questions. Googled, searched, found nothing.
Better way is to save excel as simple csv file and use Magmi for import to Magento. http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Main_Page
Related
Heres my problem. I want to make a good looking table for my orders and inventory stock as excel files. But I can't find how to import tables in the file and save it and not create another new file.
Please help me on what can I do here!
Laravel Version : 8.1.10
Laravel Excel Version : 3.1
Thanks!
It's ok that you want show beautified your excel file, if you use untidy code and config it will has lot of load and burden on your php-cgi.
you can use phpspreadsheet for this work
after that you can change cell color with this code:
$spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED);
I have huge problem.
I have a task to put in database information about products. All information's except price are in XML file that is big 100mb.
In another file there are information's about price of that product. That is CSV file with size about 200mb
In simple logic
Parse XML into array
Search price by unique ID of product in another file
Add found price to element of array where is that product
Put information's in database
But i Cannot do that. Problem is in SIZE.
I manage to parse XML and put it in array, but I cannot handle CSV file. If there is 1000 products, for each product he need to parse CSV file (that CSV file have more than 30.000.000 lines). I cannot parse that CSV one, much less 1000.
I need suggestion how to solve this problem
Looks like a job for a database to me. Load both files into a database and then do a simple join.
Use XMLReader for the XML, SplFileObject for the CSV.
Do not keep the information in memory. Write it directly into a database like MySQL or SQlite. After all the data is imported you can use SQL to aggregate it.
I have a big database in Access with products I want to insert in Prestashop!
I've read about the database import in prestashop but didnt find anything about access db import. Is there a way to import this database in prestashop?
Or am I supposed to write sql queries to add these products. I have read the source code of prestashop like Products.php or ObjectModel.phplike said here:http://stackoverflow.com/questions/16068141/prestashop-insert-products-script. So is the only way to write sql queries?
Thanks!
PrestaShop have tools to import products from CSV, you can check it in BO > Advanced Parameters > CSV Import. You can choose what you want to import, products, categories, attributes etc. If your file is too big you supposed to split it to few small files.
As Agnes said CSV will be the option.
Since I still don't have enough rep I can comment on his response but I'd like to add that in the CSV import page you can find templates for the CSV may be useful if you are not used to Prestashop Product Fields.
Also if you upload the images to a temporal folder and add the URLS in the product CSV the images will be imported and added to the product.
If is the first product upload I'll also recommend you to set up the IDs for the products this way if something doesn't fit or you want to change the uploaded products you can do it just by ID or simply delete all previous products and import the new ones.
Good luck.
Import is very complecated in PrestaShop, and not really fonctionnal.
I recommand to use the module Migration pro. Is a paid module, but it works really fine, i've used it a lot.
Otherwise, you can read this article (in french), you have the list of table to import. After that, you can import images and regenerate them.
Good luck ;)
Modern Prestashop can directly import xls/xlsx files
It is much better choice than CSV because you don`n have mess with field delimiters.
Export from Access to Excel should not be problem.
Native Import through web admin GIU is very good.
But you need some practice:
Make file with few products - you can delete them later if you not satisfied with results of import.
Look carefuly at field mappings. Maybe you will fail at first attempt or miss some mapping - thats why you need to import few products first.
If possible try to use the built in webservice api or you can make your own custom import module
Is there a possibility to import XLS Files into Prestashop? I would imagine myself a Script where I define which rows (as an Example A1-A300 should be Names of the articles, etc...) are what (Like name, price, Tax, etc...).
How could I realise that? I hope there is a possibility and I would appreciate if anyone could get ma on the right path.
PrestaShop doesn't support excel files, only simple data tables like .csv. This is because excel files are too complicated, they can by whole programs by themselves.
However, if you're working for a client or your XLS files are just simple data, then surely you can convert XLS to CSV before import.
You just need to make an override for AdminImportController::ajaxProcessUploadCSV
and basically "intercept file upload". Get the uploaded file and convert it to CSV using this library:
https://github.com/PHPOffice/PHPExcel
Then just return are the right values in your override to simulate that "everything is running normal" (basically trick PrestaShop :)) .
It is definitely doable, I've created such module for a client, PHPExcel gave us the ability to work with cells before saving them to CSV.
If you need to import products form Excel without converting to CSV, there is extension, Store Manager for PrestaShop - https://www.prestashopmanager.com/free-download/
It is paid, but you can do the task with 2-week version without any fees.
I would like to convert a txt file to excel and then modify certain data inside the excel file and then import this new excel file to a database using PHP. The contents of the excel file, for example, will be with products and prices of them and the modification will be on the prices.
Is this even possible using PHP or I will need something else?
Seems like a rather roundabout way of doing this, but I've had great success with Excel/php with phpExcel. That will get read/write Excel, but putting it into the database will likely require som php coding.
If you're just editing datas in Excell (no formulas ...) you should try csv format ...
I think that you should send a example of your txt file ...
Mimiz