Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter pir1

    (@pir1)

    Hi @lorro

    first I had an argument error, realizing, that woocommerce_email_footer uses just 1. So fixed that. But it does not show anything

    add_action( 'woocommerce_email_footer', 'add_custom_text_to_new_order_email_footer', 10, 1 );
    
    function add_custom_text_to_new_order_email_footer( $email ) {
        // Only for "New Order"  email notifications
    
        if( $email->id == 'customer_processing_order' ) {
         ?>
    		<p>my text</p>
    		
         <?php
    }
    }

    So I was wondering if I am checking for the correct id, any maybe it should be the new_order (it is just the first e-mail, a user receives directly out of woocommerce. But that didn’t work either. So I wanted to check the id with the code from the link you provieded:

    add_action( 'woocommerce_email_order_details', 'get_the_wc_email_id', 9, 4 );
    function get_the_wc_email_id( $order, $sent_to_admin, $plain_text, $email ) {
        // Will output the email id for the current notification
        echo '<pre>'; print_r($email->id); echo '</pre>'; 
    }

    But where does the ID get printed to? I checked the e-mail, the console during ordering (which makes little sense, as the console knows nothing about the e-mail)… where is the echo going to?

    Thanks

    Thread Starter pir1

    (@pir1)

    Hi @lorro ,

    thank you so much! I was especially unsure about the “woocommerce_email_footer” vs. “woocommerce_email_order_meta”! Thanks again!

    Thread Starter pir1

    (@pir1)

    Hi @lorro,

    thank you for your answer. I am totally new to woocommerce, hooks and mostly to php as well. Could you please confirm, if I got it correctly (especially the add_action arguments) and the function arguments

    add_action( ‘woocommerce_email_footer’, ‘add_custom_text_to_new_order_email_footer’, 10, 4 );
    
    function add_custom_text_to_new_order_email_footer( $order, $sent_to_admin, $plain_text, $email ) {
        // Only for "New Order"  email notifications
    
        if( $email->id == 'customer_processing_order' ) {
         ?><p>Text that I want to add just to orders</p>
         <?php
    }
    }

    Is that correct?

    Thank you!

    Thread Starter pir1

    (@pir1)

    Hi @xue28,

    thank your for your answer. We can push meta fields AND article attributes. Would the catalog_visibitliy not be an article attribute? Or are you saying catalog_visibility is not pushable at all?

    Thanks!

    Thread Starter pir1

    (@pir1)

    Interestingly, we just found out, that both of the attributes we tried to use (_visibility and catalog_visibility) are now shown on the product page (as a tabel) under a tab called “additional information”, with the value we tried to transfer.

    In the backend it is pushed in to the Product “properties” tab.

    So it seem the values we push are pushed into woocommerce, but not where and how we want it.

    • This reply was modified 1 year, 10 months ago by pir1.
    Thread Starter pir1

    (@pir1)

    Hi Igor,
    we are using weclapp.

    We have in the meantime confirmed, that it is not possible with meta data, as woocommerce does not seem to support meta data for shipping. Why not?

    So our plan is:

    – add a custom field in our ERP system. Thus for each product we can set the exact name of the shipping class, as set up in Woocommerce.

    – set a global product attribute in WooCommerce, where we push the name from ERP into

    – tell WooCommerce, on change of the new article attribute to update the “shipping_class” of the corresponding article

    – WooCommerce somehow, somewhere tells us, if all went ok, or if we picked a variable of the attribute that is not setup in the woocommerce shipping options

    Any other ideas how to achieve this, or any idea how to go about programming this?

    Thanks

    Thread Starter pir1

    (@pir1)

    Hi Igor,
    thank you for your answer, could you though elaborate more on the meta data topic?

    The questions are:

    1.) Can I push the shipping information using meta data (the ERP supports custom fields that can be mapped to woocommerce meta names), or not?

    2.) And if it cannot be done with meta data mapping, what is the approach I would need to take. Do I need to use php and pass some specific function/variable …?

    Thanks!

    Thread Starter pir1

    (@pir1)

    Thank you both for your input!
    I am putting all into one package and talked with the hosting company, about options and am confident, that if I run into issues I can just move to a more performant plan.

    • This reply was modified 2 years, 8 months ago by pir1.
    Thread Starter pir1

    (@pir1)

    Thank you for the links lisa! Will do that!

Viewing 9 replies - 1 through 9 (of 9 total)