Add "clone" link to admin/commerce/products to make it easy to clone products (like node_clone)

Comments

realityloop’s picture

+1

Scott J’s picture

Agree!

rszrama’s picture

Do you think we really need to clone products or product types? Or both? : )

Scott J’s picture

I was only thinking about products. I don't use many product types, so that doesn't bother me.

Scott J’s picture

I've just been inputting some new products, and come to think of it, SKU, title and image have to be different for each product anyway, so there really isn't anything to clone!

torgospizza’s picture

Would this speed up the process of creating products with multiple attributes? I'd love to be able to use one product entity as the "base product" and then create a bunch of variants based on that. Seems like cloning is the best answer to how to do that.

realityloop’s picture

I also think it only really makes sense for Products

videographics’s picture

Yes, clone products please.

mossy2100’s picture

I think it would be good to be able to clone either. What I don't understand is why product types aren't content types, and why products aren't nodes. If so, then things like node_clone would work already. You wouldn't have to replicate a whole heap of functionality written for nodes.

I'm guessing I'm not the only one who feels this way. If there is some rationale for the current architecture, please post a link so I can read why it was done this way. If there's a discussion on this matter, please let me know :)

rszrama’s picture

This was one of the earliest decisions we made, based particularly on the fact that in Drupal 7, everything shouldn't be a node. The conversation here is probably a little bit dated, but this was the spark: http://www.drupalcommerce.org/node/49

karol haltenberger’s picture

Both!

torgospizza’s picture

Agreed, cloning product types would be a great idea, especially if those product types come with a set of predefined fields. It makes adding, say, cloning a "Shirt" type to make "Hoodies" - especially if I don't have to go into Hoodies and add every field again.

artatac’s picture

sub

damien tournoud’s picture

Component: User experience » Contributed modules

I'm moving this to the contributed queue.

- The product type "cloning" is more a feature request against the Field API / Field UI itself. There is a corresponding issue in the core queue: #100925: Add "OO" bundle inheritance features
- The product cloning is waiting on a generic entity cloning UI. It's purely a UI issue at this stage, as cloning an entity is mostly trivial

videographics’s picture

Entities to the rescue... again! Don't ya love it?! :-)

adamgerthel’s picture

Subscribing

hawkdrupal’s picture

I fear that tossing this desired Commerce capability into the broader "future Drupal" wish-list means it will NOT be implemented anytime soon.

I think one-click Product cloning is essential to Commerce, and could even affect whether the Commerce gets adopted, since almost all other e-commerce systems I've evaluated already have this ability.

For more, see this:
http://drupal.org/node/1202682#comment-5056190

videographics’s picture

While Commerce (bulk product creation) won't clone an existing product, it may be of some help to those requesting the clone feature because they have a need to create a bunch of related products:
http://drupal.org/project/commerce_bpc

liupascal’s picture

Subcribing...

torgospizza’s picture

@liupascal:

You no longer have to comment to subscribe to threads. Just click the green "Follow" button at the top of the page.

davidgj’s picture

hey guys

I am trying to open a store on my existing website to raise some funds for educational project. I would like create a "store" menu on my top menu and a list of several products in store page. Is there anyone could tell me how to create the store menu and make sure those several created products will show up in the store page. thanks in advance.

David

rfay’s picture

@davidgj, you need to stay with the topic on an issue, not hijack it. Your request would fit better in the forums at http://drupalcommerce.org.

starsinmypockets’s picture

I'm also looking for this functionality for an existing site, at the request of the site administer.

FrancescoUK’s picture

Removed as OT comment, I've realised later that we are talking about products and not product display.

adamgerthel’s picture

@FrancescoUK, when you say

They perfectly work for me and when I open a product node (not content type) ...

Are you referring to products or product displays? Products are not nodes, they are a different type of entity.

agileadam’s picture

I've created a simple sandbox project that offers product cloning.

http://drupal.org/sandbox/agileadam/1540050

leanderl’s picture

agileadams Sandbox project seems to do exactly what I been wanting since day one of trying Commerce. Not being able to clone complex products with small variations makes commerce really time consuming and tedious. Bulk creation is good, but there are a lot of instances where it isn't the right solution in the real pragmatic world of product creation. For instances if you need to assign an individual image to each slightly different product.
Big thanks for sharing!

brephraim’s picture

Any chance of "Clone product type" functionity?

mausolos’s picture

So how/when does the agileadams sandbox project become a real module? Still waiting on this, wish I had time to work on it for the community myself...

agileadam’s picture

