Post by kk651 » 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!

Newbie

Posts

Joined
Sun Aug 30, 2020 8:46 pm

Post by paulfeakins » Wed Sep 16, 2020 5:57 pm

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

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by letxobnav » Wed Sep 16, 2020 6:07 pm

However no solution for OC 3.x
no solution for what?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by khnaz35 » Wed Sep 16, 2020 6:26 pm

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

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by JNeuhoff » Wed Sep 16, 2020 7:30 pm

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

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by IP_CAM » Wed Sep 16, 2020 9:15 pm

Some Mods for SVG + WebP can be found here:
viewtopic.php?f=190&t=186311&p=799547#p799547

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by kk651 » Thu Sep 17, 2020 6:27 am

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?

Newbie

Posts

Joined
Sun Aug 30, 2020 8:46 pm

Post by phpscript7 » Fri Apr 01, 2022 11:30 am

this ocmod file can help you

Attachments


New member

Posts

Joined
Wed Jan 04, 2017 3:55 pm
Who is online

Users browsing this forum: No registered users and 74 guests