I have a custom module that creates a block. This block is a chat that interacts with an external service through an API.
When the user sends a message through the chat, jQuery takes the message and sends it using $.ajax() to submit.php which then does all the handling to get the response from the API and returns in back to jQuery to be displayed to the user.
Now all of this is in theory, since I haven't been able to find a way to get the correct path to that submit.php file.
i am trying to make simple custom services with dependency injunction + ajax form. when i am trying to include custom service to my form builder class with help of dependency injunction, i am getting the following error. can you any one help me. i am new for Drupal.
I use Drupal 8 and Commerce 2, I have standard Drupal shipping, have 2 types of product “default” and “downloadable” and set standard shipping in Drupal 8 and Commerce 2.
I have 2 question now:
How I can get product types in order.
How I can programmatically get info (name, cost and etc) for shipping in order.
Now I use:
$order = Order::load(1);
foreach ($order->getItems() as $key => $order_item) {