DavidAJohn / PhotoPortfolio

Personal photo portfolio .NET web application which implements a Blazor and Tailwind CSS user interface with a MongoDb database, and includes integration with Stripe Checkout and Prodigi Print API
0 stars 0 forks source link

Product add/edit pages showing prices #31

Closed DavidAJohn closed 1 year ago

DavidAJohn commented 1 year ago

While looking at an issue with the price markup calculation, it struck me that there are some admin pages that would benefit from displaying retail prices to the admin user, specifically the pages that involve adding or editing products.

The Add New Product page (AddProduct.razor) could have a 'Get Quote' button available once a Sku has been entered, which returns a Prodigi quote and displays the current wholesale price. Also, a default markup percentage could be entered for that product, with the retail price updated dynamically.

The EditPhoto page (which is reached via Galleries > Edit Gallery > the 'Edit Image details' button) could have similar additions, with a 'Get Quote' button available once a product is selected, with a dynamic retail price displayed depending on the markup percentage. The existing products linked to that photo can be edited via a modal dialog and could just get a quote without a button given that the Sku is known. The retail price could then be shown dynamically as well.

The Update Product page (EditProduct.razor) could have an adjustable default markup percentage added (like AddProduct). The page is mainly used to add or remove image assets from a product, but it could also allow the admin user to request the current wholesale price via a 'Get Quote' button, again in combination with a dynamic display of what the retail price to the customer would be.

A couple of points to keep in mind:

The application should still treat quotes from Prodigi as transient values. We don't need to save the quotes anywhere. They are just displayed when requested by a user/admin. Essentially, we save the markup percentage for a given product, then get a wholesale price quote and then apply that markup percentage.

Although these changes are primarily UI enhancements, they again emphasise the need to refactor the code that gets a quote into a service class. The three pages above - as well as the PhotoDetails and Checkout pages - will all be doing much the same thing when it comes to getting quotes from Prodigi.

DavidAJohn commented 1 year ago

The three pages mentioned above now have the functionality described.