commit 12c253296f11ea30c30765838b89652ef33eb6fb Author: Kaloyan Date: Thu Apr 9 18:24:53 2026 +0200 Plugin O2W Facturas PrestaShop - Versión Final diff --git a/modules/o2wfacturas/o2wfacturas.php b/modules/o2wfacturas/o2wfacturas.php new file mode 100644 index 00000000..827333d2 --- /dev/null +++ b/modules/o2wfacturas/o2wfacturas.php @@ -0,0 +1,42 @@ +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'); + } +} \ No newline at end of file diff --git a/modules/o2wfacturas/views/templates/hook/boton_factura.tpl b/modules/o2wfacturas/views/templates/hook/boton_factura.tpl new file mode 100644 index 00000000..63aef088 --- /dev/null +++ b/modules/o2wfacturas/views/templates/hook/boton_factura.tpl @@ -0,0 +1,14 @@ +
+

Factura de tu pedido

+

Tu factura ya ha sido procesada por nuestro sistema. Puedes descargarla en formato PDF aquí:

+ + {if $url_factura_erp} + + Descargar Factura O2W + + {else} +
+ La factura todavía no está disponible. +
+ {/if} +
\ No newline at end of file diff --git a/themes/hummingbird/templates/customer/history.tpl b/themes/hummingbird/templates/customer/history.tpl new file mode 100644 index 00000000..54797ac1 --- /dev/null +++ b/themes/hummingbird/templates/customer/history.tpl @@ -0,0 +1,87 @@ +{** + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + *} +{extends 'customer/page.tpl'} + +{block name='page_title'} + {l s='Order history' d='Shop.Theme.Customeraccount'} +{/block} + +{block name='page_content'} +

{l s='Here are the orders you\'ve placed since your account was created.' d='Shop.Theme.Customeraccount'}

+ + {if $orders} +
+
+
+ + {l s='Order reference' d='Shop.Theme.Checkout'} + + + {l s='Date' d='Shop.Theme.Checkout'} + + + {l s='Total price' d='Shop.Theme.Checkout'} + + + {l s='Payment' d='Shop.Theme.Checkout'} + + + {l s='Status' d='Shop.Theme.Checkout'} + + + {l s='Invoice' d='Shop.Theme.Checkout'} + + +
+ + {foreach from=$orders item=order} +
+ + {$order.details.reference} + + + {$order.details.order_date} + + + {$order.totals.total.value} + + + {$order.details.payment} + + + + {$order.history.current.ostate_name} + + + + {* AQUÍ ESTÁ NUESTRO BOTÓN ROJO MODIFICADO *} + + Descargar + + + + + + {l s='Details' d='Shop.Theme.Customeraccount'} + + + {if $order.details.reorder_url} + + + {l s='Reorder' d='Shop.Theme.Actions'} + + {/if} + +
+ {/foreach} +
+
+ {else} + + {/if} +{/block} \ No newline at end of file