Post by ywc6xrlnf58asnha » Thu Dec 28, 2017 10:37 am

I get a fatal error on the Paypal Express Checkout tab of an order. Exact location is Admin > Sales > Order. Then click on View next to a order where the customer used Paypal Express Checkout. Scroll down to "Order History" section and click on the tab "Paypal Express Checkout" and the error is displayed.
The original error is:
Fatal error: Uncaught Twig_Error_Syntax: Unexpected token "string" of value "Completed" ("name" expected) in "extension/payment/pp_express_transaction.twig" at line 25. in /home/<removed>/public_html/system/library/template/Twig/TokenStream.php:87 Stack trace: #0 /home/<removed>/public_html/system/library/template/Twig/Extension/Core.php(304): Twig_TokenStream->expect(5) #1 /home/<removed>/public_html/system/library/template/Twig/Extension/Core.php(277): Twig_Extension_Core->getTest(Object(Twig_Parser), 25) #2 /home/<removed>/public_html/system/library/template/Twig/ExpressionParser.php(48): Twig_Extension_Core->parseTestExpression(Object(Twig_Parser), Object(Twig_Node_Expression_GetAttr)) #3 /home/<removed>/public_html/system/library/template/Twig/ExpressionParser.php(78): Twig_ExpressionParser->parseExpression() #4 /home/<removed>/public_html/system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary() #5 /home/<removed>/public_html/system/library/template/Twig/ExpressionParser.php(50): Twig_ExpressionPa in /home/<removed>/public_html/system/library/template/Twig/TokenStream.php on line 87
I applied this fix as suggested here. But I get this new error and not sure what is wrong with the endfor it's complaining about:
Fatal error: Uncaught Twig_Error_Syntax: Unexpected "endfor" tag (expecting closing tag for the "if" tag defined near line 24) in "extension/payment/pp_express_transaction.twig" at line 31. in /home/<removed>/public_html/system/library/template/Twig/Parser.php:172 Stack trace: #0 /home/<removed>/public_html/system/library/template/Twig/TokenParser/If.php(34): Twig_Parser->subparse(Array) #1 /home/<removed>/public_html/system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #2 /home/<removed>/public_html/system/library/template/Twig/TokenParser/For.php(40): Twig_Parser->subparse(Array) #3 /home/<removed>/public_html/system/library/template/Twig/Parser.php(187): Twig_TokenParser_For->parse(Object(Twig_Token)) #4 /home/<removed>/public_html/system/library/template/Twig/TokenParser/If.php(34): Twig_Parser->subparse(Array) #5 /home/<removed>/public_html/system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #6 /home/<removed>/public_html/system/library/template/Twig/Pa in /home/<removed>/public_html/system/library/template/Twig/Parser.php on line 172
Thanks

New member

Posts

Joined
Mon Dec 04, 2017 11:32 am

Post by straightlight » Thu Dec 28, 2017 11:03 am

No OC version posted. Please post your modified TWIG file as an attachment.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ywc6xrlnf58asnha » Thu Dec 28, 2017 11:19 am

OC version 3.0.2.0. Twig file here.

New member

Posts

Joined
Mon Dec 04, 2017 11:32 am

Post by straightlight » Thu Dec 28, 2017 11:23 am

ywc6xrlnf58asnha wrote:
Thu Dec 28, 2017 11:19 am
OC version 3.0.2.0. Twig file here.
You are ... reposting the same file as the above but you are not posting the one you did modified on your own. The request above is about posting the exact one that you did modified on your end as an attachment.

In addition, followed is a free TWIG debug tool that you can use to troubleshoot this issue: https://www.opencart.com/index.php?rout ... n_id=31419

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ywc6xrlnf58asnha » Thu Dec 28, 2017 11:41 am

Thank you for debug tool. The file linked to is identical to the file I'm using. Copy pasted version. Diff shows no difference as I've copied and pasted.

New member

Posts

Joined
Mon Dec 04, 2017 11:32 am

Post by ywc6xrlnf58asnha » Mon Jan 01, 2018 5:17 am


New member

Posts

Joined
Mon Dec 04, 2017 11:32 am

Post by KeithH » Tue Jan 16, 2018 5:14 am

I'm having the same problem as above with Paypal refund in 3.0.2

Updated to the file below and it fixed the paypal tab on a order

****admin/view/template/extension/payment/pp_express_transaction.twig***


<table class="table table-striped table-bordered">
<thead>
<tr>
<td class="text-left">{{ column_transaction }}</td>
<td class="text-left">{{ column_amount }}</td>
<td class="text-left">{{ column_type }}</td>
<td class="text-left">{{ column_status }}</td>
<td class="text-left">{{ column_pending_reason }}</td>
<td class="text-left">{{ column_date_added }}</td>
<td class="text-left">{{ column_action }}</td>
</tr>
</thead>
<tbody>
{% if transactions %}
{% for transaction in transactions %}
<tr>
<td class="text-left">{{ transaction.transaction_id }}</td>
<td class="text-left">{{ transaction.amount }}</td>
<td class="text-left">{{ transaction.payment_type }}</td>
<td class="text-left">{{ transaction.payment_status }}</td>
<td class="text-left">{{ transaction.pending_reason }}</td>
<td class="text-left">{{ transaction.date_added }}</td>
<td class="text-left">{% if transaction.transaction_id %}
<a href="{{ transaction.view }}" data-toggle="tooltip" title="{{ button_view }}" class="btn btn-info"><i class="fa fa-eye"></i></a>
{% 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>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="text-center" colspan="7">{{ text_no_results }}</td>
</tr>
{% endif %}
</tbody>
</table>

***It fixed the tab but upon clicking refund I have this error below now***

Fatal error: Uncaught Twig_Error_Syntax: Unexpected "endfor" tag (expecting closing tag for the "if" tag defined near line 24) in "extension/payment/pp_express_transaction.twig" at line 31. in /home/<removed>/public_html/system/library/template/Twig/Parser.php:172 Stack trace: #0 /home/<removed>/public_html/system/library/template/Twig/TokenParser/If.php(34): Twig_Parser->subparse(Array) #1 /home/<removed>/public_html/system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #2 /home/<removed>/public_html/system/library/template/Twig/TokenParser/For.php(40): Twig_Parser->subparse(Array) #3 /home/<removed>/public_html/system/library/template/Twig/Parser.php(187): Twig_TokenParser_For->parse(Object(Twig_Token)) #4 /home/<removed>/public_html/system/library/template/Twig/TokenParser/If.php(34): Twig_Parser->subparse(Array) #5 /home/<removed>/public_html/system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #6 /home/<removed>/public_html/system/library/template/Twig/Pa in /home/<removed>/public_html/system/library/template/Twig/Parser.php on line 172

Newbie

Posts

Joined
Mon Jan 15, 2018 11:55 pm
Who is online

Users browsing this forum: No registered users and 156 guests