function get_order_parcel_string($order) {
global $parcel_sizes, $parcel_contents;
- $parcel_size = "";
+ $parcel_size = null;
for ($i = 0 ; $i < count($parcel_sizes); $i++) {
if ($order->getParcel() & (1 << $i)) {
$parcel_size = $parcel_sizes[$i];
if ($order->getParcel() & (1 << $i)) $selected[] = $parcel_contents[$i];
}
- return implode(": ", array($parcel_size, implode(", ", $selected)));
+ $ret = implode(": ", array($parcel_size, implode(", ", $selected)));
+ $ret = preg_replace('/^: /', '', $ret);
+ $ret = preg_replace('/: $/', '', $ret);
+
+ return $ret;
}
function get_order_displayname($order) {