Plugin O2W Facturas PrestaShop - Versión Final

This commit is contained in:
Kaloyan
2026-04-09 18:24:53 +02:00
commit 12c253296f
3 changed files with 143 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
class O2wFacturas extends Module
{
public function __construct()
{
$this->name = 'o2wfacturas';
$this->tab = 'billing_invoicing';
$this->version = '1.0.0';
$this->author = 'Kaloyan - O2W';
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('O2W Facturas ERP');
$this->description = $this->l('Añade un botón en los detalles del pedido para descargar la factura del ERP.');
}
public function install()
{
return parent::install() && $this->registerHook('displayOrderDetail');
}
public function uninstall()
{
return parent::uninstall();
}
public function hookDisplayOrderDetail($params)
{
$url_erp = 'https://demo.erp.one/public/ventas/facturas/e03bbecc-0512-4281-92ac-2d80843deed6';
$this->context->smarty->assign(array(
'url_factura_erp' => $url_erp
));
return $this->display(__FILE__, 'views/templates/hook/boton_factura.tpl');
}
}