Ecommerce checkout: when and where to create intermediate and final order for items in cart in relational database - sql

I am working on a ecommerce project(in Django and it is based on rest API) where users can place orders. Users can add items they are interested to buy in a shopping cart which is persistent. They go through the checkout process to place the order.
I am not clear how to store and manage intermediate order stage before creating final order in order table in case of rest API based service which does not have request session.
I am thinking of these options:
using separate cart, order table: cart table will have items selected by the user. when they click checkout, create an order but with a flag which says it is in intermediate stage. when payment is initiated, it will be marked as a final order.
using separate table for cart, checkout and order: cart table will have items selected by the user. when they click checkout, create a checkout entry. when payment is initiated, create an entry in the order table. here checkout needs to have replica of the order structure. this seems to duplicate lot functionality
using cart+checkout(combined), order table: cart table will have items selected by the user. when they click checkout, checkout stages will be stored in same table. this is similar to the magento sales_flat_quote table. when payment is initiated, a final order entry is created in order table.
I am not clear about the pros and cons for the above ways. What is the standard approach?
And any references regarding the same.

There are multiple ways of doing it. Antonio Melé has a great approach outlined in his book "Django 3 By Example"
They have the book's myshop app repository public on Github.
The book outlines having 2 apps (cart, order).
Order has two models- Order, OrderItems
Cart doesn't have any model. It saves the added items to the django session. Checkout the carts.py file.
In addition, I personally used a Shipping app to manage variable delivery charges.

Related

Reset product quantities in shopping lists after order placed

I want to know if it is possible to automatically reset the product quantities in shopping lists after customer places the order?
Not the order, but the shopping list itself.
Eg. Change from 5 back to 1?
You can implement it as a part of the custom checkout workflow based on one of the default workflows. For more details the documentation.
For example, that change can be a workflow action described in the last workflow transition definition and executed when the order is created.

Shopify changing product price for variation by app

I am a shopify partner, I am trying to get around the the variant limits of shopify by coding an app and also because my client has a complicated formula for calculating the price. I don't have a problem with the part that adds the information for my variants to the order, however when I want to modify the price based on the user selection, it doesn't seem an easy task to do.
I came across couple of apps which does the same thing by adding a new product or variation which is not optimal for my use case, is there any app that does the job without adding extra information to the database, if so, how?
Qualified Yes
Unfortunately, Shopify doesn't give us a lot of options to edit prices of items dynamically. Here are the two options that I know of that will allow you to adjust the price of a product directly - however, both have limitations.
Using Shopify Script Editor
If you're working with a Shopify Plus merchant, you can use the Shopify Script Editor to dynamically adjust the prices of products, provided that the direction you adjust is down. You cannot increase the price of a product using the script editor - so for your use case, the list price would have to be the most expensive possible price that the item sells for, which you would then discount appropriately using the app.
Using draft orders
Using an app, you can use Shopify's Draft Order API to create an order with custom discounts and/or create completely custom items that are independent of the products set up in the product database.
The basic flow for this is that when the customer clicks 'checkout' you halt the normal navigation, send the cart contents to your app, create a draft order with the appropriate pricing, then supply the front-end code with the draft-order checkout/invoice URL so that you can send the customer there instead of the normal checkout. This has several limitations, however, including that prices of existing products can only be discounted, not increased, and the fact that Shopify will not allow a customer to use discount codes on a draft order invoice - once an order is set up this way, Shopify's assumption is that all prices are final.
Disclaimer: Sorry if someone sensible doesn't like a response with a link :) I'm not related to this app I'm just a user.
On a project with complex pricing, we use the app Wholesale Pricing Discount by Wholesale Helper we liked because is easy to import multiple pricing by-product and relate it by customer.
this app does not multiply the products, they use customer tags. maybe that can give you some guidance.
An important rule on Shopify is you can't increase the price by API on an order, you can just reduce i

Big Commerce - Custom Price Retrieval

I'm looking at using Big Commerce.
Is it possible through customizations that I can programmatically pull a price via a web service based on who the user is?
User logs into my store; when they search, for each product the price (and some other information) is being populated by a web service call. Same goes for the product page, cart, etc.
Yes, this would be possible, although the implementation may vary depending on the size of your catalog/number of individual users who need pricing unique to them.
One option would be to call your web service for pricing and send those prices to the storefront for a specific customer (or group of customers) using the Price Lists API:
https://developer.bigcommerce.com/api-reference/catalog/pricelists-api
Another possibility would be to listen for the ID of the logged in customer, and based on that ID, update the prices of the products in the cart using the Cart API:
https://developer.bigcommerce.com/api-reference/cart-checkout/server-server-cart-api

Bigcommerce - Generating a table for all SKUS

Doing business to business transactions through BigCommerce has created a few unique things BigCommerce isn't set up to handle.
One is that our customers want the option to use a page that works like a spreadsheet where they can quickly add products to their cart all from the same page.
I am looking in to the possibility of finding a way to generate a table that lists each SKU in a row with columns for SKU, Product name, Price, and an "add to cart" button. Basically, run a query of the product database and display the information on a webpage accessible by the customer.
Right now, my solution is manually typing out each row for 1,500+ SKUs. Hoping there's a better way.

How can I implement modifiable products (which are subscriptions) in Shopify?

I've implemented subscriptions through ReCharge where users can select products and these are saved as line item properties for that product. This was the only solution I could think of with my limited time using Shopify.
Per this question, it seems like line item properties are read-only after checkout. If this is truly the case, is there any solution that enables having modifiable subscriptions where users can re-select products for that subscription product that I can implement?
I'm using Shipstation for the shipping piece if this matters at all.
How can I implement modifiable products (which are subscriptions) in Shopify?
You can't. Well, technically you can but it is not easily done. Since you indicated that you're looking for official answers, I've contacted Shopify via email for you and I've been discussed this with Brad Leclerc, where he said:
That is indeed the case with line item properties being read-only after checkout, so it would need to be reconstructed for the new order. There's no super quick/easy to do that without some custom development to automate the process. If you end up wanting to do that, I'm sure a developer from http://experts.shopify.com could set something like that up.
You have two choices, either hire someone from experts.shopify.com to help or build your own marketing script from scratch.
Proof of email: http://i.imgur.com/OeM5gSm.png
I'd do this with meta fields on the customer.
meta fields can be used on the subscription product template to make it sensitive to the state of the customer's subscription (new or existing)
Use a order web hook to detect when a new subscription product has been purchased and then update the customer meta fields (e.g. subscription level and start and end dates).
use a periodic task in your supporting private app to:
prompt user before subscription becomes due to update their payment details or cancel the subscription
create and bill new orders for each subscription period
I am not familiar with Shopify, nor Revcharge, but according to the references, couldn't you simply customize the product page in shopify?
https://docs.shopify.com/manual/configuration/store-customization/page-specific/product-page/get-customization-information-for-products
According RevCharge, you should use a Shopify product template anyway..
http://recharge.helpscoutdocs.com/article/91-recharge-integration-guide