• Resolved lenamtl

    (@lenamtl)


    Hi,

    I’m wondering how woocommerce checkout should work when the cart only have FREE DIGITAL items?
    For example I will provide a coupon for free item (I’m using adavnced coupon).

    1- Does the address need to be filled?
    If yes, is there a snippet for this, I would try to avoid component just for this.
    (note this is only for free digital product not for all digital product)
    Note I’m using only one address (as I set billing address is the same as shipping).
    All snippet I have found are too old or even if they hide the field the validation or field requirement is still appear?

    2-Does the paiment method appear even if the total is 0$?

    Thanks

    • This topic was modified 3 years, 2 months ago by lenamtl.
    • This topic was modified 3 years, 2 months ago by lenamtl.
    • This topic was modified 3 years, 2 months ago by lenamtl.
    • This topic was modified 3 years, 2 months ago by lenamtl.
    • This topic was modified 3 years, 2 months ago by lenamtl.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Mirko P.

    (@rainfallnixfig)

    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.

    Thread Starter lenamtl

    (@lenamtl)

    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).

    Plugin Support abwaita a11n

    (@abwaita)

    Hi @lenamtl,

    As the core WooCommerce plugin does not have this option, I would suggest checking the following third-party plugins:
    * https://www.ads-software.com/plugins/woo-checkout-for-digital-goods/
    * https://www.ads-software.com/plugins/download-now-for-woocommerce/

    Let us know if these could work for you.
    Thanks.

    Plugin Support abwaita a11n

    (@abwaita)

    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.

    Thread Starter lenamtl

    (@lenamtl)

    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 3 years, 1 month ago by lenamtl.
    • This reply was modified 3 years, 1 month ago by lenamtl.
    • This reply was modified 3 years, 1 month 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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Free digital product checkout’ is closed to new replies.