Magento – Dashes added to SKU within order

ce-1.7.0.2configurable-productorders

Good morning guys,

Something odd I've noticed. When I'm purchasing a configurable product, within the order 3 dashes get added to the SKU.

For example:

A configurable product has the SKU of pickmewine, and the simple product has an SKU of PD101. In the order, the SKU of the actual item ordered becomes PD101—.

Is this normal? If so – how do I reliably remove the dashes? I'm linking into an internal business system and using a str_replace isn't an option as there may be legitimate dashes in an SKU.

Related to this, in the order, I get 2 items for each config products bought. Is using $order->getAllVisibleItems() the best way around that?

Thanks all

Best Answer

Check for spaces in the SKU field of your custom options:

enter image description here

See Mage_Catalog_Model_Product_Type_Abstract::getOptionSku() for the reason why.

Related Topic