File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
public_html/extensions/paypal_commerce/storefront/controller/responses/extension Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments