Copied to clipboard

Flag this post as spam?

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


  • Tiago 12 posts 93 karma points
    Oct 31, 2017 @ 11:13
    Tiago
    0

    Unable to obtain product stock (javascript api) when a user is not logged into the back office

    Good morning from Portugal!

    I noticed an interesting bug when on Mozilla Firefox (v 56.0.2) and on Microsoft Edge (v 40.15063.674.0) with umbraco 7.6.4 and TC 3.2.3.

    I am unable to obtain the stock of a given product/variant when I am not logged into the back office on the same browser where the stock is being obtained from (product page).

    On chrome it works with no problem.

    There is no information in the log.

    Any ideas why this could be?

  • Rune Grønkjær 1296 posts 2863 karma points
    Oct 31, 2017 @ 15:34
    Rune Grønkjær
    0

    Looks like you found a nice little bug there. How the stock is returned depends on the servers UI culture, which means it can in some cases return the decimal with a wrong decimal separator. That makes jQuery go directly to it's ajax error event instead of it's success. In some browsers anyways.

    It's a very small fix, and we will add it to the next release.

    Thanks for letting us know!

    /Rune

  • John Bergman 424 posts 976 karma points
    Oct 31, 2017 @ 16:40
    John Bergman
    0

    Hi Rune, sorry to hijack the thread a little, but do you have a timeline for the next release (and also will it be 7.7 compatible)?

  • Rune Grønkjær 1296 posts 2863 karma points
    Nov 01, 2017 @ 07:00
    Rune Grønkjær
    0

    Hi John,

    Tea Commerce have been 7.7 compatible the whole time, except for the Umb bug regarding legacy create: http://issues.umbraco.org/issue/U4-10519 It has been fixed in 7.7.3 and all is good now.

    As for a time line, we only have the bug from this post at the moment, but we will release a minor with that soon.

    /Rune

  • Tiago 12 posts 93 karma points
    Oct 31, 2017 @ 15:51
    Tiago
    0

    Its a pleasure!

    I just checked the response and it seems that you are indeed correct!

    When not logged into the back office, the product stock uses a comma as the decimal seperator. When logged in a decimal point is used.

    I did not know that the back office session could influence the front-end, interesting.

    Do you have any thoughts on a possible solution which I could use for now?

    Will I have to implement a Product Information Extractor?

    EDIT

    I said price, but I meant stock, sorry!

  • Rune Grønkjær 1296 posts 2863 karma points
    Nov 01, 2017 @ 07:08
    Rune Grønkjær
    0

    The prices should not be affected by the UI culture. Price formats are decided by the current currency.

    How does your price look?

    Here's how the price on https://demo.teacommerce.net/ looks both with danish and US culture: enter image description here

    /Rune

  • Rune Grønkjær 1296 posts 2863 karma points
    Nov 01, 2017 @ 08:02
    Rune Grønkjær
    100

    I just released a minor version with the stock fix and a small install fix as well: https://docs.teacommerce.net/v3.0.0/blog/release-324

    You can just install it on top of the old version

    /Rune

  • Tiago 12 posts 93 karma points
    Nov 02, 2017 @ 09:39
    Tiago
    0

    The issue is resolved, thanks Rune!

  • Rune Grønkjær 1296 posts 2863 karma points
    Nov 02, 2017 @ 10:48
    Rune Grønkjær
    0

    Thanks for letting me know.

    Have fun with TC :)

    /Rune

  • Tiago 12 posts 93 karma points
    Nov 08, 2017 @ 09:19
    Tiago
    0

    Thanks Rune!

Please Sign in or register to post replies

Write your reply to:

Draft