Closed (fixed)
Project:
Ubercart Feed Mappers
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
18 Jan 2011 at 19:57 UTC
Updated:
13 Feb 2014 at 11:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dubs commentedHi Maj,
I haven't added it yet actually as we didn't need it for the project I developed this for initially. Take a look in the code and you should see how it works - it's really simple I think (and hope!).
If you want to let me have a patch I can add it in, and if you want to help maintain then send me a PM. Any help would be very much appreciated as I'm always very busy on clients' Drupal projects and my family which sadly leaves little time for much else!
Thanks,
Dubs
Comment #2
micheleannj commentedI figured it out pretty quick. Patch to follow!
Ditto on the work-and-family issues. I'm not sure if my coding skills are up to snuff to take on a module (this will be my first submitted patch actually), but why don't I submit a patch or two and we can discuss...
cheers,
m
Comment #3
dubs commentedGreat - glad you got it to work. Looking forward to the patch. I have found one small bug in the attributes too, so I'll submit the new code for this at the same time.
Comment #4
micheleannj commentedOK, here's my first attempt at a patch!
Comment #5
dubs commentedThanks for that! I've commited the patch to HEAD.
Comment #6
martinbutt commentedHi,
The changes from the patch don't appear to be in the latest version and now the patch will not apply.
Thanks
Comment #7
megachrizThe code had been in HEAD, but it was removed a week later (January 26). See commitdiff:
http://drupalcode.org/project/uc_feeds.git/commitdiff/c76d1b80076b683567...
Comment #8
summit commentedSubscribing, greetings, Martijn
Comment #9
megachrizI've been working on reimplement the stock mappers, but I also found other things in the code I was not happy with, such as incorrect uses of t().
I ended up changing so much, that it is going to be hard to deliver a patch for every change, so that it's why I now post a single patch.
Changes:
- Corrected t().
- Renamed targets: the 'short' target name now starts with the name of the module the target belongs to, followed by a property.
- In uc_feeds_feeds_set_target() the target parameter is exploded in two pieces: module name and target name. In a switch() it checks first to which module the target belongs and based on that it performs things with the target. For example, assumed is that every target from 'uc_product' is just a node property.
- To get uc_feeds compatible with Ubercart 2.4 there is a check if the function uc_attribute_load_multiple() exists, which means you will still need the dev version of Ubercart if you want to make use of importing attributes, but you can stay with Ubercart 2.4 if you do not need to import attributes.
- Removed comments with dpm().
- Several coding standards fixes.
Comment #10
brandonratz commentedSubscribing.
This works great. For a product database of nearly 1000 and stock updated daily this is a massive time saver.
Comment #11
pebosi commented#9 is working for me, too. Thanks.
Comment #12
dimitriseng commented@MegaChriz and Dubs
Thank you for this very useful module and for the new functionality added.
I have tested #9 using Ubercart 6.x-2.dev (10-Jun-2011) and I can confirm that the stock levels are working correctly. However, as mentioned in the comments in the code, the stock threshold is not handled yet so that could be an improvement.
As explained in #9, quite a few changes have been made to the original code (uc_feeds-6.x-1.x-dev 2011-Feb-25), so it would be good to know if these will be commited or if the original code will be used going forward. This is because a few other patches have been suggested for adding some of the other uc fields which I have tested and are working ok, but these are based on the original source code. These fields are length, width, height, default quantity, package quantity and shippable.
It might be a good idea to consolidate the following patches into one and then commit. I have applied all these patches together with this one and have modified those appropriately so that these are inline with #9 and everything seems to be working as expected.
These patches are in the following issues:
#1100528: Length, width, height, default & package qty
#1164478: Add shippable field workaround
#1088066: Stock level updates?
Let me know of your thoughts on this, thank you very much.
Comment #13
vaccinemedia commentedHow do I apply the patch? I tried using git and got the following:
root@lamp modules/uc_feeds# git apply 1031700-stock-and-other-improvements-9.patch
1031700-stock-and-other-improvements-9.patch:236: trailing whitespace.
$sQuery = "INSERT INTO {uc_product_stock} (sku, nid, active, stock) VALUES ('%s', %d, %d, %d)";
warning: 1 line adds whitespace errors.
Comment #14
dubs commentedHi there,
I haven't got GIT access setup at the moment so updating the module it really tricky. I guess for now you'll have to patch and one day hopefully my account will be able to submit code again!
Thanks for providing patches...
Dubs
Comment #15
dimitriseng commentedHi all, I have not seem any action around the development of this module lately, are there any plans to add new functionality soon, or having a release? If yes, please check my comments at #12, there are quite a few things that have changed since the original dev version and it would be nice to have a formal release that includes all of this new functionality. Thank you.
Comment #16
Quarantine commentedHi dimitriseng,
Referring to your comments at #12, could you share the module with the modified code where you applied those 3 patches and modified it accordingly so that the three patches would work in tandem?
Thank you!
Comment #17
kallekwd commentedI tried patch from #9, but didn't get it work properly.
First it seemed to work fine, because in "node/1/edit/stock" page stock seemed to be active and stock number was right, but in database at "uc_product_stock" table, the nid was zero. Because of this, I couldn't use Views Bulk Operations and Ubercart Bulk Stock Updater with imported products.
In my case, stock is always same at import stage. So I ended up leaving the stock out of import and used Ubercart Product Power Tools to set default value for stock.
Comment #18
marc angles commentedHi,
dimitriseng is right in #12.
I also have applied these patchessome time ago and find out that it was working pretty well.
I'd love to have a new release for this module. Since all these patches are stuck in the queue it more and more difficult to contrib to this projet.
The only one issue I have today is :
doing a brand new importation of +3000 products, all stock level seems to be there but not "active"... Only 2 products have "active" stock... (I'm investigating this)
Comment #19
marc angles commentedAlso, to add to the list of patches and tests to do :
http://drupal.org/node/1088066#comment-4207782 (I'll test this today)
Comment #20
sdfoui commentedHello
Is this going to be ported to D7 ?
thanks
Comment #21
Robin Millette commentedI'm working on integrating this patch with a few others:
Stay tuned for a new dev release out soon. Thanks to Dubs for granting me commit rights, MegaChriz for the big contribution and everybody else who pitched in.
Comment #22
Anonymous (not verified) commentedsubscribe
Comment #23
dubs commentedI think this was applied. Please reopen if not.
Comment #24
GregoryThomasFox commentedHi when applying this patch all ubercart mapping fields come up as missing and I get this error message: Notice: Undefined variable: content_type in uc_feeds_feeds_processor_targets_alter() (line 15 of /home/linweb07/w/workwear-safety.co.uk/user/htdocs/sites/all/modules/uc_feeds/uc_feeds.module).