• Resolved mysticminimalistartisan

    (@mysticminimalistartisan)


    Hi. I have a service based business so I would like to hide the shipping address on the page that loads when clicking the “Open print view in browser” link in the e-mail. From the FAQ I have tried the

    function example_removed_payment_method( $fields ) {
        unset( $fields['payment_method'] );
        return $fields;
    }
    add_filter( 'wcdn_order_info_fields', 'example_removed_payment_method' );

    but I don’t know what to change the “example_removed_payment_method” & “payment_method” to.

    Also, I would like to change the color of the print button at the bottom to a more noticeable color so people see it better as it is easy to overlook (& my site color just happens to be the perfect color, LOL!). I have used the inspector & see it is defined by #navigation .button, but I can’t find this in the stylesheet. How can I change the color of the button?

    I would really appreciate any help. Love the plugin by the way, thanks for creating it!!!

Viewing 12 replies - 31 through 42 (of 42 total)
  • Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    When you say it won’t “carry” the new updated features do you mean that after I upload that file the updated features will be lost? If yes, should I even update then?

    Moksha Shah

    (@mokshasharmila13)

    Hi @mysticminimalistartisan,

    Your plugin is now updated with the new version 4.6.5, so you don’t need to update. Whenever will update the new version you need to make changes in your code from your developer.

    Regards,
    Moksha.

    Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    Hmm ok, I am my developer so I guess I just won’t be able to update it again after the next update. It’s just so weird I couldn’t hide it with css, I’ve hidden other things so I’m a little baffled why that didn’t work. That would have been a perfect way to do that & get updates too. Of well. If you ever add a feature for hiding the shipping for service based businesses, please let me know.

    Thanks so much for your help!

    Moksha Shah

    (@mokshasharmila13)

    Hi @mysticminimalistartisan,

    You can easily hide the shipping address from the code. In your print-order file, there is one more file ‘print-content.php’ just remove the below code from your file it will hide the shipping address from your invoice. So whenever new updates will occur you need to remove the code from the file.

    <div class="shipping-address">						
    			<h3><?php esc_attr_e( 'Shipping Address', 'woocommerce-delivery-notes' ); ?></h3>
    			<address>
    
    				<?php
    				if ( ! $order->get_formatted_shipping_address() ) {
    					esc_attr_e( 'N/A', 'woocommerce-delivery-notes' );
    				} else {
    					echo wp_kses_post( apply_filters( 'wcdn_address_shipping', $order->get_formatted_shipping_address(), $order ) );
    				}
    				?>
    
    			</address>
    		</div>

    Please note while removing the code from the file take a backup of the existing file.

    Regards,
    Moksha.

    Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    Ah ok. Yeah I can do that super easily. THANK YOU SO MUCH! You have a great day/night, I’m gonna go to bed finally, it’s late LOL!

    Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    One more question @mokshasharmila13 if you don’t mind. Where is the print button styling for the order confirmation page? For some weird reason it is using my site button background color, but not the button text properties. Thanks!

    Moksha Shah

    (@mokshasharmila13)

    Hi @mysticminimalistartisan,

    Please let me know if you have tried this method for styling the print button?

    You can change the color of the print button directly in the file.
    path:- woocommerce-delivery-notes/includes/class-wcdn-theme.php
    
    <p class="order-print">
    <a href="<?php echo esc_url( $print_url ); ?>" class="button print" style="background-color:red"><?php echo esc_attr( apply_filters( 'wcdn_print_button_name_order_page', __( 'Print', 'woocommerce-delivery-notes' ), $order ) ); ?></a>
    </p>
    Screenshot:- https://prnt.sc/lDm82x2aKWtT
    
    Please note that updating the plugin’s new version will wipe out these changes.

    Regards,
    Moksha.

    Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    Thank you! So I just changed it to use the same class as the other button right above it which is the order again button, the class on that one is button & the class on the print button was button print so I just took out the print. When viewing it in the browser using the inspector it shows the change took effect but it’s not using that class, it’s still using the old one. Any idea why that is happening?

    Moksha Shah

    (@mokshasharmila13)

    Hi @mysticminimalistartisan,

    Please follow the steps for adding class. We are additionally adding css in wordpress follow the instructed path and add the css you want.

    Path: Appearance/customize/Additional css/..

    Please try this way to add class in css and let me know.

    Regards,
    Moksha.

    Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    Well if it’s using the same class as another button on the page, I don’t get why it wouldn’t work. I can create the css but say if I switch it back to what it was instead of changing it to what you just gave me, how to I form the selector for class=”button print”? I’m good with the rules but for some reason I always have a hard time with selectors (don’t ask me why, I’m weird!). I just want to change as few files as possible to avoid problems when updating, in case I forget what I did, and I will. Thanks.

    Moksha Shah

    (@mokshasharmila13)

    Hi @mysticminimalistartisan,

    You copy/paste the below code into your customize/additional CSS.

    a.button.print {
         background-color: green !important;
    }

    Regards,
    Moksha.

    Thread Starter mysticminimalistartisan

    (@mysticminimalistartisan)

    PERFECT!!! THANK YOU SO MUCH!!!

Viewing 12 replies - 31 through 42 (of 42 total)

The topic ‘Hide Shipping Address’ is closed to new replies.