Post by reflexweb » Thu Oct 12, 2017 5:29 am

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

Attachments

Screenshot-2017-10-11-Orders.jpg

screenshot - Screenshot-2017-10-11-Orders.jpg (193.45 KiB) Viewed 2918 times

Last edited by straightlight on Sat Apr 04, 2020 1:59 am, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
Thu Jun 28, 2012 8:06 pm

Post by yodapt » Thu Oct 12, 2017 5:51 am

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

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by ardragifts » Fri Jun 08, 2018 1:13 am

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

Active Member

Posts

Joined
Sun Mar 29, 2015 2:33 pm

Post by reflexweb » Tue Jun 12, 2018 5:41 am

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

New member

Posts

Joined
Thu Jun 28, 2012 8:06 pm

Post by swiftws » Mon Aug 05, 2019 7:51 pm

reflexweb
will you please advise where did you add this extra code , i mean within which file ?

New member

Posts

Joined
Mon Dec 23, 2013 11:00 pm

Post by ahlmab » Sat Apr 04, 2020 1:56 am

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.

Newbie

Posts

Joined
Fri Oct 21, 2016 12:19 am
Who is online

Users browsing this forum: Bing [Bot] and 82 guests