Add a flag for types of products or variations to generate/delete

Created on 28 June 2024, 3 months ago
Updated 1 July 2024, 3 months ago

Problem/Motivation

I have a few types of products and variations and I would like this tool to be able to only generate specific types of those.

With devel_generate we can use:
drush devel-generate:content 10 --bundles=article
to create 10 articles or even:
drush devel-generate:content 0 --bundles=article --kill
to delete all articles.

I would like to be able to do something similar:
drush devel-generate:commerce --products_num=10 --product-type=car
drush devel-generate:commerce --product_variations_num=10 --product-type=car
or
drush devel-generate:commerce --products_num=0 --product-type=car --kill
drush devel-generate:commerce --product_variations_num=0 --product-type=car --kill
to get rid of only those products etc.

Feature request
Status

Active

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom the_g_bomb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @the_g_bomb
  • 🇬🇧United Kingdom the_g_bomb

    FYI, I discovered a better way to remove the products and variations, so flagging 0 entities with kill is no longer needed to remove them

    drush entity:delete commerce_product_variation --bundle=car
    drush entity:delete commerce_product --bundle=car
    
  • 🇲🇩Moldova andrei.vesterli Chisinau

    Hey @the_g_bomb

    It looks like there is no such command in https://docs.alphanodes.com/drush/drush10.html 10.x version for drush. It's better to have "devel" way drush commands. I am not sure when I'll find some time to do that but not now.

    Thx for your ideas and findings.

    Best,
    Andy

Production build 0.71.5 2024