Support » Plugin: Registrations for WooCommerce » How to show start_time next to date add to cart page

  • Resolved gagnonconsulting

    (@gagnonconsulting)


    Hi, Great plugin! Thanks for it!
    Question: How would I display the event start time next to the date in the pulldown selection on the Add to Cart page (in the pulldown on the product page just above the Add to Cart button)
    Thank you,
    Rich

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Allyson Souza

    (@allysonsouza)

    Hi Rich,

    You can retrieve the start time and end time using:

    get_post_meta( $variation_id , '_event_start_time', true );
    get_post_meta( $variation_id , '_event_end_time', true );

    Or you can use registration_schedule() function (defined in class-wc-product-registrations.php), that receive a variation ID as parameter:

    $product->registration_schedule( $available_variations[ $count ]['variation_id'] );

    I hope it helps.

    Sort of… in your registration.php I was able to use the get_post_meta() with the variation_id hard coded and it did show me the start time, so that is a good place to start. However, I am not sure how to use this info to add the start time to the pulldown list of available dates a few lines down in the registration.php.

    Further, I need to be able to pass this info as part of the product description in the checkout and payment gateway.

    Plugin Author Allyson Souza

    (@allysonsouza)

    Hi @gagnonconsulting,

    I think you will need to give a look in WooCommerce Docs and check for the specific hooks that you need to add this information.

    For example, to change the variations labels in select options, you can use the hook woocommerce_dropdown_variation_attribute_options_html, that was applied at the bottom of wc_dropdown_variation_attribute_options() function: https://docs.woocommerce.com/wc-apidocs/source-function-wc_dropdown_variation_attribute_options.html#2045-2102

    • This reply was modified 2 years, 10 months ago by Allyson Souza.
    Plugin Author Allyson Souza

    (@allysonsouza)

    I’ll consider this as closed for now.

    We’re planning to improve the plugin options and something like an option to display or not the events start and end times, and also days of week, is good improvments.

    Feel free to open other topic if do you have any problem!

    Thanks

    • This reply was modified 2 years, 7 months ago by Allyson Souza.
    Plugin Author Allyson Souza

    (@allysonsouza)

    Resolved.

    Plugin Author Allyson Souza

    (@allysonsouza)

    Resolved.²

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to show start_time next to date add to cart page’ is closed to new replies.