Copied to clipboard

Flag this post as spam?

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


  • RunnicFusion 62 posts 145 karma points
    Apr 26, 2018 @ 14:35
    RunnicFusion
    1

    First website with Merchello

    Hi,

    I'm very new to Merchello and would like to use it in an website i'm creating right now.

    I've added the Package trough the dashboard and installed the Merchello.Core NuGet package (version 2.6) in Umbraco 7.10.2.

    Inside my view I saw I had an helper like:

    @CurrentCustomer.Basket().AddItem(Model.MerchProduct, 99);
    

    Model.MerchProduct is my Merchello product picker on my DocumentType.

    Do I need to create my own controller for doing that? In the demo project Fasttrack I saw this action wrote down inside the .cshtml file:

    @Html.Action("BasketForm", "StoreBasket", new { area = "Merchello" }) 
    

    When I added the logic from The Merchello.Web.Store project (from Github) to my Visual Studio solutiond and try to build it. It said that I allready have the models and controllers (with are inside an Merchello.dll).

    Could't find more information inside the documentation about this.

    So my question are:

    • Do I need to create my own controllers for posting products and so on?
    • Is there some kind of public action where I can hoop in from my views (posting to)

    Could you please point me in the right direction?

  • Anon 29 posts 125 karma points
    Apr 26, 2018 @ 15:56
    Anon
    0

    You can create your own controllers which extend from the current ones - in this case, I have an extension controller for the basket form which reads as:

    @Html.Action("BasketForm", "StoreBasketExtend")
    

    It uses all the existing models, but with this I've copied the existing logic from Merchello and then added in some bespoke code I need. You can do the same thing for adding products to your basket, applying coupons etc.

    Hope this helps!

  • RunnicFusion 62 posts 145 karma points
    May 01, 2018 @ 14:41
    RunnicFusion
    0

    Thanks for your reply! We extended the basket controller and it works fine right now.

    An other question: Right now i'm using Fastrack for rendering the Checkout (fine for now), but got an error on using this reference: Merchello.FastTrack.Ui

    I've builded my project (and the models, Models namespace is Umbraco.Web.PublishedContentModels)

    Do I need to change someting, for example I can't use: ExampleUiHelper?

    Also; I saw that the checkout is devided into serveral pages, could we also make this as one page (do you have an axample of what to change).

  • Anon 29 posts 125 karma points
    May 03, 2018 @ 15:50
    Anon
    0

    It's been a while, but I'm sure I stripped out all references to ExampleUiHelper as they were also throwing errors for me.

    In terms of having a one page checkout, I can tell you from experience it's not easy - it's doable, but you are making a lot of changes to Merchello to get it up and running. An issue I ran into was creating a "fake" (or blank) Invoice at the start of the process, when this can normally only be created once shipping details have been entered (someone may correct me here with a nice workaround!).

    It would be easier to create it as a multi-stage checkout and loading the next section through Ajax.

  • RunnicFusion 62 posts 145 karma points
    May 07, 2018 @ 13:14
    RunnicFusion
    0

    Thank you, will look into it.

  • RunnicFusion 62 posts 145 karma points
    May 09, 2018 @ 14:20
    RunnicFusion
    0

    Currently in my ResolvePayment.cshtml I have added the following line:

    case "Mollie": @Html.Action("PaymentForm", "Mollie", new { area = "FastTrack", view = "~/Views/Merchello/Checkout/Mollie/PaymentForm.cshtml" }) break;

    The websites gives me the folowing error:

    No route in the route table matches the supplied values.
    

    My logic:

    [GatewayMethodUi("Mollie")]
    public class MolliePaymentGatewayMethod : PaymentGatewayMethodBase
    {
    

    And:

      [GatewayProviderActivation("f8fa58d9-2c0d-4e07-aaac-e0f86f5b614a", "Mollie Payment Provider", "Mollie Payment Providor")]
            public class MolliePaymentGatewayProvider : PaymentGatewayProviderBase, IPurchaseOrderPaymentGatewayProvider
    

    And the view that i would like to render:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<Mollie.PaymentProviders.MolliePaymentModel>
    @using System.Web.Mvc.Html
    @using Mollie.Payment;
    @using Umbraco.Web
    @{
        var umbHelper = new UmbracoHelper(HttpContext.Current.GetUmbracoContext());
    
        string invoiceUrl = umbHelper.TypedContentAtRoot().DescendantsOrSelf<Checkout>().Where(n => n.TemplateId == 1206).Count() > 0 ? umbHelper.TypedContentAtRoot().DescendantsOrSelf<Checkout>().Where(n => n.TemplateId == 1206).FirstOrDefault().Url : null;
        Model.SuccessRedirectUrl = invoiceUrl;
        @* todo: check where! *@
        string paymentMethodUrl = umbHelper.TypedContentAtRoot().DescendantsOrSelf<Checkout>().Where(n => n.TemplateId == 1126).Count() > 0 ? umbHelper.TypedContentAtRoot().DescendantsOrSelf<Checkout>().Where(n => n.TemplateId == 1126).FirstOrDefault().Url : null;
    }
    @* todo *@
    <h3>Betallen</h3>
    @using (Html.BeginUmbracoForm<MolliePaymentController>("Process", new { area = "FastTrack" }))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(x => x.SuccessRedirectUrl)
    
        <a href="@paymentMethodUrl" class="btn btn-default">Terug</a>
        <input type="submit" class="btn btn-default pull-right" value="Betalen" />
    
    }
    

    What is missing? Tried the Name 'Mollie', 'MolliePayment' inside my html.Action.

  • Greg Woods 12 posts 92 karma points
    Jun 05, 2018 @ 10:27
    Greg Woods
    0

    Hi Runnic

    Did you end up resolving this?

    I'm stuck at the same point.

  • Barry Fogarty 493 posts 1129 karma points
    Jun 06, 2018 @ 12:34
    Barry Fogarty
    0

    Runnic,

    Try without the area = "FastTrack", in your action. That is reserved for action methods decorated with an area attribute of "FastTrack", so they can be separated from other Plugins and custom code.

    If you have writting your own Action Method in the MolliePaymentController you should not need to specify area at all (or possible area = "")

Please Sign in or register to post replies

Write your reply to:

Draft