All things Shopify and commerce
I have 70k product in my store around 6k product prices are 0$ these 6k products are in different categories hard to find. I want all 0$ product to be out of stock that people can see those but unable to add in cart or buy those.
looking for help
The easiest way to do this would be to bulk edit products and use Excel + Visual Basic Studio to update all of the products with $0 to have a 0 QTY.
That is if I am understanding you correctly.
To do this you would:
Sub UpdateQuantityAndRemoveOtherProducts()
Dim ws As Worksheet
Dim lastRow As Long
Dim i As Long
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your actual sheet name
' Find the last row in column X
lastRow = ws.Cells(ws.Rows.Count, "X").End(xlUp).Row
' Loop through each row from the bottom up to prevent issues when deleting rows
For i = lastRow To 2 Step -1 ' Assuming row 1 is header
' Check if the price is exactly 0 in column X
If ws.Cells(i, "X").Value = 0 Then
' Set the quantity to 0 in column U
ws.Cells(i, "U").Value = 0
Else
' Delete the entire row if the price is not 0
ws.Rows(i).Delete
End If
Next i
End Sub
What this code does is look for every product that has a price 0 and then changes the QTY of that product to 0. It then deletes any row that was not changed as it does not need to be updated.
This method of course only works if you have access to Excel. If you use Google Sheets this can be done relatively fast as well. You would very easily establish this same thing just by turning your data into a table. Then you would just organize your data by product price from least to highest. You can then delete everything higher than 0 dollars. Next you would just write 0 in the QTY. This can be speed fill with all 0's by clicking and holding down on the blue circle at the corner of the cell. You just drag that down to fill the rest out with 0.
If your products are set to QTY 0 they should still show up but not be available to purchase unless you set the settings to sell when out of stock or if you set your setting to hide products when out of stock. If you just have the default setup, this should work.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024