I would like to learn more about your workflow. Your customer puts items in the basket/cart and finalizes the purchasem creating an invoice. Then you want to send a notification prior to payment of the invoice (whilte status is cancelled or unpaid or partial). Is that the correct workflow?
2. Then the user navigates to a basket and confirms that all products in the cart it is ready to buy.
3. At the checkout page, the user fills in the following fields: name, phone number, email address and confirm your purchase.
After the third step, I must send a notice to the client with a list of products, and the administrator of the site that created a new invoice.
At the moment, will not be online payment through the website, the site owner will contact the customer by phone and will take the products to the customer. Payment will be in cash at the meeting.
I'd love to know the use case for this ... sounds super interesting.
// start with the Invoice Service
var invoiceService = MerchelloContext.Current.Services.InvoiceService;
// Create an unpaid invoice status (or use whatever status appropriate)
var invoiceStatus = invoiceService.GetInvoiceStatusByKey(Merchello.Core.Constants.DefaultKeys.InvoiceStatus.Unpaid);
var billingAddress = [your address as IAddress];
var invoice = invoiceService.CreateInvoice(invoiceStatus.Key);
invoice.SetBillingAddress(billingAddress);
// if you have products - loop through them and add them as line itesm
foreach(var product in productsArray)
{
var extendedData = new ExtendedDataCollection();
var variant = product.GetProductVariantForPurchase();
extendedData.AddProductVariantValues(variant);
var lineItem = new InvoiceLineItem(LineItemType.Product, product.Name, product.Sku, 1, price, extendedData);
invoice.Items.Add(lineItem);
}
// you would add a shipping line item if applicable (let me know if you need this one - tricky to do without providers)
// you would add a tax line item too if applicable
invoice.Total = invoice.Items.Sum(x => x.TotalPrice);
// optional stuff
// invoice.PoNumber = [your PO Number]
// invoice.InvoiceNumberPrefix = [prefix for the invoice number]
invoiceService.Save(invoice);
// Updates the sales history (not required)
invoice.AuditCreated();
You might consider using the default Cash Payment provider - it should work where ever. Depending on how you are using the notifications to handle your payment, I'll bet there is a way to come up with a workflow to make it "automated".
Hi Vitaly - I don't mean to make it seem like I am ignoring it, I just have not had time to get to it yet as I have other things due as well. I will bump it up on my to do list ...
Is this the only place you've seen where saving Russian works is an issue or is is systemic?
How to create the invoice, if all of the providers I only use Notification Provider?
Hi everyone!
I understand that it's a little strange, but at the moment I need a shop that can only send notifications without payment.
I can't find an example that I made it possible to create an invoice with only the values in the "Address".
Thanks!
Hi Vitaly,
I would like to learn more about your workflow. Your customer puts items in the basket/cart and finalizes the purchasem creating an invoice. Then you want to send a notification prior to payment of the invoice (whilte status is cancelled or unpaid or partial). Is that the correct workflow?
-Dina
Hi Dina,
Workflow will be as follows:
1. The user adds products to cart
2. Then the user navigates to a basket and confirms that all products in the cart it is ready to buy.
3. At the checkout page, the user fills in the following fields: name, phone number, email address and confirm your purchase.
After the third step, I must send a notice to the client with a list of products, and the administrator of the site that created a new invoice.
At the moment, will not be online payment through the website, the site owner will contact the customer by phone and will take the products to the customer. Payment will be in cash at the meeting.
Hi Vitaly,
I'd love to know the use case for this ... sounds super interesting.
Hi Rusty,
Quite simply, we are from Russia and we have no possibility to use any payment provider.
This provider need to write yourself, but it's not simple.
For Umbraco no e-commerce package, which would have this capability out of the box.
If not Merchello, I would have to write custom e-commerce package. But he would not be as good as Merchello.
Thank you for a piece of code will check tomorrow.
Good luck.
HI Vitaly,
You might consider using the default Cash Payment provider - it should work where ever. Depending on how you are using the notifications to handle your payment, I'll bet there is a way to come up with a workflow to make it "automated".
Let me know if you want to chat about it.
Thanks,
Rusty
Hi Rusty,
Thanks for the tip, I'll try to understand.
To me it is very important that you have fixed the ticket of M-520. But you ignore it. Why?
Hi Vitaly - I don't mean to make it seem like I am ignoring it, I just have not had time to get to it yet as I have other things due as well. I will bump it up on my to do list ...
Is this the only place you've seen where saving Russian works is an issue or is is systemic?
Hi Rusty,
At the moment this is the only place. But how come some free time, I will test other parts Merchello.
Thanks Vitaly - Let's continue this discussion on the issue - http://issues.merchello.com/youtrack/issue/M-520
is working on a reply...