Page 1 of 1

TAB - Paypal Express Checkout in order view

Posted: Thu Oct 12, 2017 5:29 am
by reflexweb
When looking at the order details in Order, the tab
PayPal Express Checkout
shows the following error, can anyone help me on this bug? OC Version 3.0.2.0
Thanks in advance, Roger

Code: Select all

Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unexpected token "string" of value "Completed" ("name" expected) in "extension/payment/pp_express_transaction.twig" at line 25.' in /var/sites/g/foobar/public_html/system/library/template/Twig/TokenStream.php:87 Stack trace: #0 /var/sites/g/foobar/public_html/system/library/template/Twig/Extension/Core.php(304): Twig_TokenStream->expect(5) #1 /var/sites/g/foobar/public_html/system/library/template/Twig/Extension/Core.php(277): Twig_Extension_Core->getTest(Object(Twig_Parser), 25) #2 [internal function]: Twig_Extension_Core->parseTestExpression(Object(Twig_Parser), Object(Twig_Node_Expression_GetAttr)) #3 /var/sites/g/foobar/public_html/system/library/template/Twig/ExpressionParser.php(48): call_user_func(Array, Object(Twig_Parser), Object(Twig_Node_Expression_GetAttr)) #4 /var/sites/g/foobar/public_html/system/library/template/Twig/ExpressionParser.php(78): Twig_ExpressionParser->parseExpression() in /var/sites/g/foobar/public_html/system/library/template/Twig/TokenStream.php on line 87

Re: TAB - Paypal Express Checkout in order view

Posted: Thu Oct 12, 2017 5:51 am
by yodapt
Edit /admin/view/template/extension/payment/pp_express_transaction.twig, and replace line 25 with :

Code: Select all

{% if transaction.payment_type == 'instant' and (transaction.payment_status == 'Completed' or transaction.payment_status == 'Partially-Refunded') %}
You probably want to use the Theme Editor to change that file. Make sure to refresh cache afterwards in any case.

Source : https://github.com/opencart/opencart/co ... 05de1f4807

Re: TAB - Paypal Express Checkout in order view

Posted: Fri Jun 08, 2018 1:13 am
by ardragifts
Yay it worked... but I had to replace the whole file text... when I just did that line 25, I got errors on line 24 lol
But no error now, so thank you VERY much ;)
Is this a theme error or OC error? ... just curious :)
Nancy

Re: TAB - Paypal Express Checkout in order view

Posted: Tue Jun 12, 2018 5:41 am
by reflexweb
Had same problem and added a missing

Code: Select all

{% endif %}
to Line 29.

Line 25 to Line 30 inclusive

Code: Select all

	  {% if transaction.payment_type == 'instant' and (transaction.payment_status == 'Completed' or transaction.payment_status == 'Partially-Refunded') %}
      <a href="{{ transaction.refund }}" data-toggle="tooltip" title="{{ button_refund }}" class="btn btn-danger"><i class="fa fa-reply"></i></a>&nbsp;
      {% else %}
      <button type="button" value="{{ transaction.resend }}" data-toggle="tooltip" title="{{ button_resend }}" class="btn btn-info"><i class="fa fa-refresh"></i></button>
      {% endif %}
	  {% endif %} </td>
Tested and working ok now on my installation

Re: TAB - Paypal Express Checkout in order view

Posted: Mon Aug 05, 2019 7:51 pm
by swiftws
reflexweb
will you please advise where did you add this extra code , i mean within which file ?

Re: TAB - Paypal Express Checkout in order view

Posted: Sat Apr 04, 2020 1:56 am
by ahlmab
In case it helps anyone, I had to use both solutions provided here to fix the problem. After that, it worked perfect. OC 3.0.2.0.