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 need to migrate data into Drupal Commerce, the weight & the size of the object.
How could I do that ?
I try $this->addFieldMapping('field_prod_weight', 'weight') but it didn't work.
Do I need arguments ?
Comment | File | Size | Author |
---|---|---|---|
#13 | 0001-Migrate-Support.patch | 6.09 KB | ayalon |
#12 | physical-1626578-12.patch | 5.52 KB | jcisio |
#10 | physical-migrate-support-1626578-10.patch | 3.33 KB | bleedev |
#8 | physical-migrate-support-1626578-8.patch | 4.46 KB | fearlsgroove |
#7 | migrate_extras_physical_dimension_weight-1626578-7.patch | 2.78 KB | cameron prince |
Comments
Comment #1
johnvDo you use the Migrate module? Feeds-module integration works fine with this patch: #1372070: Integrate with Feeds (Patch Ready)
Comment #2
Gilles_C CreditAttribution: Gilles_C commentedYes, I'm working with migrate.
Comment #3
delta CreditAttribution: delta commentedFor the physical_weight field use this class as fieldHandler arguments :
use with:
Comment #4
delta CreditAttribution: delta commentedfor the Physical dimensions field use this fieldHandler
use with :
in prepareRow migrate method i prepare the dimensions row value:
and don't forget to add 'dimensions' to source_fields argument of MigrateSource
Comment #5
Gilles_C CreditAttribution: Gilles_C commentedThanks a lot ! I'll try this week.
Comment #6
mikeryanSee also #1671108: Support for physical_weight field - one of these should be marked a dupe of the other. The other issue has the advantage of having a patch...
Comment #7
cameron prince CreditAttribution: cameron prince commentedI tried this and weight worked perfectly, but dimensions wasn't working. I updated it based on code from addressfield and it seems to be working now.
Comment #8
fearlsgroove CreditAttribution: fearlsgroove commentedHere's an updated patch with subfield support. Marking the other as a dupe
Comment #9
dwkitchen CreditAttribution: dwkitchen commentedTested and works
Comment #10
bleedev CreditAttribution: bleedev commentedUpdated patch using subfields for dimensions. Length is the dimension key and weight is the weight key.
Comment #11
johnvbetter title for my dashboard.
Comment #12
jcisio CreditAttribution: jcisio commentedNew patch, based on #10, but:
Tested with all the 3 dimensions and the weight field. But I'm not going to RTBC my patch.
Comment #13
ayalon CreditAttribution: ayalon commentedThe patch in #12 is not working, if you have a single value field and no values on the entity.
I made a new patch.
Comment #14
DaleTrexelI was going to ask a question about the behavior of the patch I was seeing, but in the process of writing my question, I discovered the source of my problem. (Applying the patch to Commerce Kickstart's profile structure did not go as error-free as I'd thought.) I've now got it working, and it appears to be working smoothly for me.
So, instead I'd just like to thank you all for the work you put into this patch! It's quite useful and I hope it gets approved and implemented.
Comment #15
ayalon CreditAttribution: ayalon commentedIf you want this patch to be commited, set the status to reviewed.
Comment #16
DaleTrexelHow much authority does it take to set the status to reviewed? I can say that the patch is working for me, but I'm not exactly the right person to tell whether it meets Drupal's coding standards.
Comment #17
mikl CreditAttribution: mikl at Liip commented#13 works great, thanks.
Comment #18
KarlShea#13 also worked for me.
Comment #20
bojanz CreditAttribution: bojanz commentedCommitted, thanks.