Forum Replies Created

Viewing 10 replies - 61 through 70 (of 70 total)
  • Thread Starter mellow1

    (@cdsigns)

    Thank you for the code snippet. I’ve added a new snippet to my website. If I click the link in the order notification pop up the link is not correct, it tries to open this page:

    https://myfakeurlsite.nl/store-manager/settings/.%20get_wcfm_view_order_url(order_id/

    and for example the last order the link should be: https://myfakeurlsite.nl/store-manager/orders-details/49968/

    Thread Starter mellow1

    (@cdsigns)

    Yes, you’ve provided a snippet to add the print button on the order detail page.

    add_action( 'wcfm_after_order_quick_actions', function( $order_id ) {
    	?>
    	<a id="wcfm_order_print" class="add_new_wcfm_ele_dashboard text_tip" style="" href="<?php echo $order_id; ?>" data-tip="<?php _e( 'Print Order', 'wc-frontend-manager' ); ?>"><span class="wcfmfa fa-print"></span><span class="text"><?php _e( 'Print', 'wc-frontend-manager' ); ?></span></a>
    	<script>
    	jQuery(document).ready(function($) {
    		$('#wcfm_order_print').click(function( event ) {
    			event.preventDefault();
    			
    			Pagelink = "order_details";
    			var pwa = window.open(Pagelink, "_new");
    			pwa.document.open();
    			
    			pwa.document.write( "<html><head><script>function step1(){\n" +
    				"setTimeout('step2()', 10);}\n" +
    				"function step2(){window.print();window.close()}\n" +
    				"</scri" + "pt></head><body onload='step1()'>\n<table><tr><td><h2>Order #" + $(this).attr('href') + "</h2></td></tr><tr><td><table>" + $('#orders_details_general_expander table').html() + "</table></td></tr><tr><td><br /><hr /><br /><table>" + $('#orders_details_items_expander .woocommerce_order_items').html() + '</table></td></tr><tr><td><br /><hr /><br /><table style="width:50%;float:right;">' + $('#orders_details_items_expander .wc-order-totals').html() + '</table></td></tr></table></body></html>' );
    			pwa.document.close();
    		});
    	});
    	</script>
    	<?php
    }, 20 );
    Thread Starter mellow1

    (@cdsigns)

    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.
    Thread Starter mellow1

    (@cdsigns)

    Currently the print button is at the detail page where a store vendor can check an order: Screenshot-2020-08-17-at-19-04-54

    We would like to add the print button to the notification pop up: idea shown within the red border.
    order-Notification-Popup

    Thread Starter mellow1

    (@cdsigns)

    Could you please let us know if you need any link or further information to help us out?

    Thank you!

    Thread Starter mellow1

    (@cdsigns)

    Might there be a possibility to send screenshots of the server settings through a private upload / email? I would prefer them to not be open on this forum but not sure how that might be possible.

    Thread Starter mellow1

    (@cdsigns)

    Hi Lawrence,

    Thank you so much! we’ll have a look at all the code you’ve provided. We’ve been busy setting up all of our restaurants with the print plugin and have not been able to test it just yet because of the transition.

    Unfortunately several restaurants are showing issues a day after successfully installing the plugin and doing some test orders on the first day. On day 1 it works like a charm, within seconds the receipt is printed, with the buzzer and 2 copies, this is amazing!

    But on the second day print jobs are no longer showing up on the counter. If we check the settings page in WordPress, the “selected printer” dropdown is empty on day 2. After inspection we’ve found out that the orders are not visible in the ‘order_history’. There is also nothing in the ‘queue’-file or the ‘pending’ folder if we look at the plugin files.

    We set our STAR TSP 654 printers with a static IP and connect them, just like you advise in the ‘installation’ of the plugin. But on the second day the printer is gone from the backend and (off course) the orders are no longer printed.

    We’re trying to figure out what causes this problem, because the printer still can be reached, that next day, through the original IP and if we login on the printer, through the browser, the cloud settings with the shop-url are also still present and cloud print is enabled.

    Do you know of any other printer settings we might need to adjust or change to keep the printer connected? The thermal printers have loads of options like keep alive and much more we just keep on the defaults normally.

    Any ideas or suggestions are highly appreciated.

    Thread Starter mellow1

    (@cdsigns)

    Hi,

    The buzzer code works like a charm, perfect!

    So for our other questions. We have a receipt, and already adjusted the display of some elements to make it better appropriate for our kitchen. But we are struggling with the product variations and display of that. I hope my wordpress-system translations are correct because the site is in Dutch.

    In the WordPress site we have a product attributes set up. It is in Dutch but it says: do you want a bun? (broodje)
    ja +0,60 (yes)
    nee (no)

    As you can see in the first image: Product-Variations-And-Terms

    So currently our receipt displays on the print:
    qty item name – attribute term
    attribute: term

    as you can see in this image:
    Current

    But we want to remove the attribute term on the first line so it will be:
    qty item name
    attribute: term
    Desired-Receipt

    We understand we need to change something in order-handler.php but do not understand what. Because the first line of code only requests product_name, but is also displays the chosen variation.

    Looking forward to your reply.

    Thread Starter mellow1

    (@cdsigns)

    Hi Lawrence,

    Thank you for the very fast response. I did sent an email to support as well, but that was mainly about the firmware update for the printer itself.

    We have a Star TSP654II set up.

    It would be amazing if you could help us or send an instruction so we can add it. Would be more than okay to just get an overview of how to add it through terminal or something like that.

    We would like the buzzer to go off at the start of the document. With the normal settings we can also control the number of times the buzz is and the pauze. Would that also be possible to set here? Maybe like: buzz #1 500milliseconds, pauze 200milliseconds, buzz #2 500milliseconds

    If that is not possible we understand, any buzz will be great for the kitchen.

    Also looking forward to seeing if there is a possibility regarding the repetition of variations on the receipt.

    thank you!

    Thread Starter mellow1

    (@cdsigns)

    Hello,

    If you visit this page: https://fddesigns.nl/cappadociasneek/product-category/schotels/ and select one of the ‘quick view’ buttons, you can select a ‘Saus’.

    It functions as a dropdown, but all the options are already visible and you can not select any of them.

    Thank you very much for your reply

Viewing 10 replies - 61 through 70 (of 70 total)