Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adiciona suporte ao download da segunda via
Download realizado atraves da pagina de detalhes do pedido, do usuario
- Loading branch information
1 parent
95dbe40
commit 35c6074
Showing
4 changed files
with
119 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<modification> | ||
<name>PagSeguro Checkout Transparente</name> | ||
<code>valdeir_pagseguro_checkout_transparente</code> | ||
<version>2.0</version> | ||
<author>Valdeir S.</author> | ||
<link>https://valdeir.dev</link> | ||
|
||
<file path="catalog/view/theme/default/template/account/order_info.twig"> | ||
<operation> | ||
<search> | ||
<![CDATA[{{ continue }}]]> | ||
</search> | ||
<add position="before"> | ||
<![CDATA[ | ||
{% if boleto %} | ||
<div class="pull-left"><a href="{{ boleto }}" class="btn btn-primary" target="_blank">{{ button_download_boleto }}</a></div> | ||
{% endif %} | ||
]]> | ||
</add> | ||
</operation> | ||
</file> | ||
</modification> |
29 changes: 29 additions & 0 deletions
29
upload/catalog/controller/event/extension/payment/pagseguro.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
class ControllerEventExtensionPaymentPagSeguro extends Controller | ||
{ | ||
const EXTENSION_PREFIX = 'payment_pagseguro_'; | ||
|
||
/** | ||
* Evento | ||
* trigger: catalog/view/account/order_info/before | ||
*/ | ||
public function boleto2(&$route, &$data) | ||
{ | ||
$order_id = $this->request->get['order_id'] ?? 0; | ||
|
||
$this->load->model('extension/payment/pagseguro'); | ||
|
||
$info = $this->model_extension_payment_pagseguro->getTransactionInfo($order_id, [ | ||
'payment_link', | ||
'o.order_status_id' | ||
]); | ||
|
||
if ( | ||
isset($info['payment_link']) && | ||
$this->config->get(self::EXTENSION_PREFIX . 'order_status_pending') == $info['order_status_id'] | ||
) { | ||
$data['boleto'] = $info['payment_link']; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters