• Good afternoon, how can I get the product attribute and its price to appear in the Woocmmerce notification? Help me please!

Viewing 1 replies (of 1 total)
  • Plugin Author rainafarai

    (@rainafarai)

    Hi you can Add a filter in your function.php..
    To replace the original plugin product line with your new line
    You can ADD or REPLACE LINE depends your needs

    this code is an example to ADD or REPLACE LINE

    <?php
    add_filter('nftb_order_product_line_hook', 'my_item_line_function', 10, 3);
    
    function my_item_line_function($message ,$product_id, $item) {
    
        // ADD SOME CODE $product_id TO ORIGINAL row $message.
        $modified_data = $message. "->".$product_id. "\r\n";
    
        // REPLACE Product ITEM LINE CODE WITH YOUR CODE  without concatenate $message.
        $modified_data = $product_id. "\r\n";
    
        return $modified_data;
    } 
    ?>

    instead of return the ID write you code to get the ?attribute and its price from product ID

Viewing 1 replies (of 1 total)
  • The topic ‘How add attribute woocommerce?’ is closed to new replies.