Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    618
    Plugin Contributions
    0

    Default Hide empty div in emails

    v1.5.6b

    Applies to email_template_welcome.html but may also apply to others.

    The EXTRA_INFO section, used for the admin version of the welcome email is wrapped in a div like so:

    Code:
    <div class="extra-info">
    $EXTRA_INFO
    </div>
    this is obviously empty in the customer's version but due to the way it's styled in email_common.css it shows as an empty, coloured box.

    Rather than altering the styling of this div, would suggest adding the following to the .css

    Code:
    .extra-info:empty {
    display:none;
    }
    Simon

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,485
    Plugin Contributions
    88

    Default Re: Hide empty div in emails

    Good suggestion! Can you open a PR for this?
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  3. #3
    Join Date
    Feb 2009
    Location
    UK
    Posts
    618
    Plugin Contributions
    0

    Default Re: Hide empty div in emails

    Sure, I'll give it a go.
    Simon

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,754
    Plugin Contributions
    68

    Default Re: Hide empty div in emails

    Agreed (and I learned something, as I was unaware of that :empty selector), but will all email programs "understand" that?

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    618
    Plugin Contributions
    0

    Default Re: Hide empty div in emails

    My first PR.

    I've created my own fork of the ZC repo and cloned it to my PC (Sourcetree), now trying to make a working-branch.
    The instructions say,

    SourceTree [using v3.1.3]:

    First, make sure you're in "Log View" (View, Log View)
    Find where it shows upstream/develop, and right-click on that row. Choose Branch... from the pop-up menu
    Give it the new branch name
    Leave the "checkout new branch" box checked
    Click Create Branch or OK

    There's no Log View option, I'm in History View. The only thing that's close to an 'upstream/develop' in my current view is an 'upstream/v157' tag on the most recent branch (15 Jul 2019, Ian Wilson).

    Do I just select the 'Branch' icon from the menu ribbon and create my branch in there? If so is the commit 'Working copy parent' or 'specified commit'?

    edit - perhaps I should have started a new thread for this.
    Last edited by simon1066; 16 Jul 2019 at 03:31 PM.
    Simon

  6. #6
    Join Date
    Feb 2009
    Location
    UK
    Posts
    618
    Plugin Contributions
    0

    Default Re: Hide empty div in emails

    Quote Originally Posted by lat9 View Post
    Agreed (and I learned something, as I was unaware of that :empty selector), but will all email programs "understand" that?
    Good point. Doing some testing and it seems that the type of Client may determine whether or not it's recognised

    Yahoo
    Thunderbird client - yes

    Outlook
    Web client - no
    Win 10 Mail - yes

    Gmail
    Web Client - no

    Unfortunately my over-judicious use of the Admin email system has caused a temporary IP ban with AOL/Yahoo. I'll do some more thorough checks when I can - but for now it seems that :empty is not the ideal solution.
    Simon

  7. #7
    Join Date
    Feb 2009
    Location
    UK
    Posts
    618
    Plugin Contributions
    0

    Default Re: Hide empty div in emails

    Yahoo
    Web Client - yes
    Thunderbird client - yes

    Outlook
    Web client - no
    Win 10 Mail - yes

    Gmail
    Web Client - no
    Thunderbird client - yes

    AOL
    Web Client - yes (to be expected as it's Yahoo)

    Note: for it to work, sometimes, it requires to have the extra_info code on the same line:

    Code:
    <div class="extra-info">$EXTRA_INFO</div>
    Simon

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,485
    Plugin Contributions
    88

    Default Re: Hide empty div in emails

    Quote Originally Posted by simon1066 View Post

    The only thing that's close to an 'upstream/develop' in my current view is an 'upstream/v157' tag on the most recent branch (15 Jul 2019, Ian Wilson).
    That's what you want. Develop is the 2.0 branch.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  9. #9
    Join Date
    Feb 2009
    Location
    UK
    Posts
    618
    Plugin Contributions
    0

    Default Re: Hide empty div in emails

    Quote Originally Posted by swguy View Post
    That's what you want. Develop is the 2.0 branch.
    Ok, thank you. Although I don't think it's worth doing a PR in this case - as the css change isn't a proper fix, that's good to know for the future.
    Last edited by simon1066; 16 Jul 2019 at 06:33 PM.
    Simon

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,485
    Plugin Contributions
    88

    Default Re: Hide empty div in emails

    Have you considered using `str_replace()` to remove the extra_info block if it's empty? That's how I would implement this change.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Hide a <div> in JUST the home page..
    By DivaVocals in forum Templates, Stylesheets, Page Layout
    Replies: 29
    Last Post: 30 Sep 2014, 07:42 PM
  2. Checkout Confirmation Page - Radio Button to Hide Div
    By limelites in forum General Questions
    Replies: 0
    Last Post: 1 May 2012, 11:28 PM
  3. Why does my right div appear on Your Cart is Empty page?
    By datatv in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Jul 2008, 07:05 PM
  4. HTML Emails - DIV vs. Tables
    By Radish in forum General Questions
    Replies: 0
    Last Post: 28 Sep 2006, 07:35 AM

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