unica e-shop Posted October 24, 2020 Posted October 24, 2020 Hi, When i create an order from backoffice, it dosent send email to the costumer and shows the following error: Class 'QRCodeLib' not found in file override/classes/pdf/HTMLTemplateInvoice.php at line 285 Source file: override/classes/pdf/HTMLTemplateInvoice.php 266: $description_short = strip_tags($product->description_short); 267: if (Tools::strlen($description_short) > 90) { 268: $stringCut = Tools::substr($description_short, 0, 90); 269: $description_short = Tools::substr($stringCut, 0, strrpos($stringCut, ' ')).'...'; 270: } 271: $order_detail['description_short'] = $description_short; 272: $order_detail['barcode'] = ''; 273: $code = $template->barcodeproductformat; 274: $text = ''; 275: if($code == 'product_link'){ 276: $text = $product->getLink();//urlencode($product->getLink()); 277: }else{ 278: $text = urlencode($order_detail[$code]); 279: } 280: $filename = md5($template->barcodeproducttype.'_'.$text).'.png'; 281: if(!Tools::file_exists_no_cache(_PS_MODULE_DIR_.'gwadvancedinvoice/views/img/barcodes/'.$filename)){ 282: if($template->barcodeproducttype == 'qrcode'){ 283: $ecc = 0; 284: if($code == 'product_link') $ecc = 1; 285: $qrcodeObj = new QRCodeLib($text,$ecc); 286: $im = $qrcodeObj->createImage(4,2); 287: imagepng($im,_PS_MODULE_DIR_.'gwadvancedinvoice/views/img/barcodes/'.$filename); 288: }else{ 289: $bacodeObj = new Barcode($text,$template->barcodeproducttype); 290: $bacodeObj->getBarcodePNG(_PS_MODULE_DIR_.'gwadvancedinvoice/views/img/barcodes/'.$filename,2,35,array(0,0,0)); 291: } 292: } 293: if(Tools::file_exists_no_cache(_PS_MODULE_DIR_.'gwadvancedinvoice/views/img/barcodes/'.$filename)){ 294: $order_detail['barcode'] = '<img src="'.$base_url.'modules/gwadvancedinvoice/views/img/barcodes/'.$filename.'"/>'; Do you have any solution for it? Thank you.
0 yaniv14 Posted October 24, 2020 Posted October 24, 2020 This has got nothing to do with thirty bees. This error is caused by an override you did for classes/pdf/HTMLTemplateInvoice.php. Maybe you used to have this module "gwadvancedinvoice" that came with some lib named "QRCodeLib" and this module did the override for you and now you are not using this module anymore?
0 unica e-shop Posted October 24, 2020 Author Posted October 24, 2020 hmm ya that module does say me some thing, and correctly i am not using it instead i use: Advanced Invoice Builder, So is there any solution to it?
0 yaniv14 Posted October 24, 2020 Posted October 24, 2020 Just rename this file "override/classes/pdf/HTMLTemplateInvoice.php" to "override/classes/pdf/HTMLTemplateInvoice.php.bak" and delete file "cache/class_index.php" and you should be fine.
0 unica e-shop Posted October 25, 2020 Author Posted October 25, 2020 I did that and now it says: ThirtyBeesException Call to undefined method HTMLTemplateInvoice::assignData() in file override/classes/pdf/PDF.php at line 62 Source file: override/classes/pdf/PDF.php 43: if($customer_group){ 44: $_id_template = (int)Configuration::get('GWADVANCEDINVOICE_GROUP_'.$customer_group, null, $id_shop_group, $id_shop); 45: if($_id_template > 0) $id_template = (int)$_id_template; 46: } 47: }elseif($templatetype == 'HTMLTemplateDeliverySlip'){ 48: 49: $id_template = (int)Configuration::get('GWADVANCEDDELIVERY_TEMPLATE', null, $id_shop_group, $id_shop); 50: $order = new Order((int)$object->id_order); 51: $customer_group = Customer::getDefaultGroupId((int)$order->id_customer); 52: if($customer_group){ 53: $_id_template = (int)Configuration::get('GWADVANCEDIDELIVERY_GROUP_'.$customer_group, null, $id_shop_group, $id_shop); 54: if($_id_template > 0) $id_template = (int)$_id_template; 55: } 56: } 57: include_once(_PS_MODULE_DIR_.'/gwadvancedinvoice/model/gwadvancedinvoicetemplateModel.php'); 58: $templateinvoice = new gwadvancedinvoicetemplateModel((int)$id_template); 59: if(Validate::isLoadedObject($templateinvoice)){ 60: $this->pdf_renderer->AddPage(); 61: $this->pdf_renderer->setCurOrientation($templateinvoice->pagesize,$templateinvoice->pageorientation); 62: $data = $template->assignData($id_template); 63: 64: if($templateinvoice->rtl){ 65: $this->pdf_renderer->setRTL((bool)$templateinvoice->rtl); 66: } 67: 68: if($templateinvoice->activeheader){ 69: $this->pdf_renderer->SetPrintHeader(true); 70: $this->pdf_renderer->createHeader($template->getHeaderGw($data)); 71: }else{ 72: $this->pdf_renderer->createHeader(''); Stack trace
0 datakick Posted October 25, 2020 Posted October 25, 2020 Than do the same with this override file as well: override/classes/pdf/PDF.php Module gwadvancedinvoice installed a couple of overrides. These overrides should be automatically removed when you uninstall the module. I guess you just deleted the module instead of uninstallation. Or the uninstallation process failed. Anyway, your system is now in pretty inconsistent state. You can use 'overridecheck' module to find overrides not associated with any modules, and delete them. You can also install my 'consistency check' module, that will probably detect few issues and help you get rid of them.
0 unica e-shop Posted October 25, 2020 Author Posted October 25, 2020 That did work, thank you both for your great help :), i did use your consistency check and it doesn't show any error.
Question
unica e-shop
Hi,
When i create an order from backoffice, it dosent send email to the costumer and shows the following error:
Class 'QRCodeLib' not found
Source file: override/classes/pdf/HTMLTemplateInvoice.php
Do you have any solution for it? Thank you.
6 answers to this question
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