commerce – How can I load the #totals property for the receipt theme in a custom module?

I am trying to manually output the customer’s receipt on the checkout complete screen in a custom module.

I have the receipt printing nicely except for the “totals” variable.

My current custom code is the following.

$renderable = array(
      '#theme' => 'commerce_order_receipt',
      '#order_entity' => $order,
      '#billing_information' => NULL,
      '#shipping_information' => NULL,
      '#payment_method' => NULL,
      '#totals' => $this->orderTotalSummary->buildTotals($order), // <-- this is the problem
    );
 return array(
      '#theme' => 'custom_blocks_checkout_complete',
 '#order' =>  Drupal::service('renderer')->render($renderable),
    );

As you can see, it’s using $this->orderTotalSummary->buildTotals($order) to generate the #totals property and this was copied from the OrderReceiptMail class in the Order module. How can I get this property to populate from my custom module please?

How can I load Commerce #totals variable for the receipt theme in a custom module?

I am trying to manually output the customer’s receipt on the checkout complete screen in a custom module.

I have the receipt printing nicely except for the “totals” variable.

My current custom code:

$renderable = array(
      '#theme' => 'commerce_order_receipt',
      '#order_entity' => $order,
      '#billing_information' => NULL,
      '#shipping_information' => NULL,
      '#payment_method' => NULL,
      '#totals' => $this->orderTotalSummary->buildTotals($order), // <-- this is the problem
    );
 return array(
      '#theme' => 'custom_blocks_checkout_complete',
 '#order' =>  Drupal::service('renderer')->render($renderable),
    );

As you can see, #total is using $$this->orderTotalSummary->buildTotals($order) to generate the #totals variable and this was copied from the OrderReceiptMail class in the Order module. How can I get this #totals variable to populate from my custom module please?

php – Trying to manually print Commerce receipt in custom module but stock on printing total/adjustments

I have a custom module that displays the Commerce receipt at the checkout complete screen. I have it all working except for the adjustments (tax, shipping, discounts) section.

In my custom module I have:

 $renderable = array(
      '#theme' => 'commerce_order_receipt',
      '#order_entity' => $order,
      '#billing_information' => NULL,
      '#shipping_information' => NULL,
      '#payment_method' => NULL,
      '#totals' => NULL,
      //'#totals' => $this->orderTotalSummary->buildTotals($order),
    );
    if ($billing_profile = $order->getBillingProfile()) {
      $profile_view_bulder = Drupal::entityTypeManager()->getViewBuilder('profile');
      $renderable('#billing_information') = $profile_view_bulder->view($billing_profile, '');
    }
  }else{
    $renderable = NULL;
  }

The commented line: (‘#totals’ => $this->orderTotalSummary->buildTotals($order), ) is what calls and generates the totals to pass to the receipt theme template but since it’s in a custom module the “$this” part is not functioning.

The line was originally in commerce/modules/order/scr/Mail/OrderReceiptMail

Any tipes on how to get that method call to work in my module?

8 – Use Order Number in Receipt

I want to use the Order number rather than the order id. I’m using Commerce POS and it uses $commerce_order->id()to generate the id used in the order # used in the receipt generated and receipt email sent. But in trying to use $commerce_order->getOrderNumber() it returns empty (even though that’s what is used in commerce/modules/order/src/Mail/OrderReceiptMail.php). I expected that the Order object holds everything related to an order including the Order Number.

The confirmation email which is default to commerce produces the expected order number and formatted as defined by the Number pattern. What is right snippet to order number?

thunderbird – What is the difference between the “Return Receipt” and “Delivery Status Notification” in the “Options” on the Write window

Could some one explain about “Return Receipt” and “Delivery Status Notification”.
What is the difference between them?

I had used both the options when sending Email enabling the required config settings. But I see there is no difference. As Email arrives to recipient/correspondent without getting any notification to the sender.

How does it actually work. Suggest if there are any third party app to do so?

My receipt is Faded

Basically after purchasing my bitcoin from atm machines i put receipt in wallet by the time I went to use it some of the the receipt was faded to were i can’t read it and it won’t even scan. What do I do?

Design – How can I connect to a kitchen printer (or any receipt printer) and have custom online orders printed?

If I were to create an online food ordering app but want to print a receipt in the kitchen, how would I do it?

There are many SaaS solutions such as Uber Eats and other apps that customers can use to order groceries online. However, all orders are only displayed on the tablet you specified. What if the kitchen was huge or the receipt huge, how would the person in front of the kitchen say exactly what they need? Would they have to rewrite it on paper or something?

Regardless, the tablet solution is easy to implement. Is it possible to connect to a small recipe / kitchen printer over the Internet and send it a request to print an order with X items? I looked around, but apparently I can't find a solution. Most printers have Bluetooth (which doesn't help me in this case), and some say they connect using an Ethernet cable. However, I have not found any information on whether / how I can connect to the printer and have it print jobs.

I looked around and found another software that says it can send orders online to the kitchen printer. How do you do that?

Alternatively, if you have any suggestions on how to deal with online orders, I am all ears! Thanks a lot

woocommerce – Add product categories to the receipt

So far I have the following code for my receipt:

get_items() as $item) {
    /* @var $item WC_Order_item */
    $meta = $item('item_meta');
    $meta = array_filter($meta, function ($key) {
        return !in_array($key, Order::getHiddenKeys());
    }, ARRAY_FILTER_USE_KEY);
    ?>
    
    
        x 
        get_data()('total'), array('currency' => $order->get_currency())); ?>
    
    ';
        $result .= '' . $key . '';
        $result .= '' . $meta . '';
        $result .= '';
        return $result;
    }, $meta, array_keys($meta));
    echo implode(PHP_EOL, $meta);
    ?>
    

I want to add categories to help our cook. At least we would like to insert the category in brackets after the article name. Ideally, however, we'd like to break all items down by category along with a category heading and want the categories to be displayed in ascending order, if possible, according to their specified tag_id. Certainly not just PHP when editing the HTML.

Any help would be appreciated! So far the receipt looks like:
Enter the image description here

Quickbooks Online – How can you change the "Standard" product / service category when a purchase receipt is retrieved from PayPal?

Stack Exchange network

The Stack Exchange network consists of 175 Q&A communities, including Stack Overflow, the largest and most trusted online community where developers can learn, share their knowledge, and build their careers.

Visit Stack Exchange