awethemes / awebooking

AweBooking: A free online hotel booking for WordPress
https://wordpress.org/plugins/awebooking/
GNU General Public License v2.0
43 stars 22 forks source link

Shipping with woocomerce #55

Closed itsSilver closed 7 years ago

itsSilver commented 7 years ago

Hi there, i updated to latest version of woocommerce 3.2.1 and beta10 and everything works fine except shipping fields on checkout page . After the user validates billing fields there is a option for shipping "ship to a different adderss?" so if its checked the user has to fill shipping address if not then shipping address will be same as billing address , and here cames the error. Shipping address returns null , empry strings while billing address returns all the keyput that user has typed , how to make this work correctly? thanks

anhskohbo commented 7 years ago

Why you need "shipping address" when you rent a room in a hotel? We set room book room as a "virtual product" in woocommerce, so woocommerce will display with no shipping fields.

itsSilver commented 7 years ago

i need it because i have developed my own payment gateway and it is neccesary to add shipping fields , do you know any method how can i solve my problem . thanks

anhskohbo commented 7 years ago

Okay, wait a while I'll try to allow enable shipping fields.

itsSilver commented 7 years ago

you can tell me how to change it form virtual to a simple product because as you said for booking isnt neccessary shipping field but i need it for my custom gateway

anhskohbo commented 7 years ago

In awebooking-woocommerce/inc/Product_Booking_Room.php we declare:

/**
 * This is virtual product (has no shipping).
 *
 * @return true
 */
public function is_virtual() {
    return true;
}

I just set to false but seem got no luck, need looking more to see why :D

itsSilver commented 7 years ago

i added in my functions.php

add_filter( 'woocommerce_cart_needs_shipping_address', '__return_true', 50 );

and i think is working now. Need to run a few tests and ill tell you the results . Also some customizations on my checkout form files and now is working perfectly .

I think is not neccesary but if you want i cant commit a change for this issue and you can check but as you said booking doesnt need shipping. Thank you and also you can mark as closed this issue