0

I currently have a Drupal website for an art gallery with a content type of Listing (A piece of Art work). Each Listing has a price in a decimal field type.

We are now looking to convert the website to ecommerce using Drupal Commerce, but there is about 500 Listings.

Is there a way to bulk copy/create all the Listings into Products and auto create the product reference and copy the price over as well?

2 Answers 2

1

There is no direct option or module which can convert a content type nodes to commerce products. But there are few ways you can do it. You can export your nodes to CSV via node export or views bulk operations and then import those products using commerce feeds module. Another way is to create a custom module and do db_select of all nodes of your particular content type and then create commerce products programmatically. You can use batch process to do this so that php execution time don't break your script.

2
  • Thanks Bharat. Is having 1 product per node the best way of doing this? Or can I have 1 product which gets the price from the node. Would Urber Cart be a better option?
    – IamOnStage
    Sep 14, 2017 at 13:38
  • Drupal commerce works a bit differently. So you will need to create product entities and then nodes to show those product entities onto frontend. A single product node can have one or more product entity in it. If you could share the link of your site then I will be in a better position to answer. Regarding the Drupal commerce vs Ubercart. It depends. Drupal commerce is easy to customize but a bit difficult to maintain in terms of products while Ubercart sometimes get very difficult to customize while it is easy to maintain.based on comparison you can get understanding about what to choose.
    – Bharat
    Sep 14, 2017 at 14:24
0

This is the way I have done this:

Export all nodes of [type] using module Views Data Export https://www.drupal.org/project/views_data_export

Import these as products using Feeds and Commerce Feeds.

Automatically link and manage 1 Product to 1 Node using Auto Product Display https://www.drupal.org/project/commerce_auto_product_display

If anyone wants a more detailed answer as to the exporting/importing/importing with the SKU references, happy to share.

Summary

Use the Nid as the Unique Reference
1. Export Nodes
2. Import as Products
3. Import to existing nodes - but only mapped the SKU field for the product reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.