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