• Resolved colinwatson

    (@colinwatson)


    Hey,
    So I have recently added some new products to my website and I am using forms. In the form are options with images – however when the invoice is generated, its showing massive images – ideally I don’t want it to show the images at all – the way its displaying them is taking the rest of the invoice details off of the A4 page.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @colinwatson

    Could you show us a screenshot of your PDF document? You could host it here.

    Thread Starter colinwatson

    (@colinwatson)

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @colinwatson

    Could you try the code snippet below?

    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 );
    function wpo_wcpdf_custom_styles ( $document_type, $document ) {
    	?>
    	.invoice .wc-item-meta img { display:none; }
    	<?php
    }

    If you haven’t worked with code actions/filters, please read this documentation page: How to use filters

    Thread Starter colinwatson

    (@colinwatson)

    Hey, that hasn’t done anything to the file.

    I’ve added it to functions.php (I believe thats right)

    do I need to do anything else

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @colinwatson

    Try this instead:

    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 );
    function wpo_wcpdf_custom_styles ( $document_type, $document ) {
    	?>
    	.invoice .item-meta img { display:none; }
    	<?php
    }
    Thread Starter colinwatson

    (@colinwatson)

    Still the exact same Alex ??

    So within the form, the image is a link to the image on my server and not embedded, does that make a difference?

    Thread Starter colinwatson

    (@colinwatson)

    Hey Alex, just wondering if you had any other thoughts on this?

    Plugin Contributor Ewout

    (@pomegranate)

    Hi Colin,
    It’s a big of a stab in the dark because we can’t see the source data to know exactly how it’s added / with what HTML code. But you could try one more alternative style that may be a better catch-all for images in the order details:

    
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 );
    function wpo_wcpdf_custom_styles ( $document_type, $document ) {
    	?>
    	.order-details img { display:none !important; }
    	<?php
    }
    

    If that doesn’t work I think it’s better to contact the developers of the plugin that adds this to the order details in the first place, they probably know better how to remove this!

    Thread Starter colinwatson

    (@colinwatson)

    That ones throwing up an error

    Your PHP code changes were rolled back due to an error on line 32 of file wp-content/themes/oceanwp/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘&’

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @colinwatson,

    I wonder if you’re trying to copy the code snippet directly from the e-mail notification. If so, please open the topic in the www.ads-software.com support forum and copy the code snippet from here.

    Let us know if it worked.

    Thread Starter colinwatson

    (@colinwatson)

    Yeah I was and that works perfect. Thanks so much
    I really need to go and sort out a child theme so this doesn’t get over written

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Yeah I was and that works perfect. Thanks so much

    I’m happy to know that it worked!

    I really need to go and sort out a child theme so this doesn’t get over written

    A child theme works great, but you can also use a plugin like Code Snippets to handle your code snippet from the WordPress dashboard. See How to use filters.

    By the way, if you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Images showing in invoice from Options’ is closed to new replies.