• Hi,
    I am trying to create a function in app website to communicate with your plugin. I need to get the time the user is selecting before he submits the order. Is it possible? (I need Hour:minutes)

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Tim Nolte

    (@tnolte)

    @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?

    Thread Starter doudou8

    (@doudou8)

    Php

    Thread Starter doudou8

    (@doudou8)

    But I don’t need the formatting I just need the code to get the value the user selected.

    Plugin Author Tim Nolte

    (@tnolte)

    What hook are you using from WooCommerce?

    Thread Starter doudou8

    (@doudou8)

    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!

    Plugin Author Tim Nolte

    (@tnolte)

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

    Thread Starter doudou8

    (@doudou8)

    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.
    Plugin Author Tim Nolte

    (@tnolte)

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Get time before submit the order’ is closed to new replies.