• Resolved mattemar

    (@mattemar)


    Hi guys,

    I have 2 shipping methods, delivery and pickup. The delivery is charged £2,00. In the printed receipt I can see that the £2,00 are added to the total of the order but it’s not stating anywhere the name of the shipping method and its price.

    Could you please help? The shipping method is the woocommerce one, not using a different plugin.

    Thanks.

    • This topic was modified 3 years, 9 months ago by mattemar.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @mattemar

    You are right, the shipping cost is not currently printed, we will make sure that it is supported in the next, version 2.1 release.

    While waiting for 2.1, if you want to add this to your existing site, and are comfortable with making a small modification the the php code of the plugin, then you can add the following line to the function named “star_cloudprnt_print_item_totals” in the file “order-handler.php”:

    $ft("SHIPPING", (float)$order->get_shipping_total());

    or, to print the shippint total including tax:

    $ft("SHIPPING", (float)$order->get_shipping_total() + (fload) $order->get_shipping_tax());

    You can add this wherever you like in the function, as long as it is after the $printer->set_text_right_align(); line.

    Thread Starter mattemar

    (@mattemar)

    Hi @lawrenceowen

    Thanks for your answer.

    Unfortunately it doesn’t work, the first code without the tax creates a website error and the 2nd one with the tax brakes the website.

    I’m adding it in between these 2 lines:

    star_cloudprnt_print_item_totals($printer, $selectedPrinter, $order, $order_meta);
    		
    $ft("SHIPPING", (float)$order->get_shipping_total());
    		
    star_cloudprnt_print_customer_notes($printer, $selectedPrinter, $order, $order_meta);

    Thanks for your help.

    • This reply was modified 3 years, 9 months ago by mattemar.
    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @mattemar
    The line that I gave must be inside the “star_cloudprnt_print_item_totals” function. I’m not sure which version of the plugin you have now, or if it has any modifications, but that function should be defined at around line 289 of the order-handler.php file.

    My recommendation is to it just before the existing line:
    $ft("TOTAL", $order_meta['_order_total'][0]);

    Which is responsible for printing the order total, so perhaps change it to:

    $ft("SHIPPING", (float)$order->get_shipping_total());
    $ft("TOTAL", $order_meta['_order_total'][0]);
    

    And apologies, there is a typo in the line that includes tax, it should be:
    $ft("SHIPPING", (float)$order->get_shipping_total() + (float)$order->get_shipping_tax());

    Hopefully this will get you up and running, let me know how you get on.

    • This reply was modified 3 years, 9 months ago by lawrenceowen.
    Thread Starter mattemar

    (@mattemar)

    Thanks @lawrenceowen

    I’ve got the last version and now it worked how you have recommend in the last answer. Many thanks!

    Maybe in the next update you could change “SHIPPING” to the automatically rename depending on the selected shipping method (e.g DELIVERY or PICKUP) or even better hide it if pickup is selected, which in most of the cases is free for restaurants ??

    Thanks again!

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @mattemar Great, thanks for letting me know that it working.

    Nice suggestion too ?? Version 2.1 will allow you to add custom filter logic to achieve exactly that, but for those who don’t want to write their own theming plugin, this would be a nice addition.

    If you want to try something similar now, then you can replace the line that gave you before with:
    $ft($order->get_shipping_method(), (float) $order->get_shipping_total());

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Delivery Shipping price not showing but it’s in the total’ is closed to new replies.