for the pdf-invoice, I create a QR-Code for every single product which was purchased.
Now I want to save the data(6 letters) behind the QR-code in the database. I added a new Table in the Database. But I don't know how I can insert the data in the database.
How do I get the right context? Or what do I need to do that?
I just need to have access to the data with an API, wich will send the data to raspberry pi, but this is not the problem. I just need the 6 letters to be saved in the nop database so I have access to the data with the API
I hope there were no misunderstandings. Because if a user purchases the same product twice, he will get two different QR-Codes for it. Because it will be used for the access controll
Would you be so nice to explain this a little bit to me?
I am a NopCommerce newbie, but I got little coding skills.
Or a example would be ok, too, so that I can understand what to do exactly.
You can create a plugin to HandleEvent(OrderPaidEvent orderPaidEvent) From OrderPaidEvent you can get to Order From Order.Id you can use OrderService to get the IList<OrderItem> GetOrderItems Foreach OrderItem, create generic attribute
You'll note the the PDFService uses GetOrderItems: var orderItems = _orderService.GetOrderItems(order.Id, vendorId: vendorId); So you should be able to get the generic attribute value to print your QR code.