Comments

haza’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB

Here is a patch that adds a way to generate products display with drush.

You need to adds a --display arguments with a comma separated list of node types that you want to generate.

haza’s picture

Issue summary: View changes

Message update

discipolo’s picture

Issue summary: View changes

it doesnt look like this references the generated products on the generated displays yet correct?

MarieKirya’s picture

I was able to use a variation of that patch. I needed currency and max and min.
$ drush genp 50 --display="product_display" --currency_code="USD" --min_price="0" --max_price="50000"

MarieKirya’s picture

StatusFileSize
new2.4 KB

My bad, the patch I put out had an improper file name. Updated.

discipolo’s picture

StatusFileSize
new2.26 KB

drush wont apply #4 cause the patch was made from docroot: docroot/sites/all/modules/contrib/commerce_devel/commerce_devel_generate/commerce_devel_generate.drush.inc: No such file or directory

discipolo’s picture

oh and thanks! it works

nvahalik’s picture

Issue tags: +Commerce Sprint
joelpittet’s picture

Seems very useful to add these, though it doesn't seem to be taking

drush genp 1 --display="product_display" --currency_code="CAD" --min_price="0" --max_price="50"

The price was 400, the currency was USD (and I enabled CAD). I've got no idea if the product_display is working.

  1. +++ b/commerce_devel_generate/commerce_devel_generate.drush.inc
    @@ -18,6 +18,10 @@ function commerce_devel_generate_drush_command() {
    +      'currency_code' => 'Currency to use (i.e. "USD")'
    

    nit: comma at end of line.

  2. +++ b/commerce_devel_generate/commerce_devel_generate.drush.inc
    @@ -40,7 +44,25 @@ function drush_commerce_devel_generate_products($num_products = NULL) {
    +    if (drush_get_option('display', NULL)) {
    

    indent one back ad default is NULL so don't need to add second arg.

  3. +++ b/commerce_devel_generate/commerce_devel_generate.drush.inc
    @@ -40,7 +44,25 @@ function drush_commerce_devel_generate_products($num_products = NULL) {
    +      'min_price' => drush_get_option('min_price'),
    +      'max_price' => drush_get_option('max_price'),
    

    These two values aren't taking...

joelpittet’s picture

Status: Needs review » Needs work
mglaman’s picture

Status: Needs work » Needs review
StatusFileSize
new2.05 KB

Changes are and there, like the following.

  1. +++ b/commerce_devel_generate/commerce_devel_generate.drush.inc
    @@ -40,7 +44,25 @@ function drush_commerce_devel_generate_products($num_products = NULL) {
    +      'kill_content' => drush_get_option('kill'),
    

    This will delete all ndoes. Bad.

  2. +++ b/commerce_devel_generate/commerce_devel_generate.drush.inc
    @@ -40,7 +44,25 @@ function drush_commerce_devel_generate_products($num_products = NULL) {
    +      'node_types' => drupal_map_assoc(explode(',', drush_get_option('display', NULL))),
    

    Needs an array filter for checking if anything empty

mglaman’s picture

Status: Needs review » Fixed

  • mglaman committed ac999c1 on 7.x-1.x
    Issue #1509798 by PavelAK, discipolo, Haza, mglaman, joelpittet,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.