Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2019
    Posts
    23
    Plugin Contributions
    0

    Default Use logo.svg in place of logo.gif or logo.png?

    I’m trying to use a scalable vector graphic (.svg) file in place of a .png or .gif logo. Logo.svg renders properly on the storefront but does not show in customer emails or at the top of the admin interface (where the default image was ZC’s logo.gif).

    The following files were edited to display the svg file:
    • /store/includes/languages/english/email_extras.php - Line # 9 : define ('EMAIL_LOGO_FILENAME', 'logo.svg'); //-File is present in /email folder
    • /store/includes/languages/english/header.php - Line #27 : define('HEADER_LOGO_IMAGE', 'logo.svg');
    • /store/includes/languages/english/custom_template/header.php - Line #27 : define('HEADER_LOGO_IMAGE', 'logo.svg');
    • /store/admin_folder/includes/languages/english.php - Line # 19 : define('HEADER_LOGO_IMAGE', 'logo.svg');
    • /store/admin_folder/includes/languages/english/email_extras.php - Line # 9 : define ('EMAIL_LOGO_FILENAME', 'logo.svg'); //-File is present in /email folder


    logo.svg image is located in the following folders:
    • /custom_template/images
    • /custom_template/store/email
    • /store/admin_folder/images


    In Configuration > Images, I’ve toggled the true/false values for Calculate Image Size and Image Required but the svg logo still doesn’t show in customer emails or admin interface.

    What else can I do to get logo.svg to appear in customer emails and the admin interface? Thanks in advance.

    ZC 1.5.7
    All bugfixes applied to date (#1 – 12)
    responsive_classic template clone (via clone template 1.2.1)
    one page checkout 2.3.4
    local sales tax 2.5.3a
    sales report 3.3.3
    automatic login remember me 2.0.1

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Use logo.svg in place of logo.gif or logo.png?

    At least one change needed is in: admin/.htaccess. The list of allowed extensions needs to include svg changing:
    [code]<FilesMatch "(?i).*\.(php|js|css|html?|ico|otf|jpe?g|gif|webp|png|swf|flv|xml|xsl|csv|txt)$" >[code]
    To something like:
    Code:
    <FilesMatch "(?i).*\.(php|js|css|html?|ico|otf|jpe?g|gif|webp|png|svg|swf|flv|xml|xsl|csv|txt)$">
    Honestly this seems as if it should already be there because later in the file svg extensions are included in the cache control.
    Not sure if that would resolve the email issue, but there may be a similar need in that path as well.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,685
    Plugin Contributions
    9

    Default Re: Use logo.svg in place of logo.gif or logo.png?

    Quote Originally Posted by RoseStar View Post
    I’m trying to use a scalable vector graphic (.svg) file in place of a .png or .gif logo. Logo.svg renders properly on the storefront but does not show in customer emails or at the top of the admin interface (where the default image was ZC’s logo.gif).

    The following files were edited to display the svg file:
    • /store/includes/languages/english/email_extras.php - Line # 9 : define ('EMAIL_LOGO_FILENAME', 'logo.svg'); //-File is present in /email folder
    • /store/includes/languages/english/header.php - Line #27 : define('HEADER_LOGO_IMAGE', 'logo.svg');
    • /store/includes/languages/english/custom_template/header.php - Line #27 : define('HEADER_LOGO_IMAGE', 'logo.svg');
    • /store/admin_folder/includes/languages/english.php - Line # 19 : define('HEADER_LOGO_IMAGE', 'logo.svg');
    • /store/admin_folder/includes/languages/english/email_extras.php - Line # 9 : define ('EMAIL_LOGO_FILENAME', 'logo.svg'); //-File is present in /email folder


    logo.svg image is located in the following folders:

    • /custom_template/images
    • /custom_template/store/email
    • /store/admin_folder/images



    In Configuration > Images, I’ve toggled the true/false values for Calculate Image Size and Image Required but the svg logo still doesn’t show in customer emails or admin interface.

    What else can I do to get logo.svg to appear in customer emails and the admin interface? Thanks in advance.

    ZC 1.5.7
    All bugfixes applied to date (#1 – 12)
    responsive_classic template clone (via clone template 1.2.1)
    one page checkout 2.3.4
    local sales tax 2.5.3a
    sales report 3.3.3
    automatic login remember me 2.0.1
    if you look here:
    includes/functions/functions_email.php:522:

    PHP Code:
    $block['EMAIL_LOGO_FILE'] = $domain DIR_WS_CATALOG 'email/' EMAIL_LOGO_FILENAME
    i do not see you mentioning putting the file there (as bolded above).

    it looks to be needed here:

    store/email/logo.svg

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Use logo.svg in place of logo.gif or logo.png?

    I’m trying to use a scalable vector graphic (.svg) file in place of a .png or .gif logo. Logo.svg renders properly on the storefront but does not show in customer emails or at the top of the admin interface (where the default image was ZC’s logo.gif).
    Nice... one thing to consider, SVG's are not the standard image and behave entirely different! They are a pain to size, but once you understand viewbox, not to hard to do. To view it simply... the follow image is from FontAwesome svg icon of airbnb...
    Code:
    <svg  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path  d="M224 373.12c-25.24-31.67-40.08-59.43-45-83.18-22.55-88 112.61-88  90.06 0-5.45 24.25-20.29 52-45 83.18zm138.15 73.23c-42.06  18.31-83.67-10.88-119.3-50.47 103.9-130.07 46.11-200-18.85-200-54.92  0-85.16 46.51-73.28 100.5 6.93 29.19 25.23 62.39 54.43 99.5-32.53  36.05-60.55 52.69-85.15 54.92-50 7.43-89.11-41.06-71.3-91.09 15.1-39.16  111.72-231.18 115.87-241.56 15.75-30.07 25.56-57.4 59.38-57.4 32.34 0  43.4 25.94 60.37 59.87 36 70.62 89.35 177.48 114.84 239.09 13.17  33.07-1.37 71.29-37.01 86.64zm47-136.12C280.27 35.93 273.13 32 224  32c-45.52 0-64.87 31.67-84.66 72.79C33.18 317.1 22.89 347.19 22  349.81-3.22 419.14 48.74 480 111.63 480c21.71 0 60.61-6.06 112.37-62.4  58.68 63.78 101.26 62.4 112.37 62.4 62.89.05 114.85-60.86  89.61-130.19.02-3.89-16.82-38.9-16.82-39.58z"/></svg>
    As you can see, this is not your standard big byte/little byte image data.. Also the viewbox would fill up your screen.

    So to use this as an logo...
    Code:
    <div  id="logo"><?php echo '<a href="' . HTTP_SERVER .  DIR_WS_CATALOG . '"><svg xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 448 512"><path d="M224  373.12c-25.24-31.67-40.08-59.43-45-83.18-22.55-88 112.61-88 90.06 0-5.45  24.25-20.29 52-45 83.18zm138.15 73.23c-42.06  18.31-83.67-10.88-119.3-50.47 103.9-130.07 46.11-200-18.85-200-54.92  0-85.16 46.51-73.28 100.5 6.93 29.19 25.23 62.39 54.43 99.5-32.53  36.05-60.55 52.69-85.15 54.92-50 7.43-89.11-41.06-71.3-91.09 15.1-39.16  111.72-231.18 115.87-241.56 15.75-30.07 25.56-57.4 59.38-57.4 32.34 0  43.4 25.94 60.37 59.87 36 70.62 89.35 177.48 114.84 239.09 13.17  33.07-1.37 71.29-37.01 86.64zm47-136.12C280.27 35.93 273.13 32 224  32c-45.52 0-64.87 31.67-84.66 72.79C33.18 317.1 22.89 347.19 22  349.81-3.22 419.14 48.74 480 111.63 480c21.71 0 60.61-6.06 112.37-62.4  58.68 63.78 101.26 62.4 112.37 62.4 62.89.05 114.85-60.86  89.61-130.19.02-3.89-16.82-38.9-16.82-39.58z"/></svg></a>';  ?>
    it has to be hard codded into a page or used in css as I do.

    Search online for instructions... but in short, the zen_image( well fail to render svg's... And... images like png, jpg can be responsive if you size by percentage width or height, but not both at the same time...
    Dave
    Always forward thinking... Lost my mind!

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Use logo.svg in place of logo.gif or logo.png?

    The most important thing to note about HTML-formatted email is that most email clients have very poor support for modern technologies.
    Don't count on every recipient's email software being able to understand SVG let alone display it correctly.
    Are you sure that all the people receiving your emails are using ultra-modern email software?

    At this present time I'd strongly advise using PNG or JPG for emails, and avoid SVG.


    Related:
    https://css-tricks.com/a-guide-on-svg-support-in-email/
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Oct 2019
    Posts
    23
    Plugin Contributions
    0

    Default Re: Use logo.svg in place of logo.gif or logo.png?

    Excellent, the .htaccess change was quick and I'm taking the advice to not rely on email clients to render .svg files. I'll use .png for customer emails.

    Thanks all.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,683
    Plugin Contributions
    123

    Default Re: Use logo.svg in place of logo.gif or logo.png?

    Remember too that images in emails are heavily cached. It's sometimes easier just to change the filename (and update the includes/languages/english/email_extras.php files in storefront and admin) to be 100% sure the new file is being used.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. HELP!!!!!....Need to center My logo hench logo.gif on my main page
    By Robert Cooper in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Jul 2013, 01:33 PM
  2. change admin logo from gif to png
    By modwerx in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 Aug 2009, 05:45 AM
  3. How can I use a PNG for my logo icon instead of a gif???
    By Sullmoney in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Oct 2006, 10:01 PM
  4. Logo.gif to logo.png
    By beatnik in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 Aug 2006, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR