This is a patch against uc_multiprice 6.x-2.x-dev (2010-Nov-12) that will provide a helper module with import/update functionality which can be enabled seperately.
With the module prices of existing products can be updated via a character delimited file. This is not a node import module. Prices of nodes are updated based on their SKU, there needs to be an exact match of SKU, no trailing spaces etc.
I've attached a screendump of the 3 steps thru whih one goes to import prices. In the first step one can select a delimited file, set a delimiter and enclosure. In step 2 the file specs are used and one can map column values to the correct fields, configure if the delimited file has a header and select the country or role for which the prices should be updated to the imported values. Step 3 is the batch kicking in...
If using Firewing1's code mentioned in http://drupal.org/node/960884 and applying the patch I've posted here http://drupal.org/node/960884#comment-3769398 this import functionality will also work with i18n sync.
Please test this patch on a non production server (as always) and post back if you find any bugs.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | access.patch | 523 bytes | bartezz |
| #6 | uc_multiprice.theme_.patch | 1.35 KB | bartezz |
| #12 | uc_multiprice_import.multiple_countries.patch | 12.7 KB | bartezz |
| uc_multiprice.extended.import.patch | 18.4 KB | bartezz | |
| import-screens.gif | 42.88 KB | bartezz |
Comments
Comment #1
stefan81 commentedsubscribe
Comment #2
Docc commentedLooking good. Specially like it that you use the batch API.
Though im still not sure if we should add this as a submodule. I dont have time to support issues regarding it and its more work if i want to push out a D7 version.
What about a seperate module? wich you can maintain on your own?
Comment #3
bartezz commentedHi Docc,
Thanx. Well I didn't think there was any other option besides Batch API since it could potentially have to update thousands of nodes... times their translations if you have a multilingual webshop...
I do think it should be a submodule since it's so specifically written for uc_multiprice. I don't think there would be much maintenance as the code is quite simple but I'll see if I can co-maintain if you like. Will have to look into how this works, haven't mainained any module yet.
Cheers
Comment #4
bartezz commented@Stefan, did you give the patch a go and could you report you findings?
Comment #5
Docc commentedSecurity warning :)
'access callback' => TRUEComment #6
bartezz commentedErm... right! Security warning... my bad!
What about
'access arguments' => array('create & edit multiprices'),Also looked over the code and saw i had a todo in there for themable output.
Please check out patch, never done a hook_theme. Hope I've done it right.
Cheers
EDIT: please see http://drupal.org/node/1348096
Comment #7
gbowman commentedHi, currently experimenting with your multiprice import functionality.
Firstly to add a bit of background the store is going to have different prices based on UK, Europe and Rest of World. I am also intending to use the Node Import module.
It would make more sense to me if this function was integrate into Node Import as a supported module. If someone is importing prices, it's quite likely they will be importing all their catalogue information. Quite how that would I don't know, I'm not a developer so can't really help on that front.
Even as it is now (separate import procedure) I kind of imagined it being able to map country prices to columns in the csv, instead I need to upload the same file for each country I want to set a price for (about 27) and map the sell price to the particular column I require.
Would there be any intention to update this to allow just one upload for multiple countries?
Comment #8
gbowman commentedAlso I'm getting this error when I run an import, the import appears to work correctly, just not sure what this is saying...
warning: array_count_values() expects parameter 1 to be array, null given in /var/www/sites/all/modules/uc_multiprice/uc_multiprice_import/uc_multiprice_import.module on line 267.Comment #9
bartezz commentedHi gbowman,
Thanx for your remarks. The price import/update helper module was made to do just that. The client I've developed the module for exports csv files just containing the altered prices on set intervals. Because of maintenance issues I did not opt for integrating this into node_import. It would be much more time consuming to keep the helper module in sync with node_import my conclusion was. So a no fix on this part of the request, sorry.
Your second request about the abillity to import a file once for multiple countries sounds reasonable to me. Instead of a single select drop down element I could turn this into checkboxes maybe. Possibly grouped by continents or currency. Will look into that.
Will also look into the php error you've got upon import. Did you test with a csv with just a single value by any chance?
Cheers
Comment #10
gbowman commentedWhat do you mean by 'a csv with just a single value'? It contains 3 rows and I mapped the SKU and Sell Price, no list or cost price if that's what you were asking?
If there's anything you like me to test by the way, feel free to ask!
Comment #11
bartezz commentedI thought by reading the error you've gotten that maybe the csv only mapped to a single product node no matter if it was just sell price. Guess I was incorrect. Thanx for your reply. Will look into it asap.
Cheers
Comment #12
bartezz commentedHi gbowman,
Try this on for size :) I've added some functionality, the dropdown select now is a series of checkboxes. Which also show the currency that has been set for this country to make it easier to see what countries should possible use the prices from the csv. To make it even more easy the iso currency code (EUR for instance) is clickable and toggles all country checkboxes with the same currency.
Because there's loads of checkboxes you might want to install http://drupal.org/project/multicolumncheckboxesradios which is not a dependency but makes life easier as it will display the checkboxes in 3 columns :)
Let me know if this works for you!
Cheers
Comment #13
bartezz commentedGbowman, did you have time to review yet?