Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.
This repository was archived by the owner on May 28, 2023. It is now read-only.

Tier prices and tier prices customer groups #554

Open
@Cheeerd

Description

@Cheeerd

Hello. When I tried to enable tier prices, I faced some problems.
In the next list the first 3 items are about vue-storefront-api exactly, and the last 2 are about vue-storefront in general.

  1. Tier prices for "any" customer group (code 32000 in magento) are being ignored. Seems like at this line
    if (tier.customer_group_id === groupId) {
    condition should also check if tier.customer_group_id === 32000.
  2. Tier prices are being loaded for logged in customer like for not logged in customer. If the product is requested through "api/catalog/vue_storefront_catalog/product/_search", the customer group is taken around this line:
    groupId = decodeToken.group_id || groupId
    from userToken from requestBody which comes from here:
    requestBody = JSON.parse(decodeURIComponent(req.query.request))
    , but the value of this requestBody variable is replaced with elasticsearch query here:
    requestBody = await elasticsearch.buildQueryBodyFromSearchQuery({ config, queryChain: bodybuilder(), searchQuery: new SearchQuery(requestBody), customFilters })
    , before the userToken or groupId is taken from it. Because of it groupId always is null.
  3. If product is loaded through "/api/url/map", then the passed groupId is always null:
    .process(esResponse.body.hits.hits, null)
  4. When product page is rendered on server, then there are anyway no customer group id is available, so if you open the app directly from product page in new tab, the tier prices would be shown for not logged in user even if the user is already logged in from current browser.
  5. If alwaysSyncPlatformPricesOver option is enabled, then the prices are being downloaded from magento as for not logged in user, and even if vuestorefront-api calculated tier prices for current user correctly (with some fixes of previous paragraphs), then those prices are being rewritten with prices for not logged in customer.

So I wonder how is it supposed to work, can it work at all (and with which configuration and on which version), and where I might be wrong?
Unfortunately, here is written only that I have to enable the options usePriceTiers, and seems like after that all should work right away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions