2

I am trying to write a custom taxonomy for handling product variations for an ecommerce plugin (DukaPress).

What if I was to add another Custom Taxonomy called "Product Variations" to hold the variations' names. People could create any Named variation and then the Variations under that term.

Example:

  • T-Shirt Colors ( top level taxonomy term )
    • Red
    • Blue
    • Green
  • T-Shirt Sizes ( top level taxonomy term )
    • Small
    • Medium
    • Large

And so on and so forth...

The idea is to not only let people create these taxonomies but also assign product quantities to them. This will be handled by way of a meta box.

Then the Meta Box function will create the variations and size fields from checking off the needed variations.

The only problem I cannot think of a solution for is that the Meta Box needs to generate the Variation Quantity Meta Box based on what taxonomies are clicked when creating the product in the post edit screen. How can I do that without asking the user to save the draft? Do you know of a way that I can dynamically have the Meta Boxes created? Perhaps place a Meta Box with just a button in it that is Labeled "Create Variations" that adds the correct variations when clicked. Kind of like the default custom fields.

Can anyone help with ideas?

1
  • 2
    This is a pretty old post, but if you ever came up with a solution you should post it here! If not, my suggestion would be to use WooCommerce. Since it's based on Custom Post Types, you can setup Custom Taxonomies just like always, which I think would resolve what you're asking! Commented Feb 13, 2012 at 6:48

1 Answer 1

1

Your solution would be to handle the requests via . You'll have to save data on the fly (based on input length or by the click of a button).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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