Skip to content

Commit d8c9889

Browse files
committed
core: fixes before release (ACORN-800)
1 parent 5df5313 commit d8c9889

File tree

1 file changed

+6
-2
lines changed
  • public_html/extensions/paypal_commerce/storefront/controller/responses/extension

1 file changed

+6
-2
lines changed

public_html/extensions/paypal_commerce/storefront/controller/responses/extension/paypal_commerce.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,20 @@ public function main()
269269
}
270270

271271
// cut description (paypal api requirements. See Order->create->purchase_units->description)
272-
$charsPerItem = round(100 / count($cartProducts));
272+
$charsPerItem = round(120 / count($cartProducts));
273273
$data['order_description'] = '';
274274
foreach ($orderDescription as $desc) {
275-
$postfix = $desc['sku'] . ' x ' . $desc['quantity'];
275+
$postfix = ' x ' . $desc['quantity'];
276276
if (mb_strlen($desc['title']) > ($charsPerItem - strlen($postfix))) {
277277
$data['order_description'] .= mb_substr($desc['title'], 0, ($charsPerItem - strlen($postfix) - 3)) . '...' . $postfix . " ";
278278
} else {
279279
$data['order_description'] .= $desc['title'] . ' ' . $postfix . "\n";
280280
}
281281
}
282+
//this description cannot be more than 127 chars length
283+
$data['order_description'] = mb_strlen($data['order_description'])>127
284+
? mb_substr($data['order_description'],0,127 )
285+
: $data['order_description'];
282286

283287
//build submit form
284288
$form = new AForm();

0 commit comments

Comments
 (0)