Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wrote an uc_stock implementation.
Can be used to update the ubercart stock from an csv specifying the sku and the stock level. The script resolves skus to node id and updates the stock table, if uc_attributes is enabled it will also search for skus in the attributes table.
It's usable right now i can add more options if requested.
It will be great to include-it in the main distribution.
Comment | File | Size | Author |
---|---|---|---|
uc_stock.inc_.txt | 5.3 KB | joanpc |
Comments
Comment #1
smscotten CreditAttribution: smscotten commentedThis would be awesome, but I'm not seeing it work against 6.x-1.0... or maybe I'm doing it wrong? I put the uc_stock.inc file in the 'node_import/supported/' directory and I don't see stock showing up as an option for mapping to a column in the import at step 4.
Am I looking in the wrong place or adding the file in the wrong place?
Edit to add: yes, I was looking in the wrong place.
OK, I see it in step 6: track stock, yes or no. But how do I tell it which column in the import it should look at for stock?
Comment #2
smscotten CreditAttribution: smscotten commentedOK, I see my issue. Around line 104 of this file is the following:
but $type is never uc_stock. It's always "node:xxxx" where xxxx is the machine readable name of the the content type.
For the time being I'm going to comment out that requirement and play some more but could you shed some light on what that is supposed to be checking?
Comment #3
zeezhao CreditAttribution: zeezhao commentedAlso see latest version of node_import for ubercart referenced on this thread:
http://www.ubercart.org/project/node_import_uc_stock?page=1#comment-58097
Comment #4
joanpc CreditAttribution: joanpc commentedSorry for the long delay I wasn't subscribed to the issue.
I think i misunderstood the hook_node_import_fields() I was just checking that the current user can modify the stock.