Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frans Lammers 57 posts 400 karma points c-trib
    May 23, 2017 @ 09:01
    Frans Lammers
    0

    Problem with Merchello checkout

    Hi,

    We're building a shop using Merchello using FastTrack as an example.

    I installed Merchello without the fasttrack and I am able to call most steps in the process. I can add and remove products to the basket. For example adding products to the basket I do by using the next line in my view:

    @Html.Action("AddProductToBasketForm", "StoreBasket", new { area = "Merchello", model = Model })
    

    But when I try to implement the checkout I run into a problem. In my view I use:

    @Html.Action("BillingAddressForm", "CheckoutAddress", new { area = "Merchello" })
    

    but when I run it I get the yellow screen saying "No route in the route table matches the supplied values."

    Do I call the wrong method or do I forget something?

  • Frans Lammers 57 posts 400 karma points c-trib
    May 24, 2017 @ 14:20
    Frans Lammers
    0

    Since I didn't find the answer yet, I tried to make a very simple Surfacecontroller to test like so:

    public class TestCheckoutController : MerchelloSurfaceController
    {
    
        public ActionResult Checkout()
        {
            var currentCustomer = new CustomerContext(Umbraco.UmbracoContext).CurrentCustomer;
            if (!currentCustomer.IsAnonymous)
            {
                var basket = currentCustomer.Basket();
                var checkoutManager = basket.GetCheckoutManager();
                var billingAddress = checkoutManager.Customer.GetBillToAddress();
                var shippingAddress = checkoutManager.Customer.GetShipToAddress();
            }
            return View();
        }
    }
    

    After the shippingAddress I put a breakpoint. When I reach this breakpoint I can see that both currentCustomer and checkoutManager.Customer contain the addresses I entered in the backoffice.

    But: both billingAddress and shippingAddress are empty, the GetBillToAddress() and GetShipToAddress() methods return null.

    I have not found any example of how to make a simple checkout procedure. In an old forum-topic I found a reference to http://merchello.com/documentation/getting-started/how-to/Simple-Checkout-Process but that leads to an errorpage.

    How do I have to setup the checkout in Merchello?

  • Lee 1130 posts 3088 karma points
    May 30, 2017 @ 08:35
    Lee
    0

    You have the wrong route for the billing address. It should be in the fasttrack

    @Html.Action("BillingAddressForm", "CheckoutAddress", new { area = "FastTrack" })
    

    Not area = Merchello.

    https://github.com/Merchello/Merchello/blob/f3dd636fb3449d58d82ecd178b2ce9b1093c9615/src/Merchello.FastTrack.Ui/Views/ftBillingAddress.cshtml

  • Lee 1130 posts 3088 karma points
    May 30, 2017 @ 08:43
    Lee
    100

    Sorry, I've just re-read that. You will need FastTrack to use that action as FastTrack is the implementation of our starter kit.

    I realise it's a bit confusing with some using the area = merchello and some using the area = fasttrack.

    But have a read of this post for more info:

    https://merchello.com/blog/fasttrack-build-ecommerce-sites-in-umbraco-quickly/

    You can pull in the fasttrack binaries using the nuget package

    https://www.nuget.org/packages/Merchello.FastTrack/

    It won't create all the FastTrack site but it will enable you to use the Actions you are trying to use, such as these

    Basket Summary

    @Html.Action("BasketSummary", "CheckoutSummary", new { area = "FastTrack" })
    

    Render the Invoice Summary

    @Html.Action("InvoiceSummary", "CheckoutSummary", new { area = "FastTrack" })
    

    Render the SalesReceipt

    @Html.Action("SalesReceipt", "CheckoutSummary" ,new { area = "FastTrack" })
    

    Render the Billing Address Form

    @Html.Action("BillingAddressForm", "CheckoutAddress", new { area = "FastTrack" });
    

    Render the ShippingAddressForm

    @Html.Action("ShippingAddressForm", "CheckoutAddress", new { area = "FastTrack" })
    

    Render the Shipping Rate Quote form

    @Html.Action("ShipRateQuoteForm", "CheckoutShipRateQuote", new { area = "FastTrack" })
    

    Render the PaymentMethodForm

    @Html.Action("PaymentMethodForm", "CheckoutPaymentMethod", new { area = "FastTrack" })
    

    Render the ResolvePayment

    @Html.Action("ResolvePayment", "CheckoutPaymentMethod", new { area = "FastTrack" })
    

    Render the LoginForm

    @Html.Action("LoginForm", "CustomerMembership", new { area = "FastTrack" })
    

    Render the RegisterForm

    @Html.Action("RegisterForm", "CustomerMembership", new { area = "FastTrack" })
    

    Render the CustomerSalesHistory

    @Html.Action("CustomerSalesHistory", "CustomerMembership", new { area = "FastTrack" })
    

    Render the CustomerBillingAddress

    @Html.Action("CustomerBillingAddress", "CustomerMembership", new { area = "FastTrack" })
    

    Render the CustomerShippingAddress

    @Html.Action("CustomerShippingAddress", "CustomerMembership", new { area = "FastTrack" })
    
  • Frans Lammers 57 posts 400 karma points c-trib
    May 30, 2017 @ 13:25
    Frans Lammers
    0

    Hi Lee,

    Thanks for your answer!

    The project I am working on is in fact a very simple store: there is only one shipping and one payment method, all customers need to login before ordering and have a static billing address.

    At the moment I have got the custom surfacecontroller working and will go on with that one, but for future projects I will certainly use the fasttrack binaries and the overview of checkout-actions you have given here!

Please Sign in or register to post replies

Write your reply to:

Draft