[Skip to main content](#vessel-content)

#   QR code: fatal error when using PDFSerial - HikaSerial plugin

##

- **[Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile")**
- [![Frank.Oehlen's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar50131.jpg)](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile") Topic Author
- [ Offline](/forum/user/50131-frank-oehlen)

Less More

- Posts: 20
- Thank you received: 1
-
-
-
- [](http://stattgarde.de)
-

9 years 3 weeks ago [\#282059](#282059) by [Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile")  *[QR code: fatal error when using PDFSerial - HikaSerial plugin](/forum/17-serial-how-to/892676-qr-code-fatal-error-when-using-pdfserial-hikaserial-plugin#282059 "-- url of the page with the problem -- : stattgarde.de -- HikaShop version -- : 3.2.1 -- HikaSerial version -- : 2.0.0 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi! I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to &quot;QR Code&quot; into the field below I copied the following:   stattgarde.de/index.php?option=com&#95;hikas...k=consume&amp;hikaserial &#91;serial&#95;data&#93;={serial.serial&#95;data}&amp;hikaserial&#91;format&#93;=html&amp;tmpl=component When I set the order on &quot;shipped&quot; to create the email with the PNG and PDF I get the following error: Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch&#95;2017/joomla3x/administrator/components/com&#95;hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100 What might be the mistake?  When I chance it to &quot;barcode&quot; it works. But I do need an QRcode.....  Regards, Frank")* was created by *[Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile")*

-- url of the page with the problem -- : stattgarde.de
-- HikaShop version -- : 3.2.1
-- HikaSerial version -- : 2.0.0
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6

Hi!
I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to "QR Code" into the field below I copied the following:
*[ stattgarde.de/index.php?option=com\_hikas...k=consume&amp;hikaserial](http://stattgarde.de/index.php?option=com_hikaserial&ctrl=serial&task=consume&hikaserial)\[serial\_data\]={serial.serial\_data}&amp;hikaserial\[format\]=html&amp;tmpl=component*
When I set the order on "shipped" to create the email with the PNG and PDF I get the following error:
**Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch\_2017/joomla3x/administrator/components/com\_hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100**
What might be the mistake?

When I chance it to "barcode" it works. But I do need an QRcode.....

Regards,
Frank

- [ ![PDFSerial.png](/forum/attachment/41262) ](/forum/attachment/41262 "PDFSerial.png") [ ](/forum/attachment/41262?download=1 "PDFSerial.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vODkyNjc2LXFyLWNvZGUtZmF0YWwtZXJyb3Itd2hlbi11c2luZy1wZGZzZXJpYWwtaGlrYXNlcmlhbC1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 3 weeks ago [\#282061](#282061) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[QR code: fatal error when using PDFSerial - HikaSerial plugin](/forum/17-serial-how-to/892676-qr-code-fatal-error-when-using-pdfserial-hikaserial-plugin#282061 "-- url of the page with the problem -- : stattgarde.de -- HikaShop version -- : 3.2.1 -- HikaSerial version -- : 2.0.0 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi! I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to &quot;QR Code&quot; into the field below I copied the following:   stattgarde.de/index.php?option=com&#95;hikas...k=consume&amp;hikaserial &#91;serial&#95;data&#93;={serial.serial&#95;data}&amp;hikaserial&#91;format&#93;=html&amp;tmpl=component When I set the order on &quot;shipped&quot; to create the email with the PNG and PDF I get the following error: Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch&#95;2017/joomla3x/administrator/components/com&#95;hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100 What might be the mistake?  When I chance it to &quot;barcode&quot; it works. But I do need an QRcode.....  Regards, Frank")*

Hello,

Indeed if you're using "attach serial" and "pdf serial" in the same time ; you will got a conflict between "PHPQRCode" and "TCPDF".
Unfortunately, TCPDF created a class named "QRCode" based on the lib "PHPQRCode" but with a lot of modifications.
Both lib are using the same name for their classes and these classes are not compatible.
So for the moment you should not use both libs in the same time.

And I will see what I can do to avoid that ; since I do not like to modify official libs because it makes the updates a living hell.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vODkyNjc2LXFyLWNvZGUtZmF0YWwtZXJyb3Itd2hlbi11c2luZy1wZGZzZXJpYWwtaGlrYXNlcmlhbC1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile")**
- [![Frank.Oehlen's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar50131.jpg)](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile") Topic Author
- [ Offline](/forum/user/50131-frank-oehlen)

Less More

- Posts: 20
- Thank you received: 1
-
-
-
- [](http://stattgarde.de)
-

9 years 3 weeks ago -  9 years 3 weeks ago [\#282094](#282094) by [Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile")  Replied by *[Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile")* on topic *[QR code: fatal error when using PDFSerial - HikaSerial plugin](/forum/17-serial-how-to/892676-qr-code-fatal-error-when-using-pdfserial-hikaserial-plugin#282094 "-- url of the page with the problem -- : stattgarde.de -- HikaShop version -- : 3.2.1 -- HikaSerial version -- : 2.0.0 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi! I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to &quot;QR Code&quot; into the field below I copied the following:   stattgarde.de/index.php?option=com&#95;hikas...k=consume&amp;hikaserial &#91;serial&#95;data&#93;={serial.serial&#95;data}&amp;hikaserial&#91;format&#93;=html&amp;tmpl=component When I set the order on &quot;shipped&quot; to create the email with the PNG and PDF I get the following error: Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch&#95;2017/joomla3x/administrator/components/com&#95;hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100 What might be the mistake?  When I chance it to &quot;barcode&quot; it works. But I do need an QRcode.....  Regards, Frank")*

Hi Jerome!

Thanks for your reply! It's a pitty that it will not work propper...
I know that changing official thinks makes updating not that comfortable ![:-)](/media/kunena/emoticons/3.png ":-)")
Never the less - would it work, if the class QRcode would be renamed? Even if the file has to be changed very time an update has been done.... It might be a silly question for you - but it there might be a "work around" I would prefer that.... ![:-)](/media/kunena/emoticons/3.png ":-)")))))

Regards,

Frank

Last edit: 9 years 3 weeks ago by [Frank.Oehlen](/forum/user/50131-frank-oehlen "View Frank.Oehlen's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vODkyNjc2LXFyLWNvZGUtZmF0YWwtZXJyb3Itd2hlbi11c2luZy1wZGZzZXJpYWwtaGlrYXNlcmlhbC1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 3 weeks ago [\#282103](#282103) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[QR code: fatal error when using PDFSerial - HikaSerial plugin](/forum/17-serial-how-to/892676-qr-code-fatal-error-when-using-pdfserial-hikaserial-plugin#282103 "-- url of the page with the problem -- : stattgarde.de -- HikaShop version -- : 3.2.1 -- HikaSerial version -- : 2.0.0 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi! I tried to configurate the PDFSerial. There is no problem to integrate the serialnumber or the customers name. But I do have problems with integrating the QR code. I do use the dynamic text (like I do with the AttachSerial) and set it to &quot;QR Code&quot; into the field below I copied the following:   stattgarde.de/index.php?option=com&#95;hikas...k=consume&amp;hikaserial &#91;serial&#95;data&#93;={serial.serial&#95;data}&amp;hikaserial&#91;format&#93;=html&amp;tmpl=component When I set the order on &quot;shipped&quot; to create the email with the PNG and PDF I get the following error: Fatal error: Cannot redeclare class QRcode in /homepages/36/d78750134/htdocs/relaunch&#95;2017/joomla3x/administrator/components/com&#95;hikaserial/inc/tcpdf/include/barcodes/qrcode.php on line 100 What might be the mistake?  When I chance it to &quot;barcode&quot; it works. But I do need an QRcode.....  Regards, Frank")*

Hello,

Well, one solution would be to add that line Code:

namespace hikaserial\lib\phpQRCode;

At the very beginning of every file in the "inc/phpqrcode/" folder.

Then in the "inc/qrcode.php" file use Code:

if(!class_exists('hikaserial\lib\phpQRCode\QRencode'))

And Code:

$this-&gt;factory = hikaserial\lib\phpQRCode\QRencode::factory($level, $pixelPerPoint, $outerFrame);

To right use the namespace for the checks.

And I think it should avoid your issue.
For what I could see, there is no special usage of external classes in the lib PHPQRCode so, it should not require extra modification to handle the root namespace (but I can't be entirely sure without a lot of tests).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vODkyNjc2LXFyLWNvZGUtZmF0YWwtZXJyb3Itd2hlbi11c2luZy1wZGZzZXJpYWwtaGlrYXNlcmlhbC1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.066 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
