angellombana Posted July 21, 2022 Share Posted July 21, 2022 Hello, I have a traceability module, the module works well, but I want to modify a detail, the module puts information at the bottom of the batches in the delivery notes and on the invoices, but I want to eliminate it from the delivery notes, what file should I have? Modify? Link to comment Share on other sites More sharing options...
Ali Samie Posted July 21, 2022 Share Posted July 21, 2022 You need to share your module or give access in DM. Link to comment Share on other sites More sharing options...
angellombana Posted July 23, 2022 Author Share Posted July 23, 2022 (edited) REMOVED Edited July 23, 2022 by endriu107 removed attachment (see edit history) Link to comment Share on other sites More sharing options...
Ali Samie Posted July 23, 2022 Share Posted July 23, 2022 Is this module a free version? If not please do not share this publicly. Send a DM. Link to comment Share on other sites More sharing options...
Ali Samie Posted July 23, 2022 Share Posted July 23, 2022 Please take a screen shot from the exact place that you want it to be removed Link to comment Share on other sites More sharing options...
angellombana Posted July 24, 2022 Author Share Posted July 24, 2022 Link to comment Share on other sites More sharing options...
Ali Samie Posted July 24, 2022 Share Posted July 24, 2022 I searched for "Lotes usados" in that module. I found two templates for 1.6 and 1.7 with this name hook/t16/displayPdf.tpl and hook/t17/displayPdf.tpl Then I opened the main file of module with this name lotes_caducidada.php and searched for this displayPdf and found this hook methods: Link to comment Share on other sites More sharing options...
Ali Samie Posted July 24, 2022 Share Posted July 24, 2022 This is the method that fills data into the PDF template. path: modules/lotes_caducidad/lotes_caducidad.php public function hookdisplayPDFDeliverySlip($params) { $lotes = array(); if(Configuration::get('LOTES_INVOICE')){ $id_lang = Configuration::get('PS_LANG_DEFAULT'); require_once(dirname(__FILE__).'/classes/lotescaducidad.php'); $id_order = (int)Tools::getValue('id_order'); if($id_order == 0){ $id_order = $params['object']->id_order; } $order = new Order($id_order); $pedido = $order->reference; $lotillos = lotescaducidad::LotesdePedido($pedido); foreach ($lotillos as $lotillo){ $id_producto = $lotillo['id_producto']; $product = new Product($id_producto); $nproducto = $product->name[$id_lang]; $ref = $lotillo['ref']; $lote = $lotillo['lote']; $fecha_caducidad = $lotillo['fecha_caducidad']; $ref_ped_lote = $lotillo['pedidos']; $lotes[] = array( 'id_producto' => $nproducto, 'ref' => $ref, 'lote' => $lote, 'fecha_caducidad' => $fecha_caducidad, 'ref-pedido' =>$orden, 'ref-pedido-lote' =>$ref_ped_lote, ); } $this->context->smarty->assign('lotes', $lotes); return $this->display(__FILE__, 'views/templates/hook/t17/displaypdf.tpl'); } } This is the path of the pdf template: v1.7 -> views/templates/hook/t17/displaypdf.tpl v1.6 -> views/templates/hook/t16/displaypdf.tpl You can find those headers that you want to delete in the template Link to comment Share on other sites More sharing options...
Ali Samie Posted July 24, 2022 Share Posted July 24, 2022 As you can see both of the displayPdfInvoice and displayPDFDeliverySlip methods use a single template. You should make a copy of the t17/displayPdf.tpl and t16/displayPdf.tpl with a new name like t17/displayPdfDeliverySlip.tpl and t16/displayPdfDeliverySlip.tpl and then remove the lines that you do not want to be there. Then at the end of this method displayPDFDeliverySlip replace this: 3 minutes ago, stifler97 said: $this->context->smarty->assign('lotes', $lotes); return $this->display(__FILE__, 'views/templates/hook/t17/displaypdf.tpl'); with this: $this->context->smarty->assign('lotes', $lotes); return $this->display(__FILE__, 'views/templates/hook/t17/displayPdfDeliverySlip.tpl'); Link to comment Share on other sites More sharing options...
angellombana Posted July 25, 2022 Author Share Posted July 25, 2022 thanks, but the truth is that it's hard for me to understand the explanation, I still don't know why it doesn't work when I try to delete the line !$this->registerHook('displayPDFDeliverySlip')|| of the php file since I want to eliminate all the content of the delivery note Link to comment Share on other sites More sharing options...
Ali Samie Posted July 25, 2022 Share Posted July 25, 2022 by deleting the line register hook nothing changes, because it is registered in database. If you dont want to have delivery slip pdf files, you should unregister the hook, look for Positions in BO Link to comment Share on other sites More sharing options...
Ali Samie Posted July 25, 2022 Share Posted July 25, 2022 If you need further more support, Please send me a DM with FTP and I will help you soon. Link to comment Share on other sites More sharing options...
angellombana Posted July 25, 2022 Author Share Posted July 25, 2022 Well I think I've done it, thanks for your help. In case someone helps you, we are talking about the "Módulo Trazabilidad y fecha de caducidad" module, delete all the information from displaypdf.tpl and then in the file /lotes_caducidad/lotes_caducidad.php there are 2 paragraphs that you refer to that should be changed $this->context->smarty->assign('batches', $batches); return $this->display(__FILE__, 'views/templates/hook/t17/displaypdf.tpl'); the first belongs to the invoice and the second to the delivery note, so I changed the second and it worked 1 Link to comment Share on other sites More sharing options...
Ali Samie Posted July 25, 2022 Share Posted July 25, 2022 I am glad it was helpful and finally you did the job. 😉🙂 Link to comment Share on other sites More sharing options...
Anchuron Posted October 10, 2022 Share Posted October 10, 2022 I want to know which module you are using for traceability please Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now