Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1471338

    Hello. I have tried several Woocommerce hooks to add text with a link to a contact page to apply for tax exemption, but it seems the Enfold theme overrides quite a few of them. Is there any way to add the text “TAX EXEMPT?” either after the word TAX in Woo cart/checkout pages, or after the dollars calculated to the right of it? Thanks.

    #1471364

    Hey Illingco,

    Thank you for the inquiry.

    Would you mind providing a screenshot of the area where you need this text? You can use platforms like Savvyify, Imgur, or Dropbox to upload and share the screenshot.

    Best regards,
    Ismael

    #1471414

    Either of the areas noted in the screen shot listed. Please advise, thanks.

    #1471463

    Hi,
    I checked your previously posted staging site linked below, but the checkout is not in the same format as your screenshot.
    We could add the text “TAX EXEMPT” after the word “Tax” with javascript, but we will need to see your page to examine, please link to it.

    Best regards,
    Mike

    #1471690

    I’m not sure I understand. I have linked the checkout page. Please advise if this helps and what the JS might be to do this. Thanks!

    #1471781

    Hi,
    Your screenshot is like this:
    Enfold Support 6542
    but when I check I see this:
    Enfold Support 6544
    Do you want it where the arrow is?

    Best regards,
    Mike

    #1471893

    Yes, where the arrow is, thank you!

    #1472029

    Hi,
    Thank you for your patience, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function tax_exempt() { ?>
      <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){
      $(function() {
      	setTimeout(function(){
      $('.cart_totals .tax-total th, #order_review .tax-total th').each(function() {
        var text = $(this).text();
        $(this).text(text.replace('Tax', ' Tax Exempt ')); 
    });
    }, 2000);
    });
    })(jQuery);
    });
    </script>
      <?php
    }
    add_action( 'wp_footer', 'tax_exempt', 99 );

    in the cart:
    Screen Shot 2024 11 23 at 12.55.20 PM
    in the checkout:
    Screen Shot 2024 11 23 at 12.56.57 PM

    Best regards,
    Mike

    #1472169

    Hello Mike and thanks for this. What I was hoping for was to leave the word TAX there, and after it, text showing (TAX EXEMPT?), with the TAX EXEMPT part linked with an internal URL (and underlined) to a contact page. Is that possible? Also, can I add this to Code Snippets plugin so it does not get overwritten on theme updates? THanks!

    • This reply was modified 3 weeks, 5 days ago by Illingco.
    #1472215

    Hi,

    Thank you for the update.

    We edited the script a bit. Please try it again and make sure to adjust the link or the href value:

    function av_custom_script_tax_exempt() { ?>
      <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){
      $(function() {
      	setTimeout(function(){
          $('.cart_totals .tax-total th, #order_review .tax-total th').each(function() {
            var text = $(this).text();
            if (text.includes('Tax')) {
              $(this).html(text.replace('Tax', 'Tax (<a href="https://example.com/tax-exempt-info" target="_blank">Tax Exempt?</a>)'));
            }
          });
        }, 2000);
      });
    })(jQuery);
    });
    </script>
    <?php
    }
    add_action( 'wp_footer', 'av_custom_script_tax_exempt', 99 );
    

    Best regards,
    Ismael

    #1472296

    Thank you. Oddly however, it goes blank once I enter shipping details and it calculates tax. It is there for a second, and then goes away. Any idea why?

    #1472340

    Hi,

    Thank you for the update.

    it goes blank once I enter shipping details and it calculates tax

    The script seems to be working as expected. It transforms the text from “Tax” to “Tax (Exempt?)”. How can we reproduce the issue? Please provide a screenshot using platforms like Savvyify, Imgur, or Dropbox.

    Best regards,
    Ismael

    #1472731

    Once you fill in billing fields on checkout page, it disappears. If you try that, you should see what I mean. Thanks.

    #1472765

    Hi,

    This text pops up when filling in the fields.

    Suspicious activity has been detected. If you believe this to be an error, please contact  (Email address hidden if logged out) .
    

    Please disable it temporarily.

    We adjusted the script a bit and added the updated_checkout event. Please try it again:

    function av_custom_script_tax_exempt() { ?>
      <script>
        window.addEventListener('DOMContentLoaded', function() {
          (function($) {
            $(function() {
              function updateTaxLabel() {
                $('.cart_totals .tax-total th, #order_review .tax-total th').each(function() {
                  var text = $(this).text();
                  if (text.includes('Tax')) {
                    $(this).html(text.replace('Tax', 'Tax (<a href="https://example.com/tax-exempt-info" target="_blank">Tax Exempt?</a>)'));
                  }
                });
              }
    
              setTimeout(updateTaxLabel, 2000);
    
              $(document.body).on('updated_checkout', function() {
                updateTaxLabel();
              });
            });
          })(jQuery);
        });
      </script>
    <?php
    }
    add_action('wp_footer', 'av_custom_script_tax_exempt', 99);
    

    Best regards,
    Ismael

    #1473045

    That seems to work thank you! You may close this ticket.

    #1473075

    Hi,

    Great! Glad to know that the changes resolved the issue. Please feel free to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Text after TAX field, or after tax calcualtion’ is closed to new replies.