I'm not sure if this is a bug or just me, but it doesn't seem to matter what I put in this field I get a comma - I need a space.

Also, my SKU needs to incorporate a combination of colour and size (taxonomy terms). This module does this perfectly but it puts size and then colour and I need it the other way around. I've made sure they are in the correct order in the product display fields and manage fields. What dictates the order they present in?

Comments

sven.lauer’s picture

Wait---if you want to change what is put in the TITLE, you need to change the "Separator for combination field labels in titles" (this is the one that defaults to a comma, so I THINK this is what you want to do?)

With respect to the token-ordering issue, I see you have found #1265258: Obey field order in bulk_defaults:combination_labels token, where this has been reported already.

sven.lauer’s picture

Status: Active » Postponed (maintainer needs more info)
sven.lauer’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Seeing as this looks a LOT like a misunderstanding of the fields, and I haven't heard back, I am closing this as Works as Designed.

nelslynn’s picture

Version: 7.x-1.0-beta3 » 7.x-2.x-dev
Status: Closed (works as designed) » Active
StatusFileSize
new36.55 KB
new61.35 KB

This is now an issue with 7.x-2.x-dev version, along with other issues:

- When a SKU pattern of: [bulk_defaults:entered_sku]-[bulk_defaults:combination_values] is selected, you get a SKU such as: VTRK-27-3-6-8. The numbers after the VTRK are the tids (Taxonomy IDs), not values.
- Then when you select a pattern of: [bulk_defaults:entered_sku]-[bulk_defaults:combination_labels], no matter what you select for a separator, you get a comma (as this issue indicate above). Plus you get taxonomy Values, not labels. See screenshot

dpico’s picture

Issue summary: View changes

@nelslynn, the behaviour you refer in #4 is exactly what I get. I'm using rc6.

Did anyone find a solution for this? Both issues you describe are a problem for happily using commerce BPC.

Cheers

Infinitee’s picture

nelslynn and dpico are correct, commas in SKU are not conducive to a proper SKU value. If you have commas in an SKU of a Drupal commerce product that has multiple attributes and attempt to add that product to cart before changing the attribute options the attempt fails and you get an error message:

Product SKU Love-Gun-8.5x11-25.00 does not exist.

The comma and any white space for that matter should be stripped and validated before bulk creation.

Anybody know how to fix this?

Infinitee’s picture

StatusFileSize
new24.1 KB

How to auto BPC SKU Patterns without commas....

To not , have commas applied to Drupal commerce BPC SKUs, on the admin/commerce/config/commerce_bpc page, patterns tab, set both of the separator patterns to something other than a comma.

Store > configuration > Bulk product creation > Display node settings

How to auto BPC SKUs without commas

geekgirlcoding’s picture

On commerce_bpc.module, change from
$new_product->sku = token_replace($extras['sku_pattern'], $data, array('sanitize' => FALSE));

To:

  $temp = token_replace($extras['sku_pattern'], $data, array('sanitize' => FALSE));
  // Strip white space
  $temp1 = str_replace(" ", "", $temp);
  // Turn commas into dashes
  $temp2 = str_replace(",", "-", $temp1);
  // Make uppercase
  $temp_final = strtoupper($temp2);
  $new_product->sku = $temp_final;
  $new_product->title = token_replace($extras['title_pattern'], $data, array('sanitize' => FALSE));