Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PrePriceOverride stopped working] Issue #193

Open
ahgamal-ms opened this issue Sep 21, 2023 · 3 comments
Open

[PrePriceOverride stopped working] Issue #193

ahgamal-ms opened this issue Sep 21, 2023 · 3 comments
Assignees
Labels
StoreCommerce Questions or issues related to creating Store Commerce customizations

Comments

@ahgamal-ms
Copy link

When upgrading the CPOS from version 10.0.32 to 10.0.35 the code in the PrePriceOverride stopped working.
For certain items a price override should not be allowed, so a dialog was shown and the code was completed with:

return Promise.resolve({ canceled: true });

The code has not been changed since 2021.
I tried to simplify always execute: return Promise.resolve({ canceled: true });
and nothing else but the code always showed the price change dialog. Show the code was simply:

import * as Triggers from "PosApi/Extend/Triggers/ProductTriggers";
import { ClientEntities } from "PosApi/Entities";
export default class PrePriceOverrideTrigger extends Triggers.PrePriceOverrideTrigger {
    public async execute(options: Triggers.IPrePriceOverrideTriggerOptions): Promise {
        return Promise.resolve({ canceled: true });
    }
}

We have tried below and that's help mitigate the issue Any background story on why this changed in version 10.0.35?
Anything else we need to be aware of?

 return Promise.reject(new ClientEntities.ExtensionError("Not allow price overide"));
@madyke madyke self-assigned this Sep 26, 2023
@madyke madyke added the StoreCommerce Questions or issues related to creating Store Commerce customizations label Sep 26, 2023
@madyke
Copy link

madyke commented Sep 26, 2023

Hello @ahgamal-ms - thanks for reporting this. It looks like this was a regression that was introduced in 10.0.33. I have filed a bug for the payments team to fix this.

@madyke madyke closed this as completed Sep 26, 2023
@ahgamal-ms
Copy link
Author

Hi @madyke same has reported with PreProductSaleTrigger. the return Promise.reject(new ClientEntities.ExtensionError(""));
is not working as expected and didn't prevent adding item to cart. i have adviced the customer to use return Promise.resolve({ canceled: true }); however they loss the error message dialog which require additional work on them.

So is there any reason why the Promise.reject stop working and if this a bug that would require a fix or if this is as designed ?

@madyke
Copy link

madyke commented Jan 8, 2024

Hi @ahgamal-ms - I'm not aware of any changes that would affect this, so it sounds like a bug. Is the customer still on 10.0.35?

@madyke madyke reopened this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
StoreCommerce Questions or issues related to creating Store Commerce customizations
Projects
None yet
Development

No branches or pull requests

2 participants