Hello.
This module is just what I need for a product import and to let me client update a large number of products from a spreadsheet on a daily basis. The only thing missing is Stock levels. I'll try and take a stab at adding this functionality myself, but I wanted to check if there was anything already in-the-works or any documentation/examples that could help me out...
I'm interested in contributing to this modules maintenance and development however possible!

Thanks,
maj

Comments

dubs’s picture

Hi 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

micheleannj’s picture

I 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

dubs’s picture

Great - 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.

micheleannj’s picture

Status: Active » Needs review
StatusFileSize
new1.86 KB

OK, here's my first attempt at a patch!

dubs’s picture

Status: Needs review » Closed (fixed)

Thanks for that! I've commited the patch to HEAD.

martinbutt’s picture

Hi,

The changes from the patch don't appear to be in the latest version and now the patch will not apply.

Thanks

megachriz’s picture

Status: Closed (fixed) » Needs work

The 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...

summit’s picture

Subscribing, greetings, Martijn

megachriz’s picture

Status: Needs work » Needs review
StatusFileSize
new11.92 KB

I'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.

brandonratz’s picture

Subscribing.

This works great. For a product database of nearly 1000 and stock updated daily this is a massive time saver.

pebosi’s picture

#9 is working for me, too. Thanks.

dimitriseng’s picture

@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.

vaccinemedia’s picture

How 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.

dubs’s picture

Hi 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

dimitriseng’s picture

Hi 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.

Quarantine’s picture

Hi 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!

kallekwd’s picture

I 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.

marc angles’s picture

Hi,
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)

marc angles’s picture

Also, to add to the list of patches and tests to do :

http://drupal.org/node/1088066#comment-4207782 (I'll test this today)

sdfoui’s picture

Hello
Is this going to be ported to D7 ?
thanks

Robin Millette’s picture

Assigned: Unassigned » Robin Millette

I'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.

Anonymous’s picture

subscribe

dubs’s picture

Status: Needs review » Closed (fixed)

I think this was applied. Please reopen if not.

GregoryThomasFox’s picture

Issue summary: View changes

Hi 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).