Discussions

Automated imports and Attributes

I just found this project while looking around Ubercart. So I am not really up to speed on the differences and capabilities. Sorry.

I am working with a client on a project that will have several "wrinkles".

First, they sell several items with different colored fabrics. This should work like traditional product options where the user must choose a color. Some colors have pricing variances too. The client will need nice images associated with each color. Is this something Commerce handles (maybe cleaner than Ubercart)?

Secondly, the client needs to be able to update pricing through an unattended, automated process. We will have on our end a script that downloads a csv of all product data. Some custom php code processes that csv and ..... then what? Are there hooks for doing this, or is manhandling the database a better solution. (I started looking at the way Ubercart databased attributes, and didn't like what I saw at a quick glance.) Any ideas on how to handle this kind of thing?

Thanks.

Posted: Nov 2, 2011

Comments

hal on November 2, 2011

PS -- I forgot but the pricing and also qty on hand (including for each product attribute items) need to be part of the import.

Prince Manfred on November 2, 2011

There are hooks for almost anything you can think of from my experience. I'm doing some similar automated product updating (Price, stock, automatic metadata aggregation for books) and the system has been really flexible for trying multiple approaches. Commerce Feeds definitely works, but I was having a hard time programatically executing a feed import after confirming that I had received valid data from my supplier and formatted to how I needed it. I switched to handling it manually. As long as you have the sku in your csv file, you can load up the product entity tied to it, make the changes, and save it back.

For product variations you'll probably want to create a different product for each variation. This lets you have different price, stock, images, descriptions, etc for each variation. Drupal Commerce has the concept of separating products from product displays. All of these seperate products would be added to one product display. Customers would go to the display node and be able to switch between each product with a combobox. It feels just like changing a product attribute but gives you a lot more flexibility on the backend.

hal on November 4, 2011

Thanks for the info. Much appreciated!

I am trying to avoid the separate product approach for each variant as there something like 33 variants, and probably 20 or so real products that will have all these variants. I realize its a one time data entry crunch but I am lazy that way ;-)