- Posts: 5
- Thank you received: 0
Bug in cart module? Wrong font path when loaded outside of com_eshop
- Christoph
- Topic Author
- Offline
- New Member
-
Less
More
1 day 22 hours ago - 1 day 22 hours ago #173681
by Christoph
Bug in cart module? Wrong font path when loaded outside of com_eshop was created by Christoph
Hello,
I noticed a bug in the cart module when it is displayed on non-shop pages (here in the header above a normal article (com_content).
The module throws warnings like:Warning: imagettftext(): Could not find/open font in /components/com_content/helpers/helper.php on line 7332
Cause:
In /components/com_eshop/helpers/helper.php - function processTextWatermark($sourceFile, $watermarkText, $destinationFile) (around line 7280) the font path is built with
$font = JPATH_COMPONENT . '/tcpdf/fonts/' . $watermarkFont;
But JPATH_COMPONENT always points to the current component (e.g. com_content), not to com_eshop.
So the cart module cannot find the font files when rendered outside of the shop component.Fix:
It should use the absolute path to com_eshop instead, for example:
$font = JPATH_SITE . '/components/com_eshop/tcpdf/fonts/' . $watermarkFont;
This way, the cart module will always find the correct fonts, no matter on which page it is displayed.
Or do I overlook something?
Best regards,
Chris
I noticed a bug in the cart module when it is displayed on non-shop pages (here in the header above a normal article (com_content).
The module throws warnings like:Warning: imagettftext(): Could not find/open font in /components/com_content/helpers/helper.php on line 7332
Cause:
In /components/com_eshop/helpers/helper.php - function processTextWatermark($sourceFile, $watermarkText, $destinationFile) (around line 7280) the font path is built with
$font = JPATH_COMPONENT . '/tcpdf/fonts/' . $watermarkFont;
But JPATH_COMPONENT always points to the current component (e.g. com_content), not to com_eshop.
So the cart module cannot find the font files when rendered outside of the shop component.Fix:
It should use the absolute path to com_eshop instead, for example:
$font = JPATH_SITE . '/components/com_eshop/tcpdf/fonts/' . $watermarkFont;
This way, the cart module will always find the correct fonts, no matter on which page it is displayed.
Or do I overlook something?
Best regards,
Chris
Last edit: 1 day 22 hours ago by Christoph.
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
-
- Offline
- Administrator
-
1 day 20 hours ago #173687
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Bug in cart module? Wrong font path when loaded outside of com_eshop
Dear Christoph,
Thank you for reporting me on this. I will check and maybe fix this issue on the next version of EShop.
Sincerely, Giang
Thank you for reporting me on this. I will check and maybe fix this issue on the next version of EShop.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
Moderators: Giang Dinh Truong
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.