Page 1 of 1

SVG Logo For Opencart 3?

Posted: Wed Sep 16, 2020 12:25 am
by kk651
Hello everyone,

This is my first post and question in the forum. My humble apologies if my post breaks some rules and structure here.

I want to use a logo as SVG, not as JPG or PNG. I noticed several threads and extensions for earlier versions of OC. However no solution for OC 3.x
Any tips how to overcome the issue?

For the record, I'm using Journal 3.x as a theme yet I'm ready to give it off in case it will be an obstacle to SVG logo.
Thanks!

Re: SVG Logo For Opencart 3?

Posted: Wed Sep 16, 2020 5:57 pm
by paulfeakins
kk651 wrote:
Wed Sep 16, 2020 12:25 am
For the record, I'm using Journal 3.x as a theme yet I'm ready to give it off in case it will be an obstacle to SVG logo.
You should probably avoid Journal even if it does support SVG :P

Re: SVG Logo For Opencart 3?

Posted: Wed Sep 16, 2020 6:07 pm
by letxobnav
However no solution for OC 3.x
no solution for what?

Re: SVG Logo For Opencart 3?

Posted: Wed Sep 16, 2020 6:26 pm
by khnaz35
kk651 wrote:
Wed Sep 16, 2020 12:25 am
Hello everyone,

This is my first post and question in the forum. My humble apologies if my post breaks some rules and structure here.

I want to use a logo as SVG, not as JPG or PNG. I noticed several threads and extensions for earlier versions of OC. However no solution for OC 3.x
Any tips how to overcome the issue?

For the record, I'm using Journal 3.x as a theme yet I'm ready to give it off in case it will be an obstacle to SVG logo.
Thanks!
Check this topic: viewtopic.php?t=128253

Re: SVG Logo For Opencart 3?

Posted: Wed Sep 16, 2020 7:30 pm
by JNeuhoff
kk651 wrote:
Wed Sep 16, 2020 12:25 am
I want to use a logo as SVG, not as JPG or PNG. I noticed several threads and extensions for earlier versions of OC. However no solution for OC 3.x
Any tips how to overcome the issue?

For the record, I'm using Journal 3.x as a theme yet I'm ready to give it off in case it will be an obstacle to SVG logo.
Thanks!
I don't know about Journal, I strongly suggest to stay away from this extra framework, as it doesn't comply with OpenCart standards and is hopelessly bloated.

In order to support SVG in OpenCart 3.0.x, you'd have to modify the file 'admin/controller/common/filemanager.php'

Replace

Code: Select all

$files = glob($directory . '/' . $filter_name . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}', GLOB_BRACE);
with

Code: Select all

$files = glob($directory . '/' . $filter_name . '*.{jpg,jpeg,png,gif,svg,JPG,JPEG,PNG,GIF,SVG}', GLOB_BRACE);
Replace

Code: Select all

					// Allowed file extension types
					$allowed = array(
						'jpg',
						'jpeg',
						'gif',
						'png'
					);
with

Code: Select all

					// Allowed file extension types
					$allowed = array(
						'jpg',
						'jpeg',
						'gif',
						'png',
						'svg'
					);
And finally, replace

Code: Select all

					// Allowed file mime types
					$allowed = array(
						'image/jpeg',
						'image/pjpeg',
						'image/png',
						'image/x-png',
						'image/gif'
					);
with

Code: Select all

					// Allowed file mime types
					$allowed = array(
						'image/jpeg',
						'image/pjpeg',
						'image/png',
						'image/x-png',
						'image/gif',
						'image/svg+xm'
					);
Do above changes via an OCmod XML script.

Once done, you should able to upload a SVG file via the System > Settings > edit > Image > Store Logo

Re: SVG Logo For Opencart 3?

Posted: Wed Sep 16, 2020 9:15 pm
by IP_CAM
Some Mods for SVG + WebP can be found here:
viewtopic.php?f=190&t=186311&p=799547#p799547

Re: SVG Logo For Opencart 3?

Posted: Thu Sep 17, 2020 6:27 am
by kk651
Thank you for all your responses. I have tried all solutions suggested, except for the response of IP_CAM. Will give a try and keep you posted.

@letxobnav apologies for short pointout. No solution specifically for OC 3.x to use SVG file as a logo.
All in all, do you suggest using SVG as a logo in an OC page?

Re: SVG Logo For Opencart 3?

Posted: Fri Apr 01, 2022 11:30 am
by phpscript7
this ocmod file can help you