Closed (fixed)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 May 2009 at 22:24 UTC
Updated:
1 Apr 2012 at 17:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rszrama commentedHey Martijn, I'm not familiar myself, but you'll have much better luck finding like minded developers in our forums.
Comment #2
cedarm commentedThis is a fairly simple hook to implement, at least for the basic fields. I'd like to see this added to core uc_product.module. Alternatively this can be submitted to the feedapi_mapper project as mappers/feedapi_mapper_uc_product.inc, but I think it makes more sense for it to live inside uc_product. What do you think?
This is the implementation I'm using right now:
Edit: uc_product_node_is_product() was removed in ubercart-6.x-2.0-rc4. Changed (uc_product_node_is_product($node->type)) to (in_array($node->type, uc_product_types())).
Comment #3
kostajh commented@cedarm, thanks! this is very helpful. It works fine for me.
Comment #4
summit commentedHi, what would be the mapper for feeds (www.drupal.org/project/feeds) while feedelement_mapper will become obsolete?
Thanks for considering building this for feeds also!
greetings, Martijn
Comment #5
cedarm commented@Summit, I didn't know about the feeds project until just now. Looks like a noble effort. Since I have already moved on to other projects, I won't be updating or working with feeds any time soon, so don't hold your breath. Hopefully our project will take off like crazy and I'll get to do more work on it... :)
Comment #6
presich commentedGuys, will be this feature (mapper to ubercart fields) added to the Feeds module soon?
Does anybody know???
Comment #7
cedarm commentedI don't know if anyone else is working on Feeds integration, but I plan to soon. Who wants to help with testing?
We should probably start a new feature request issue for Feeds integration.
Comment #8
presich commentedI think I could.
Comment #9
wesleydv commentedBased on #2 I created uc_products.inc. Place this file in the feeds/mappers folder and you wil be able to import Model, List price, Cost & Sell price via Feeds
Comment #10
presich commented))))))
I've written the same file yesterday but don't post it yet here.
For me it's work fine.
Comment #11
eileenmcnaughton commentedHi,
I implemented this & it works but I also want to import stock levels. Am I right in thinking this has to be done as a separate import because the node hasn't been created when the import hook is called?
I see the product edit for calls this function
db_query("UPDATE {uc_product_stock} SET active = %d, stock = %d, threshold = %d WHERE sku = '%s'",
$form_state['values']['stock'][$id]['active'] ? 1 : 0, intval($form_state['values']['stock'][$id]['stock']),
intval($form_state['values']['stock'][$id]['threshold']), $form_state['values']['stock'][$id]['sku']);
Comment #12
cedarm commentedI'm going to step out here and say feedapi_mapper is pretty much dead now. I'm changing this issue to Feeds integration. Cleaned up and made a patch out of #9.
Comment #13
Kraftway commentedHi,
I have applied file from #9 and it works fine. But there is another problem: how to map the feed elements to Ubercart product attributes? I think the attributes might be pre-created via admin UI Attributes, the problem is that different products could have different attributes set. Is this possible to map the only needed attributes to every product node from feed elements? And many thanks again to @cedarm! )
Comment #14
dubs commentedHi there,
I have taken the patches from above and added some code to support product weights and attributes too.
The product had to be created first in order to add attributes to it, so this module uses hook_nodeapi to add them at "insert".
There is a new project release on this page: -
http://drupal.org/project/uc_feeds
If anyone fancies adding to the code (for stock etc..) or helping to maintain then please let me know.
Thanks,
Dubs
Comment #15
Anonymous (not verified) commenteduc_feeds looks good, will give it a try.
Looks like we can close this issue now. Future issues should be filled against the uc_feeds module.
Comment #16
Webpark commentedNeed help with this. I want to import and map ubercart auctions rather than ubercart products. The properties are starting price, expiry date, expiry time and check that the product is an auction. Any development help would be appreciated.
Thanks.