AscentMedia Posted October 28, 2013 Share Posted October 28, 2013 Good afternoon, Is there a way to import packs VIA CSV? Would save some time as there are nearly 3,000 I'd like to sell for one brand... Thank you, Jordan Link to comment Share on other sites More sharing options...
Beluga Posted October 29, 2013 Share Posted October 29, 2013 I'm having the same question.. I guess I'll have to build a module for this. 1 Link to comment Share on other sites More sharing options...
AscentMedia Posted October 29, 2013 Author Share Posted October 29, 2013 I'm capable of building a website for nearly everything..but when it comes to databases and things like that I don't know too much.. I tried searching around for a module in relation to this but couldn't find anything. I looked around phpMyAdmin a bit and noticed that there are multiple tables that control the packs. If you figure anything out please let me know! I will do the same if I find something that might help.. Link to comment Share on other sites More sharing options...
Beluga Posted October 29, 2013 Share Posted October 29, 2013 Yeah, if you look at my post history you will see that I've built a bunch of stuff in the past month, for example this simple "update order state via CSV upload". My client needs this feature and it seems I have to solve it. Most probably I will build a separate module, because the AdminImportController is too complex.. or maybe I should print out the code on paper and study it in minute detail, taking notes and taking my time. I will see tomorrow. Link to comment Share on other sites More sharing options...
Beluga Posted October 30, 2013 Share Posted October 30, 2013 (edited) I'm taking baby steps here.. went through the db tables and made notes of what I need to create packs. When importing, we need to first import all "base products" and after that in a separate pass all the packs that depend on (some of) those products. Do we have to do manual id matching in the CSV for the products and their packs? Could be automated, if we agreed to stick to a naming scheme which would allow us to match the packs with their products automatically. I'm not even taking to account attributes.. sorry, I don't need them. ps_stock: id_stock id_warehouse id_product id_product_attribute reference ean13 upc physical_quantity usable_quantity price_te 1 1 8 0 testttt 42 42 5.000000 ps_warehouse_product_location: id_warehouse_product_location id_product id_product_attribute id_warehouse location 3 10 0 1 4 11 0 1 ps_product: id_product id_supplier id_manufacturer id_category_default id_shop_default id_tax_rules_group on_sale online_only ean13 upc ecotax quantity minimal_quantity price wholesale_price unity unit_price_ratio additional_shipping_cost reference supplier_reference location width height depth weight out_of_stock quantity_discount customizable uploadable_files text_fields active redirect_type id_product_redirected available_for_order available_date condition show_price indexed visibility cache_is_pack cache_has_attachments is_virtual cache_default_attribute date_add date_upd advanced_stock_management 10 0 0 2 1 1 0 0 0.000000 0 1 20.000000 0.000000 0.000000 0.00 0.000000 0.000000 0.000000 0.000000 2 0 0 0 0 1 404 0 1 0000-00-00 new 1 1 both 1 0 0 0 2013-10-18 22:42:07 2013-10-18 23:11:21 1 11 0 0 2 1 1 0 0 0.000000 0 1 1000.000000 0.000000 0.000000 0.00 0.000000 0.000000 0.000000 0.000000 2 0 0 0 0 1 404 0 1 0000-00-00 new 1 1 both 1 0 0 0 2013-10-18 22:52:25 2013-10-18 22:54:40 1 ps_product_lang: id_product id_shop id_lang description description_short link_rewrite meta_description meta_keywords meta_title name available_now available_later 10 1 1 kilo-testibulkkituotetta Kilo testibulkkituotetta 10 1 2 kilo-testibulkkituotetta Kilo testibulkkituotetta 11 1 1 10-kg-testibulkki 10 kg testibulkki 11 1 2 10-kg-testibulkki 10 kg testibulkki ps_pack: id_product_pack id_product_item quantity 10 8 4 11 8 40Edit: found this, it is more complete: http://www.prestashop.com/forums/topic/260734-php-class-class-for-import-insert-products-directly-into-database/Have to study it.. Edited October 31, 2013 by Beluga (see edit history) Link to comment Share on other sites More sharing options...
AscentMedia Posted November 1, 2013 Author Share Posted November 1, 2013 I didn't even realize it was controlled by that many tables. My process for packs is this: 1. Upload items that the packs will be comprised of (ex: CURT-13002, CURT-56096, CURT-40004, CURT-45020, CURT-21500) 2. Upload the items that will be turned into packs (ex: CURT-13002-56096-40004-45020-21500) 3. Go into the specific products and attach each individual item I, along with others I'm sure, can handle the whole bulk import of individual products as well as importing the product that will be a pack. But a module that we can import the ID of the pack item along with IDs of the individual products in that pack would be desired. I'm not sure if I am wording this all correctly, but in my mind that is what would be easiest? I could be wrong.. 1 Link to comment Share on other sites More sharing options...
Beluga Posted November 1, 2013 Share Posted November 1, 2013 (edited) Yeah I was kind of thinking too complicated at first.. With this great modification to the AdminImportController, we can import stuff to the warehouse when using advanced stock management. Thus I only have to create a module to turn the "packs-to-be" products into actual packs by looking at the references of the products and matching them. It also has to get the quantity value of the packs and move it to the "quantity of product in pack" and reset the quantity imported from the original CSV to zero. Edited November 1, 2013 by Beluga (see edit history) Link to comment Share on other sites More sharing options...
Beluga Posted November 3, 2013 Share Posted November 3, 2013 I've come to the point where I have a working solution, even though the code logic might be a bit "blunt" because of my inexperience. I hope someone might be able to make my code more beautiful and then you could try to adapt it to your own reference naming system. Link to comment Share on other sites More sharing options...
AscentMedia Posted November 7, 2013 Author Share Posted November 7, 2013 Hey, So I just am looking over your posts and curious as to how it is working out? Is it still written to only work with your setup? Would hate to try and install it and only end up frustrated! Thanks, Jordan Link to comment Share on other sites More sharing options...
Beluga Posted November 7, 2013 Share Posted November 7, 2013 Hey, So I just am looking over your posts and curious as to how it is working out? Is it still written to only work with your setup? Would hate to try and install it and only end up frustrated! Thanks, Jordan Yes, you would have to modify it to match your naming scheme, but I guess it wouldn't be that hard (I have commented the code quite thoroughly). It works ok even though it doesn't give confirmation messages. However, Samar's import modifications would IMO need to be modified in a way that we can import straight into a warehouse and not have to do an update specified with the product IDs. This would save a lot of hassle. But Samar hasn't answered yet and I haven't yet taken a proper look at his code. If you use Samar's importer, note that you have to always specify a unit price in the CSV when adding quantities to warehouse. Link to comment Share on other sites More sharing options...
bentstep Posted June 20, 2014 Share Posted June 20, 2014 i have had intermittent success with importing the pack table using phpMyadmin. my problem is that i cannot determine what part of my process is causing the intermittent failures. my process: i first import all of the components of my packs (with Store Manager). then i import the "packs" as individual products (again with Store Manager). then i change the "cache_is_pack" for those products to a "1". then i use phpMyAdmin to import the ps_pack table. this has worked in the past, but maybe i am missing a step because i am not seeing the components of my pack showing up. you can see it working here (sorry, the SSL cert isn't up to date, yet): https://cat.classroomlibrarycompany.com/curriculum-kits-name/18926-bullied-what-every-parent-teacher-and-kid-needs-to-know-about-ending-the-cycle-of-fear-9781456949723.html and here it's not: https://ss.classroomlibrarycompany.com/index.php?id_product=1461&controller=product any input on what i could be doing differently would be greatly appreciated. thanks. Link to comment Share on other sites More sharing options...
ultimatebondagerope Posted August 9, 2014 Share Posted August 9, 2014 has anyone found a stable solution to this problem? I would be VERY interested to hear about it Link to comment Share on other sites More sharing options...
bentstep Posted August 18, 2014 Share Posted August 18, 2014 dear ultimate, i have not found an application. however, i have found that the process noted above is in the right order and should hit all of the important steps. the problem i was running into was that the data has to be immaculately clean. if there are any duplicate rows, it will choke. also (and this one really got me), be aware of any white space rows at the top or bottom. for some reason the application for import likes to add these on its own and these are also seen as duplicates... which cause it to choke. sorry. it's not necessarily a solution, but this is what was tripping me up. good luck. bs Link to comment Share on other sites More sharing options...
ultimatebondagerope Posted August 20, 2014 Share Posted August 20, 2014 @hi benstep, in the end I decided to use Presta Pricing. it's a desktop application that connects to the shop DB. It does the job although you need a bit of time to understand how the whole thing works... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now