Reset product quantities in shopping lists after order placed - orocommerce

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.

Related

Shopify - Validate cart items at checkout?

A product in my store (e.g. a fine art print) has a base price of £20 and it has multiple customizable options (size / framing) that are added as additional items to the cart (e.g. Small [£0] / Medium [+£10] / Large [+£20] or Unframed [£0] / Framed [+£10] )
I have to do it this way because some products have more than 3 variant options (Shopify only supports 3)
These additional items that represent the customization options for the base product are added when the customer adds the base product to cart, but the additional products representing options are hidden to the customer in the cart.
At checkout however all is revealed, the base product appears with 2 additional items along with their additional prices. Not ideal but OK!
However, it occurred to me that there's nothing stopping a tech-savvy nerd from grabbing the variant ID of the additional items and sending a POST request to /cart/update.js that removes them from the order during checkout.
The customer just reloads the checkout page and they've just halved the price they have to pay!
I need to prevent this from happening.
I don't suppose there's a way to validate all the items in the cart when the customer requests the checkout page?
If that's not possible, how do other Shopify stores get around this issue?
If you are on the Shopify Plus plan there are two things you can do:
During checkout validation - use Script Editor to check the cart contents and if it's invalid, set the base product quantity and additional products to 0. This will prevent customers from checking out.
Post checkout validation - use Shopify Flow to cancel the order after it's placed and if it's invalid
But that's a lot of development, especially when you are not familiar with it, it will be hard to go through and make it work as expected (covering all edge cases). It's possible to create a such script but analysis of all possible scenarios and writing a code for it will take some time. If I were you I would consider an app that creates bundles as a single item. Adding such a bundle to the cart takes a few seconds to process as the app is making some admin API calls in the background but it solves your problem. I cannot promote any paid solution on StackOverflow but you will easily find something - there are plenty of solutions in the app store.
The decision comes down to your estimation + possible change requests and fixes vs. the cost of the app on a yearly basis

How to add different dimensions in product?

Hello Shopify Developers.
I'm a newbie on Shopify. How can we add a tab in product pages as Dimensions? Through this tab, we should be able to edit and change the dimensions for each specific product.
Would you give me a suggestion to do that? please teach me.
Best regards, Siva.
Shopify is not designed to allow customers to enter custom dimensions and have that affect the final price of the item.
However, this can be accomplished in principle through some roundabout steps, which involve a hidden priced product and a fair bit of javascript and the use of line-item properties to link everything together.
If you're feeling ambitious and want to make such a system yourself, the basic flow would be:
Create a product that either has a $0.01 value (or whatever the lowest denomination is in your currency) or a value of whatever the cost-per-smallest-unit that you want to sell by
Update your store templates so that any products that are marked as a component product (via tags, metafields, product type, or whatever you choose to go with) do not get displayed on collection pages, search results, etc.
For your product pages that need custom dimensions, you will need to create any relevant input fields and add whatever formulas you need to convert user inputs into units of your component product
When the item is added to cart, you will need custom javascript to add the correct quantity of the component item at the same time that the main/visible item is added to the cart. At this step, I would recommend adding line-item properties to both items that would identify that they belong together.
You will need to update your cart to hide the component product and add its price to the main/visible item for display purposes, and the quantity-update and item-remove features in your cart to make sure that when the main/visible product is updated or removed the component product is updated appropriately as well.
This can be quite the undertaking to try to take on yourself, so if any of the above steps seem daunting I would strongly recommend looking for an app in Shopify's app store that can do these steps for you. There are a lot of product option/customization apps available, and many of them have free trials that you can take advantage of to see if they meet your needs.
Of course, if you have the skills and ambition to take this project on, great! The above flow should hopefully get you started, and if you need further advice on any specific step feel free to ask another question.

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

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.

Displaying First Collection That Was Assigned to Product

I'm trying to change my product breadcrumb to display the first collection of a product (rather than showing the path the user took to reach the product).
I'm using the code product.collections[0] to show the first collection... but this displays the collections in A-Z order rather than the first collection that was added to the product.
Is there a way to call the first collection that was added to the product rather than ordering it A-Z?
Conceptually there is nothing in Shopify to support your cause. If you have a product you can get the list of collections it belongs to, but there is no support for a hierarchy or temporal access time. If you need to keep track of which collections a customer hits per product, you will need to do that yourself, manually, with JS.
Ever since day 0 of Shopify, I am sure there has been a wish for Shopify to somehow keep track of the collection that was selected when a customer selected a product, but to date, even that is not supported at all.

BigCommerce Custom Add To Cart Speed Issue

We had a developer add a custom code to certain product pages so that the user could order multiple quantities of multiple product variants all at once from one product page.
The issue is that the script takes too long to run...when you click Add To Cart it is taking 30-60 seconds or more to add all the products to the cart.
That is way too long. (see video here https://www.dipietro.biz/wp-content/uploads/2017/04/add-to-cart-slow.webm )
This is because the script is adding each product to the cart sequentially one by one instead of simultaneously.
Is this something that can be fixed?
We need the Add To Cart speed increased drastically.
I've been told that if we had access to the cart.php file that sits on BigCommerce's server we could just add some type of ajax multi array function and that would solve the problem but of course we do not have access to BigCommerce's servers.
Any help is appreciated at this point.
Thanks!
Without seeing the code, most likely the issue is that, as you mentioned, the products are being added to the cart sequentially, while also waiting for each individual add to cart request to finish before beginning the next - that is, it will add a product to the cart, wait for that product to successfully be added, and then proceed to add the next product to the cart.
Each 'add to cart' action is an individual POST request to the cart.php file. There is a challenge here in that BigCommerce will block the requests if too many of them occur within a certain time period; this is a BigCommerce security feature.
While you do not have access to the cart.php file, and while I do not know the specifics of the BigCommerce rate-limit/security feature, the best way to approach this is to determine and set a feasible max number of concurrent requests as well as a necessary cool-down period in order to maximize the number of requests to BigCommerce while also satisfying the security/rate-limit limitation.
For example, you might set up the program to concurrently add 3 products to the cart, wait 1 second, and then proceed to add another 3 products. Does this make sense?