@doudou8 the value is a Unix timestamp, so you just need to format it using a time format string so that you get just the hours and minutes. Are you performing this display via JavaScript or PHP?
But I don’t need the formatting I just need the code to get the value the user selected.
What hook are you using from WooCommerce?
I’m using
$woocommerce->cart->add_fee( ‘Charge supplémentaire du soir’, $spfee, true, ‘standard’ );
And
add_action( ‘woocommerce_cart_calculate_fees’, ‘df_add_ticket_surcharge’ );
I need an if statement that looks if the user selected time is before or after 3:00 PM. If it is after 3 PM, a fee of 1$ is added to the order. I already have the adding I just need a way to get the value the user selected before he submits the order and verify if it’s after or before 3:00 PM.
Thank you!
@doudou8 so the local pickup time selection is not part of the cart, is only selected on checkout and is meta data on the order. Some sort of enhancement to the plugin would need to be made in order to support what you are trying to do. What may help you out is completing the request that the local pickup time option get tied into the WooCommerce Local Pickup shipping method. Until work begins on that change I don’t think there will be a workable solution for you. Sorry.
I am still trying to code enhancement, but do you know something that could help me?
-
This reply was modified 5 years ago by doudou8.
@doudou8 do you have a specific question or problem you are trying to solve in the code you are working on? Without something specific I’m not sure what to offer you to help with this.