Home Forums WC Vendors Pro Support Inovice – WC Vendors Reply To: Inovice – WC Vendors

#59487
Jaypreet Thukral
Participant

Hello,

They have given me this code, and to check with you where to insert to it.

add_filter(‘wcv_orders_add_new_row’, function($new_row){
if ( !class_exists( ‘WooCommerce_PDF_Invoices’ ) ) {
return false;
}
$order_id = $new_row->order_number;
$order = new WC_Order ( $order_id );

$vendor_pdf_actions = array(
‘invoice’ => array (
‘class’ => ‘button tips wpo_wcpdf invoice’,
‘url’ => wp_nonce_url( admin_url( ‘admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=’ . $order->id ), ‘generate_wpo_wcpdf’ ),
‘label’ => sprintf( ‘‘, WooCommerce_PDF_Invoices::$plugin_url . ‘images/invoice.png’),
‘target’ => ‘_blank’
),
‘packing-slip’ => array (
‘class’ => ‘button tips wpo_wcpdf packing-slip’,
‘url’ => wp_nonce_url( admin_url( ‘admin-ajax.php?action=generate_wpo_wcpdf&template_type=packing-slip&order_ids=’ . $order->id ), ‘generate_wpo_wcpdf’ ),
‘label’ => sprintf( ‘‘, WooCommerce_PDF_Invoices::$plugin_url . ‘images/packing-slip.png’),
‘target’ => ‘_blank’
),
);

$new_row->row_actions = array_merge($new_row->row_actions, $vendor_pdf_actions);

return $new_row;
}, 10, 1);

This website uses cookies to ensure you get the best experience on our website.