Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the Shipping Address for virtual products #26

Open
wants to merge 30 commits into
base: snippets-review-pip
Choose a base branch
from

Conversation

nicomputer
Copy link

I´m trying to remove the Shipping Address for virtual products with a snippet, but I´m totally not a pro in this. Can anyone support please how to code this? As a starting point I tried to use the "remove payment method" snippet which of course didn´t work:

/**

  • Removes "Shipping Address" from the header table of invoices
  • @param array $column array containing the column of the footer table
  • @param string $type the type of document being viewed
  • @param \WC_Order $order the order object the document is for
  • @return array $column the updated array
    */

function sv_wc_pip_document_table_footer( $column, $type, $order_id ) {

//bail if document type is not invoice
if ( 'invoice' !== $type ) { return $column; }

//remove payment method from array
if ( isset( $column['shipping-address'] ) ) {
	unset( $column['shipping-address'] );
}

return $column; //return updated array

}
add_filter( 'wc_pip_document_table_footer', 'sv_wc_pip_document_table_footer', 10, 3 );

@nicomputer nicomputer marked this pull request as ready for review January 2, 2022 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.