Looking for help?
< All Topics
Print

How to display custom product data on Receipt template

#1. add custom product data to POS product data

if(!function_exists('custom_op_product_data'))
{
    function custom_op_product_data($product_data,$product){
        $product_id = $product_data['id'];
        $product_data['custom_product_data'] = 'Custom product data value'; // enter your logic at here
        
        return $product_data;
    }
}
add_filter('op_product_data','custom_op_product_data',10,2);

#2. add data to receipt template composer

  <% items.forEach(function(item){ %>
    
            <p class="itemtext">Custom Product Data Value: 
            <%= item.product.custom_product_data %></p>
            
    <% }); %>
Table of Contents