@mausolos,
I'm really sorry about this... I've been swamped with other projects. It's on my todo list to make promote this to a full project.
I cannot give you an ETA, but you're not the first person to ask, so I'll try to address it really soon.
-Adam

grn’s picture

Yes! The product clone/copy feature would be cool when you get a set of new colors for a specific product. I know about the http://drupal.org/project/commerce_bpc module, but it seems it "only" creates multiple products.

It would be cool to do a pattern after type of feature to similar products or when superseeding products.

Thanks for this kewl product!

ontwerphuis’s picture

Yes this is exactly what we need! I run a online training site and have over 80 courses that need to be cloned per course quarter. This will make the admin much easier as they are all base courses with new dates - no other changes. ;):) YAY!

summit’s picture

@ontwerphuis see #26, this is working great!
greetings, Martijn

ontwerphuis’s picture

@ Summit Thanks!

jalves’s picture

That is really important, at least product cloning. Anyone knows when this could be available?

leanderl’s picture

If you use the inline entity form you could try the patch for "clone button" that I'm trying to get into that module
http://drupal.org/node/1590146

mossy2100’s picture

Having given this a little more thought, I think a "clone entity" feature or module would be considerably more useful overall than simply "clone product". Then you could use it to clone users, nodes, terms, files, products, relations, etc. Is there any such module in the works?

jalves’s picture

I found this http://drupal.org/node/1758758 (dev version) i've just installed to test it, it works for product cloning.
I'll have to try the #36.

rszrama’s picture

@mossy2100 Exactly our thoughts - cloning isn't specific to product entities or bundles, so I'd rather there be a generic solution that "just works" for Commerce, too. : )

klonos’s picture

mausolos’s picture

@klonos: bundle_inherit seems to be more about entire entity types, not specific instances of an entity type. So this would be like, "make a clone of Basic Page", as opposed to "clone Basic Page node #42". The latter might produce node #43 (for instance), and fill in all the fields from #42.

It would appear that the developers of the entity API have, in fact, included an $op function for "clone" which does everything we want it to, I think. I believe it is "simply" a matter of inserting the appropriate code into Commerce entities so that they can utilize it.

From entity.api.php:

* - admin ui: (optional) An array of optional information used for providing an
* administrative user interface. To enable the UI at least the path must be
* given. Apart from that, the 'access callback' (see below) is required for
* the entity, as well as the 'ENTITY_TYPE_form' for editing, adding and
* cloning. The form gets the entity and the operation ('edit', 'add' or
* 'clone') passed. See entity_ui_get_form() for more details.

http://drupalcontrib.org/api/drupal/contributions%21entity%21entity.modu...
http://drupalcontrib.org/api/drupal/contributions%21entity%21includes%21...
http://drupalcontrib.org/api/drupal/contributions%21entity%21includes%21...

This makes me think that it would probably be better to put this into Commerce instead of making an external module; it's a basic, optional function of entities, and products should just be able to do it.

mausolos’s picture

I wasn't satisfied with my approach last post of dumping everything in someone else's lap, so I did a little more research:

Profile2 apparently implements the clone entity functionality
(reference to an Entities API example: http://drupal.org/node/1021576)

but there have been some issues with it:
http://drupal.org/node/1317446

Things only very recently have been resolved (maybe?):
http://drupal.org/node/1513812

so maybe sitting and waiting a bit to see if/when they release an Entities update, and how the Profile2 issue resolves, then just copying whatever they are doing with Profile2 :)

klonos’s picture

Thanx for linking to these issues Charles. I'm following them. What you say makes total sense.

rob c’s picture

Has any work been done on this already? I'm willing to chip in some time and get a patch going.
Has any work been done by anyone, or is this still at brainstorm/planning stage?

mausolos’s picture

Hey Rob,

This link in particular indicates that work is being done on the Entity API side of things, any day now we should see a repo update, I would think:
http://drupal.org/node/1513812

My sense is, there might be some work you can do now based on the patch (and omg, it would be very welcome!), but it may be best to just wait until the patch is at least applied to dev? I haven't tried the patch myself, yet. Maybe just see if that alone solves this issue, as well?

strr’s picture

Any news here or a timeline for release of that feature?

strr’s picture

This is a must have feature ?

summit’s picture

Hi, this is working for me: http://drupal.org/sandbox/agileadam/1540050
greetings, Martijn

dave kopecek’s picture

#48 Saved my morning. Props to agileadam for Commerce Product Clone module.

bojanz’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Inline Entity Form has a clone button nowadays.