Code Monkey home page Code Monkey logo

Comments (12)

andrzejkrzywda avatar andrzejkrzywda commented on July 22, 2024

@panSarin maybe you would like to challenge yourself with this feature? 😎

from ecommerce.

panSarin avatar panSarin commented on July 22, 2024

Sure, I would love to - but can you gimme some more details? ;]

from ecommerce.

andrzejkrzywda avatar andrzejkrzywda commented on July 22, 2024

we want to mimic this

https://support.getdpd.com/hc/en-us/articles/201282573-Creating-Coupons-in-DPD

as the first story, only create and percentage discount is fine

from ecommerce.

krzykamil avatar krzykamil commented on July 22, 2024

🤔 Is this still a thing? I saw a lot of code connected to discounts, isin't that the same thing?

from ecommerce.

andrzejkrzywda avatar andrzejkrzywda commented on July 22, 2024

what we have right now is discounts directly assigned by sales people (at the moment only they can create orders).

what we need in this ticket is to have "codes" which enable discounts. it's still a bit artificial as they would be entered by sales people but later it can be used by clients directly (when we finish the ticket where clients can create their orders).

we need a way of creating a coupon where "arkency20" would enable a discount of some value, probably 20%.

so a form with discount name, value and percentage - in UI terms

from ecommerce.

krzykamil avatar krzykamil commented on July 22, 2024

Alright, I'd like to take this issue then

from ecommerce.

krzykamil avatar krzykamil commented on July 22, 2024

I prepared something: #127 would appreciate any feedback

from ecommerce.

bryszard avatar bryszard commented on July 22, 2024

Shall this be closed?

from ecommerce.

krzykamil avatar krzykamil commented on July 22, 2024

Yea, the basic functionality requested is done, I'll add PR that fixes the issues from comments from that PR this week

from ecommerce.

andrzejkrzywda avatar andrzejkrzywda commented on July 22, 2024

I'm reopening this issue.

Currently we can create coupons, but it seems they can't be used in any way.
As such this feature is not bringing any business value.

We should extend the ordering process with the possibility of providing the coupon. As a result the order will have the associated discount.

from ecommerce.

andrzejkrzywda avatar andrzejkrzywda commented on July 22, 2024

Now that a cart is ready on the client side, we can add buttons to use the coupon from the client perspective

from ecommerce.

andrzejkrzywda avatar andrzejkrzywda commented on July 22, 2024

Assumptions:

  • using such coupon makes sense from the client perspective
  • It makes less sense from the admin/sales perspective to have this in their UI (they already have the option to set discount)
  • we can rely on the existing logic for setting discount on orders (ensuring there is only discount at a time is handled there)
  1. Introduce a new command UseCoupon, with order_id and coupon_id which results in a new event CouponUsed with the same attributes
  2. React to CouponUsed in the ClientOrders read model and display on the view
  3. React to CouponUsed in the Orders read model and display on the view
  4. Create a simple process, when CouponUsed happens - trigger the SetPercentageDiscount command
  5. Extend orders/edit view (or a new view) to display a field for entering coupon code

from ecommerce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.