• Resolved lukasp86

    (@lukasp86)


    Hi guys,

    I’m using mailchimp_get_ecommerce_merge_tags filter for adding custom merge tags, but it seems that the MailChimp_WooCommerce_Order can’t be accessed because it’s protected.

    function mailchimp_custom_order_merge_tags($merge_tags, $order) {
        /// add whatever you want to the merge tags
        $order_id = $order->ID;
            
        mailchimp_log('debug', "tracing order {$order_id}", array('order' => $order));
    
        return $merge_tags;
    }
    
    add_filter('mailchimp_get_ecommerce_merge_tags', 'mailchimp_custom_order_merge_tags', 10, 2);

    Log:

    2020-08-19T09:33:57+00:00 NOTICE debug :: tracing order :: Array
    (
        [order] => MailChimp_WooCommerce_Order Object
            (
                [id:protected] => 6483
                [landing_site:protected] => .....
    

    Am I missing something? Is there any getter function to access those values? I couldn’t find any information on github or here.

    Thanks so much and Cheers,
    Lukas

    • This topic was modified 4 years, 7 months ago by lukasp86.
    • This topic was modified 4 years, 7 months ago by lukasp86.
Viewing 1 replies (of 1 total)
  • Thread Starter lukasp86

    (@lukasp86)

    Ok, sorry guys .. after looking at the MailChimp_WooCommerce_Order class it’s obvious that we’ve to use the getId() getter function. Thanks anyways ??

Viewing 1 replies (of 1 total)
  • The topic ‘Can’t access MailChimp_WooCommerce_Order ID’ is closed to new replies.