Copied to clipboard

Flag this post as spam?

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


  • Tolu Jemilua 39 posts 166 karma points
    Aug 28, 2017 @ 14:09
    Tolu Jemilua
    0

    MerchelloApiController Not Working

    Hi, if anybody has a a solution to this or has an idea for the reason why, please help me out.

    I am trying to inherit the MerchelloApiController to perform an action, using an ajax call via javascript. The issue is that my method isnt being hit but when I change it from MerchelloApiController to UmbracoApiController, it works perfectly fine.

    My ApiController looks like this:

    public class BasketController : MerchelloApiController
    {
    
        [HttpGet]
        public HttpResponseMessage AddToBasket(Guid productId, Guid colourId, Guid sizeId, int quantity)
        {
    

    My ajax call looks like this:

      $.ajax({
            url: this.options.addToBasketActionUrl,
            data: data,
            type: 'GET',
            beforeSend: function () {
              _this.$addToBasketButton.addClass('is-loading');
            },
            success: function (data, textStatus, xhr) {
    

    And the url being:

    '/Umbraco/Api/Basket/AddToBasket'

    i'm not sure if i'm missing something but if somebody/Anybody could help me out, I'd be grateful

  • saadi 6 posts 76 karma points
    Jul 09, 2018 @ 09:51
    saadi
    0

    Hi Tolu, Did you find anything on it?

Please Sign in or register to post replies

Write your reply to:

Draft