Nop 2.0 order of steps in checkout

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
ajhvdb wrote:
Ok, so you create the basket again from the order and use a flag "use order 10".

No. Just use the info from already placed (but not paid) order.

ajhvdb wrote:
What will happen to orders created as guest?

Not decided yet
12 years ago
Some ideas:

Use a cookie "confirmed ordernumber" for guests and when they revisit send them to the payment page. When they cancel again delete the order or ask for there emailaddress to send it as a quote.

For existing customers give the option on the payment page to save the order as a quote

Those unpayed orders are very interesting for the webshop

The webshop needs to send email reminders about these order to the customers.
12 years ago
Hi all,

Here's how I solved it. I've extended the customer panel to show a "pay via PayPal" button on the order details page of all orders which are unpaid. I've also added a ActionMethod there to allow viewing order by GUID insted of UID.
Than I've added a MessageTemplateToken to enable putting order details via guid into "order placed" email.

This way the customer (even guest) can finish off post-payment even if they failed the first time round.

Hope this help!

Filip

PS. I can share the code but it's far from high nop commerce standards.
12 years ago
fkierzek wrote:
I can share the code but it's far from high nop commerce standards.

Sure. It would be great. because it can save a lot of time for me when I start implementing this feature
12 years ago
Hi all,

Here's the code I created to let customer with payments problem reinitialize the payment. Please note that this is a "hack" not Nop-quality code. Use at your risk.


To the end of public virtual void AddStoreTokens(IList<Token> tokens) in D:\projects\PKI-COM\Libraries\Nop.Services\Messages\MessageTokenProvider.cs add:

tokens.Add(new Token("Order.OrderGuidURLForCustomer", string.Format("{0}orderdetailsguid/{1}", _webHelper.GetStoreLocation(false), order.OrderGuid)));


In public virtual string[] GetListOfAllowedTokens() in the same file add "%Order.OrderGuidURLForCustomer%" token (anywhere in the list).

Now you can stick link to order via GUI into customer email.

I've created a new View called DetailsGuid.cshtml and placed in the D:\projects\PKI-COM\Presentation\Nop.Web\Views\Order\DetailsGuid.cshtml location. It contains following fragment. Notice very lame status checking. However order status is not available via ID there.

@using (Html.BeginForm("Details", "Order", FormMethod.Post))
                    {
                        if (Model.OrderStatus.Contains("Oczekuje") || Model.OrderStatus.Contains("Pending"))
                        {
                        <tr>
                            <td colspan="2" style="border: solid red 3px; margin: 10px; padding: 20px;" align="center">
                                
                                    <b><a href="@Url.RouteUrl("PayForOrder", new { orderId = Model.Id })" target="_blank" class="reorderbutton">Pay for Order</a>
                                    <text>
                                    <br />
                                    <br />
                                    To zamówienie jest nieopłacone. Jeśli chcesz zapłacić przez PayPal or Kartą Płatniczą kliknij "Pay for Order".<br />                                    
                                    <i>This order is not yet paid for. To pay now with PayPal or Credit Card click the "Pay for Order" button.</i>
                                    <br />                                    
                                    </text>
                                </b>
                            </td>
                        </tr>
                        }
                    }



Add following to the public void RegisterRoutes(RouteCollection routes) method in D:\projects\PKI-COM\Presentation\Nop.Web\Infrastructure\RouteProvider.cs

            routes.MapRoute("OrderDetailsGuid",
                            "orderdetailsguid/{orderGuid}",
                            new { controller = "Order", action = "DetailsGuid" },
                            //new { orderGuid = @"[a-z0-9-]" },
                            new[] { "Nop.Web.Controllers" });



Add following methods to the D:\projects\PKI-COM\Presentation\Nop.Web\Controllers\OrderController.cs.

        [NopHttpsRequirement(SslRequirement.Yes)]
        public ActionResult DetailsGuid(string orderGuid)
        {
            var order = _orderService.GetOrderByGuid(new Guid(orderGuid));
            if (order == null || order.Deleted /*|| _workContext.CurrentCustomer.Id != order.CustomerId*/)
                return new HttpUnauthorizedResult();

            var model = PrepareOrderDetailsModel(order);

            return View(model);
        }

        [NopHttpsRequirement(SslRequirement.Yes)]
        public ActionResult PayForOrder(int orderId)
        {
            var order = _orderService.GetOrderById(orderId);
            //FK: this is a security problem TODO: do this right ...
            if (order == null || order.Deleted /*|| _workContext.CurrentCustomer.Id != order.CustomerId*/)
                return new HttpUnauthorizedResult();

            var model1 = PrepareOrderDetailsModel(order);

            ProcessPaymentRequest processPaymentRequest = new ProcessPaymentRequest();
            processPaymentRequest.Customer = _workContext.CurrentCustomer;
            processPaymentRequest.PaymentMethodSystemName = order.PaymentMethodSystemName;

            var postProcessPaymentRequest = new PostProcessPaymentRequest();
            postProcessPaymentRequest.Order = order;
            _paymentService.PostProcessPayment(postProcessPaymentRequest);

            return View("Details", model1);
        }


I think that's it. Now if you stick the order by guid into customer email if they go that order and it's unpaid they'll see a "Pay" button which will take them to paypal standard payment (hardcoded).

Filip
12 years ago
Filip,

Great! Thanks a lot! I think it can be added in version 2.20
12 years ago
How soon?  To get the best rates with PayPal Direct (Pro) - PayPal requires the "Express Checkout" be offered.  We really need an option with Pro to enable Express via configuration - or just enable it separately.  I'm working hard to get a new 2.0 store online and would really like to use Pro & Express.  I can help with development if you need it.
12 years ago
viperguynaz wrote:
I can help with development if you need it.

I don't plan to do it in the near time (I'm not sure whether I'll do it). So it would be great if you can contribute it as plugin.
12 years ago
Andrei,

I am thinking of modifying paypal standard plugin to ProcessPayment rather than PostProcessPayment? Any suggestions or things to watch out for?

Speaking from business perspective:
Looking at orders over last few days I get a lot of orders where customer places the order and than doesn't feel obliged to finish off paying for it. It seems like psychologically they feel as if once they get the order placed email they've done their bit and can start having second thoughts  and often cancel .. and it's down on me to chase them down with payment requests just to find out they want to cancel. When had to pay for the order to be placed .. I had more orders and less talking and cancelations were rare..

Filip
12 years ago
fkierzek wrote:
I am thinking of modifying paypal standard plugin to ProcessPayment rather than PostProcessPayment? Any suggestions or things to watch out for?

Sure, you can do it. There were some discussions on these forums about using ProcessPayment for "redirection" payment methods. It's not used for some reasons such as the following one.

Managing product quantity. You have 5 items of "product 1". And it doesn't allow negative quantity. Two customers are simultaneously redirected to a third-party site. Both of them have "product 1" in the carts and the quantity set to 4. So after orders are paid (on a third-party site) they're redirected back to a store site and then orders should be placed. The first customer will be able to place order (total product quantity will become 5-4=1). But the second customer will not be able to do it (if case if the negative quantities are not allowed). But both of them completed have the payments
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.