Plugin Directory

Changeset 3320750


Ignore:
Timestamp:
07/01/2025 04:08:42 PM (7 months ago)
Author:
alexmex
Message:

Use new hook.

Location:
coopcycle/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopcycle/trunk/coopcycle.php

    r3320625 r3320750  
    55 * Plugin URI: https://coopcycle.org/
    66 * Description: CoopCycle plugin for WordPress
    7  * Version: 1.1.0
     7 * Version: 1.1.1
    88 * Domain Path: /i18n/languages/
    99 */
  • coopcycle/trunk/legacy_shortcode.php

    r3320617 r3320750  
    22
    33function coopcycle_checkout_process() {
     4
    45    // TODO Make sure shipping time is valid
    56
     
    1415}
    1516
    16 function coopcycle_checkout_update_order_meta($order_id) {
     17function coopcycle_checkout_create_order(WC_Order $order) {
    1718
    1819    // Skip if another shipping method was chosen
     
    2223
    2324    if (!empty($_POST['shipping_date'])) {
    24         update_post_meta($order_id, 'shipping_date', sanitize_text_field($_POST['shipping_date']));
     25        $order->update_meta_data('shipping_date', sanitize_text_field($_POST['shipping_date']));
    2526    }
    2627}
     
    6970add_action('woocommerce_checkout_process', 'coopcycle_checkout_process');
    7071
    71 add_action('woocommerce_checkout_update_order_meta', 'coopcycle_checkout_update_order_meta');
     72add_action('woocommerce_checkout_create_order', 'coopcycle_checkout_create_order', 10, 1);
    7273
    7374add_action('wp_enqueue_scripts', 'coopcycle_enqueue_scripts');
Note: See TracChangeset for help on using the changeset viewer.