Hi @lenamtl,
Does the address need to be filled?
In general, if you’re selling digital products that do not have a physical component, and therefore do not require shipping, you can enable the Virtual option.

Link to image: https://i.imgur.com/OO5aBS6.png
Read more on digital products handling here:
https://docs.woocommerce.com/document/digital-downloadable-product-handling/
Does the paiment method appear even if the total is 0$?
If your product price is zero or a coupon is applied for a 100% discount or free item, then the customer will still have to go through the checkout to place the order but no payment gateways will be shown. This is how it looks like on my test site:

Link to image: https://i.imgur.com/lMKhDb6.png

Link to image: https://i.imgur.com/ZNTQLYZ.png
If you’re using a separate plugin to handle the coupon code, you’ll want to confirm with the plugin author if no payment methods will be displayed for zero-priced items.
Hope this helps.
Hi,
I need the client to enter the address when thay buy digital product at regular price / not free (because the payment gateway is set like this).
what I tried to achieve:
If there is only free digital product on checkout the address is not mandatory but only for this case (not for all paid digital product).
Hi @lenamtl,
As the core WooCommerce plugin does not have this option, I would suggest checking the following third-party plugins:
* https://wordpress.org/plugins/woo-checkout-for-digital-goods/
* https://wordpress.org/plugins/download-now-for-woocommerce/
Let us know if these could work for you.
Thanks.
Hi,
We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, the above plugin suggestions were helpful!
If you have further questions, please feel free to open a new topic.
Thanks.
Hi,
Thanks for the suggestion but these plugins are not doing what i’m after.
What I need is if total = 0$
And contain only digital product
make some of the checkout field not mandatory.
I’m working on a snippet
how can I check if all items from the order are digital?
I have this snippet but not sure if this make sense
add_filter( 'woocommerce_checkout_fields' , 'custom_not_required_fields', 9999 );
function custom_not_required_fields( $fields ) {
//Get order/cart total
if( is_wc_endpoint_url( 'order-pay' ) ) {
$order_id = wc_get_order_id_by_order_key( $_GET[ 'key' ] );
$order = wc_get_order( $order_id );
$order_total = $order->get_total();
} else {
$order_total = WC()->cart->total;
}
if ( $order_total = 0 ) {
// Get items from order
foreach ($order_id->get_items() as $order_item){
$item = wc_get_product($order_item->get_product_id());
if ($item->is_virtual()) {
unset( $fields['billing']['billing_address_1']['required'] );
unset( $fields['billing']['billing_address_2']['required'] );
unset( $fields['billing']['billing_city']['required'] );
unset( $fields['billing']['billing_postcode']['required'] );
}
}
}
return $fields;
}
-
This reply was modified 4 years, 6 months ago by
lenamtl.
-
This reply was modified 4 years, 6 months ago by
lenamtl.
-
This reply was modified 4 years, 6 months ago by
lenamtl.
Hi @lenamtl
It looks like you are looking for help with the customization of the code. I can also recommend the following places for more development-oriented questions:WooCommerce Slack Community: https://woocommerce.com/community-slack/WooCommerce Community on Facebook: https://www.facebook.com/groups/advanced.woocommerce/
Alternatively, you could look into a conditional checkout fields plugin like https://woocommerce.com/products/conditional-checkout-fields-for-woocommerce/
Hi @lenamtl
We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.