VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: Cococoder on August 16, 2019, 10:05:23 AM

Title: BOM added in cart module in category view [SOLVED]
Post by: Cococoder on August 16, 2019, 10:05:23 AM
Hi guys,
PHP Version   7.3.8
Joomla! 3.9.11 Stable
VirtueMart 3.4.2
Template Vmbeez3

As stated in the subject, BOM is added to the cart module and shift the module content down. (https://blog.seobytes.eu/wp-content/uploads/2019/08/bom.jpg)
Same issue with Horme3 but only when an item is added to the cart.
I checked with notepad++ that the files involved were correctly encoded in UTF-8 and not with UTF-8 DOM.  First suspects were index.php and mod_virtuemart_cart/default.php but they come out clear so no luck with that. Furthermore that doesn't add up with the fact issue is only in category view and home page.

I cleared the browser cache and joomla cache, tried different browsers but issue persists.

I'd be glad if you guys could check if you have this BOM marker in your code. it is invisible but can shif content down and is displayed as red dot in firefox developper console.  In google developper console it shows as "
                     "

I suspect the issue comes from the ajax script updating the content of the module but couldn't locate it so far.

Community help is greatly appreciated.

Title: Re: BOM added in cart module in category view
Post by: Studio 42 on August 16, 2019, 11:15:46 AM
Your code seems to be not the core module. If not, check with the dev of this module.
Title: Re: BOM added in cart module in category view
Post by: Cococoder on August 16, 2019, 12:13:47 PM
Hi Studio 42,

Thanks for having a look at my post. I am using VirtueMart Shopping Cart by The VirtueMart Development Team.  I am using Vmbeez3  without any override.

I am currently checking files for BOM on my servers but did not find anything convincing so far.
Title: Re: BOM added in cart module in category view
Post by: Cococoder on August 16, 2019, 12:25:04 PM
Well unsurprisingly, this was a third party payment plugin that interfere with the rendering of the otherwise core cart module.
I SSH into the shared hosting, found the file using this code:
find -type f|while read file;do [ "`head -c3 -- "$file"`" == $'\xef\xbb\xbf' ] && echo "found BOM in: $file";done
Encoded it in UTF-8 with notepad++
and uploaded back to the server.

Thanks again for stopping by Studio 42
Title: Re: BOM added in cart module in category view [SOLVED]
Post by: AH on August 16, 2019, 12:53:04 PM
Thanks for the update - glad you found it

Any chance you can let others know the plugin name?
Title: Re: BOM added in cart module in category view [SOLVED]
Post by: Cococoder on August 16, 2019, 14:33:11 PM
That's a localized payment plugin for a small language group. Not maintained anymore. Not sure it is very useful. Plus I had to modify it to add more payment method so I might have introduced the error at some point.
For all these reasons, I thought it more important to focus on the method rather than the specific plugin or files.