Thank you for the very quick reply. I now understand why the print button in that pop up is not possible.
We have a different idea, could you please help me out with that?
The order notification pop up has a link with the order ID, so you can click the notification and the order detail page is opened.
Could you help us change this link, so if the user click the order ID in the pop up, the detail page is opened and also the print prompt? We found that it is possible with javascript to open a certain url with the print prompt, but can’t implement it within the code from the file we need: /core/class-wcfm-notification.php
We are not sure but think it should be somewhere in here
// Vendor Notification
if( $WCFM->is_marketplace ) {
foreach ( $order->get_items() as $item_id => $item ) {
$product = $order->get_product_from_item( $item );
$product_id = 0;
if ( is_object( $product ) ) {
$product_id = $item->get_product_id();
}
if( $product_id ) {
$author_id = -1;
$message_to = wcfm_get_vendor_id_by_post( $product_id );
if( $message_to ) {
$wcfm_messages = sprintf( __( 'You have received an Order <b>#%s</b> for <b>%s</b>', 'wc-frontend-manager' ), '<a target="_blank" class="wcfm_dashboard_item_title" href="' . get_wcfm_view_order_url($order_id) . '">' . $order->get_order_number() . '</a>', get_the_title( $product_id ) );
$this->wcfm_send_direct_message( $author_id, $message_to, $author_is_admin, $author_is_vendor, $wcfm_messages, 'order', apply_filters( 'wcfm_is_allow_order_notification_email', false ) );
}
do_action( 'wcfm_after_new_order_vendor_notification', $message_to, $product_id, $order_id );
}
}
}
This is the example we found for open link in new window with print prompt: https://stackoverflow.com/questions/12276416/how-to-open-a-link-new-tab-with-print-command but we are unable to insert this javascript into the above php file
-
This reply was modified 4 years, 6 months ago by
mellow1.