Copied to clipboard

Flag this post as spam?

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


  • Matt 91 posts 237 karma points
    Apr 02, 2013 @ 13:07
    Matt
    0

    Tea Commerce 2 Starter Kit - Out of Stock/Editing orders

    I'm having some trouble getting out of stock functionality to work.

    In the starter kit I notice:

            @if ( stock == null || stock.Value > 0 ) {
              <input type="submit" value="@Dictionary[ "AddToCart" ]" class="addToCart btn btn-brown btn-cart" />
              <span class="addingToCart btn btn-addingtocart btn-brown">@Dictionary[ "AddingToCart" ]</span>
            } else { 
              <input type="button" value="@Dictionary[ "SoldOut" ]" class="soldout btn btn-danger btn-cart" />
            }

    However when I set the stock to 0 for the product the SoldOut does not appear/the else statement doesn't fire. Running the getStock function in the console gives a post 500 error but I think this is because I am using incorrect syntax for the settings passed in.

    I also notice that I am unable to edit orders in the backend, for example the billing information. Is this possibly a permissions issue? I am using a vanilla Starter Kit installation.

  • Anders Burla 2560 posts 8256 karma points
    Apr 02, 2013 @ 13:55
    Anders Burla
    100

    Well that was a stupid "bug" :)

    That is because the starter kit isnt using the special Tea Commerce data type you should use for stock - but its using a normal Umbraco text field. Go to the product document type and change the stock property to the special Tea Commerce stock data type instead of the text field. Now you need to save your stock again. That should be it.

    Kind regards
    Anders

  • Matt 91 posts 237 karma points
    Apr 02, 2013 @ 14:05
    Matt
    0

    Thanks for the quick response Anders! Stock is working fine now on starter kit and our implementation.

    Another note:

    "NEW: Shop owners can edit orders in the backend"

    What functionality does this bring? I notice the address/product quantities have inputs in the order management but changing these and saving does not have any effect on the order.

  • Anders Burla 2560 posts 8256 karma points
    Apr 02, 2013 @ 14:11
    Anders Burla
    0

    Wow your a bug hunter - nice work! You found another one :)

    This time - go to the Settings in Umbraco -> Scripts -> tea-commerce -> edit-order.cshtml - delete linie 309 - the "});"

    That should fix the JavaScript bug and make things work as expected

  • Matt 91 posts 237 karma points
    Apr 02, 2013 @ 14:24
    Matt
    0

    :D

    That's working now too. If I'm being picky the increment/decrement and remove total buttons do not work but I can manually enter a quantity and it saves correctly.

     

  • Anders Burla 2560 posts 8256 karma points
    Apr 02, 2013 @ 14:27
    Anders Burla
    0

    It works fine in FF. Try and hit CTRL + R or clear your cache. Maybe that is it. Else - let me know which browser you use.

  • Matt 91 posts 237 karma points
    Apr 02, 2013 @ 14:44
    Matt
    0

    Whoops - I deleted the wrong "});". All working now. Many thanks!

  • Bjarne Fyrstenborg 1282 posts 3994 karma points MVP 8x c-trib
    Nov 13, 2013 @ 22:34
    Bjarne Fyrstenborg
    0

    Hi Anders

    Could you change the stock property from a normal Umbraco textfield to the Tea Commerce stock datatype next time you are making some changes in the starterkit or some bugfixes?

    I think it still is a "bug" in the latest starterkit v. 3.2.0 - it was in my installation I downloaded a few months ago..

    /Bjarne

  • Anders Burla 2560 posts 8256 karma points
    Nov 14, 2013 @ 10:19
    Anders Burla
    0

    It is fixed and will be in the next release of the starter kit

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft