Integer vs decimal sales in Shopify? - variables

Does anyone know the programming issue that allows some companies to be able to track inventory by decimal place for weight based products such as cheese and meats vs only solid inventory values?
Square allows us small retailers to use weight based pricing and even variable weight/price barcodes which makes checkout an order of magnitude faster, especially with new staff. Shopify does not support this.
There is a third party app that attempts to do this but it also can not accurately adjust our shopify inventory because they simply do not allow an inventory count to be a decimal place.
Thoughts?

I think you would assign a weight to your cheese or meat. For example, 1 gram. A small enough unit right. So if you had 10 kilos of meat in stock, you might sell that meat by the gram. Someone buys 400 grams of meat, they pay the price that you set for that variant of meat, some unit price per gram.
You cannot put a decimal as a quantity in a shopping cart, but you can put in an integer value representing weight. I think if you keep that straight, it all works out fine.

Related

Total price and price per unit microdata

Currently trying to optimise our e-comm shop and google merchant products and I can't seem to get any further or get any other information on how to display a total price and a price per ct.
Product.
I need to have the total price the customer pays displayed on the website (£100.00) the quantity they'll receive (100 ct), and the price per unit that they pay (£1.00).
But what would the pages microdata and JSON-LD be?
Thanks!
One way to provide that sort of info is to start with the offer and use includesObject which has an amountOfThisGood.
offer
price - 100
includesObject
amountOfThisGood - 100
typeOfGood
type - Product
offer
price - 1
However, I suspect systems including Google will not understand that yet.

How to set custom price for products on the basis of quantity in shopify?

Greetings.
I am working on a eCommerce website based on shopify. And for product I want to set a custom price. For example, The standard price of product is $500 but price will vary if user increased the quantity i.e. On 5 - 10 it will cost $450, On 11 - 15 it will cost $400 and on 20+ quantity it will cost $300.
I have searched module for this and also found a module i.e. https://apps.shopify.com/quantity-breaks. But its working on the basis of "Percent" that I don't need. Because I want to place price manually on the basis of quantity.
So please help me out from this and provide your valuable thoughts on the same.
Thanks in advance.
The way this is generally done in Shopify is to create variants where the option values are the price breaks. You have to modify your theme so that when a Qty > price break is entered the product page selects the variant that corresponds to that price level.
Other than the coding portion of this the main issue becomes inventory management since Shopify treats each variant as a separate inventory item but if you use variants to manage price breaks they are not actually separate items.
I think the easiest way to do this would be with a Shopify App. There are many that have price breaks etc. and they are usually easier to set up than using variants as the price break amounts.

Setting up product purchase cost and selling cost in oscommerce

I'm setting up a oscommerce store for my friends. He gets a product at 48.3 INR and sells at 60 INR . TAX for product is is 12.5%
For this he wants to have proper system to calculate profit
Now when I'm trying to enter product cost in OSC, it has only 2 fields.
Gross and Net.
If I enter 48.3 in Net it shows 54.3375 INR in gross (*TAX). while I need to show 60 INR for that product and calculate profit. Can any one help me about how to this in oscommerce!!
I need to show product cost on product page as 60 INR. and I should be able to input purchase cost somewhere in OSC. So that its possible to calculate profit.
I'm not entirely getting whether its possible in OSC or how to achieve it.
Please help.!
It's very possible. Either you will need to find a preexisting addon that does this or write your own addon. What you have described is simple to implement if you know php and mysql. If you don't then you should hire a programmer to do it for you.
Check out http://addons.oscommerce.com

Algorithm to use for fluid order

I am looking for an algorithm to use to help with fluid orders. I believe it may be a version or the knapsack or bin packibg problems.
We have say 5 storage tanks, 3 of them are product a, 2 of them are product b.
The tanks can be different capacities.
We have historical data telling us roughly how much will be used from each tank while awaiting delivery of new product. The supplied product comes in a fixed quantity, although multiples of the supply quantity can be purchased.
There is a minimum quantity that can be ordered- the minimum can be a combination of products or all the same. We want to stock the minimum of each product that we can, but still meet the demand we predict from each tank. The tanks are not linked and product cannot be pumped between tanks even though it is the same product.
If I can find out the algorithm I need, I should be able to code it with too much problem. Thanks

Have 2 separate tables or an additional field in 1 table?

I am making a small personal application regarding my trade of shares of various companies.
The actions can be selling shares of a company or buying. Therefore, the details to be saved in both cases would be:
Number of Shares
Average Price
Would it be better to use separate tables for "buy" and "sell" or just use one table for "trade" and keep a field that demarcates "buy" from "sell"?
Definitely the latter case - one table, simple one field (boolean) defining whether it's selling or buying. You should define tables by entities, not by actions taken on them.
This is actually a tricky one. The table you're talking about is basically a trade table, detailing all your buys and sells.
In that sense, you would think it would make sense to have both buys and sells in a single table.
However, in many jurisdictions, there is extra information for a sell order. That piece of information is which buy order to offset it against (for capital gains or profit purposes). While this is not necessary in a strict first-bought, first-sold (FBFS) environment, that's by no means the only possibility.
For example, under Australian law, you can actually offset a sale against your most recent purchase, as long as you have the rationale written down in clear language before-hand. Even though my company follow FBFS, I am allowed to receive bonus issues or supplemental shares which I can then sell immediately. These are offset against the most recent shares bought, not ones I've held for X number of years (this is often handy to minimise taxes payable).
If you follow a strict FBFS, then you don't need that extra information and your trades are symmetrical. Even where they're not, I've implemented it in one table with the extra information, useless for buy orders of course. That seemed the easiest way to go.
You could do it as two asymmetrical tables but that makes queries a bit more problematic since you often need to pull data from both tables. My advice is to stick with a single table with the extra information if needed.
I would also never store the average price. I prefer the quantity, the price per share and the brokerage costs. Every other figure can be calculated from those three, for example:
AvgPrice = (Brokerage + SharePrice * ShareQuant) / ShareQuant
but it's sometimes impossible to work backwards from just the average price, since you don't know what the brokerage was.
And I wouldn't have a boolean for buy/sell, it's just as easy to use negative numbers for the sell orders and it makes balance-sheet-type calculations a lot easier since you just sum values irrespective of the order type instead of needing to negate some of them depending on that order type.
Update: If, as you seem to indicate, you're only going to store aggregate information for each company, I would go for the following:
Companies:
CompanyId primary key
CompanyCode indexed
CompanyName
CompanyBuyQuant
CompanyBuyAvgPrice
CompanySellQuant
CompanySellAvgPrice
then you update the individual columns depending on whether it's a buy or sell. You don't need a separate row for the buy/sell stuff. When the company is first added, both quantities and prices are set to 0.
Your entity is now the company so this makes more sense. One thing you may want to consider is to store the aggregate values of shares bought and sold rather than the average buy and sell prices. That will simplify your update calculations and you can still easily get the averages by dividing the aggregate by the quantity.
So, the following table:
Companies:
CompanyId primary key
CompanyCode indexed
CompanyName
CompanyBuyQuant
CompanyBuyValue
CompanySellQuant
CompanySellValue
When adding a company, set all quanities and values to 0,
When buying M shares at N dollars each, add M to CompanyBuyQuant and N * M to CompanyBuyValue.
When selling M shares at N dollars each, add M to CompanySellQuant and N * M to CompanySellValue.
Get average buy price as CompanyBuyValue / CompanyBuyQuant.
Get average sell price as CompanySellValue / CompanySellQuant.
I'd go with a single table.
You can use negative quantities to indicate a sell. This is a fairly standard sort of indication. Subtraction is the same as adding a negative number!
One table. Each row/item is a trade, whether it's buy or sell.
Also, the aggregate of the quantity column will give you your current position. And cash too (-1 x quantity x price**) aggregated.
Buy or sell if inferred by the sign of the quantity: no need for separate column, unless you want to make a computed column derived from quantity.
**cash: When you sell (negative quantity) you get cash back (positive cash), hence -1 multiplier in case anyone wonders.
"Trade" can be ambiguous and it's not entirely clear to me what you want to do here. Are you interested in storing only your current position in each share or also the history of transactions that show how the position developed?
If you just want to record your holding ("position" might be a better word if you can be short) then I'd simply record for each share the number held. You mention average price, but I'd be cautious about that if you expect at any time to be able to sell part of a holding. What's the average price if you buy 100 at 50, 100 at 60 and sell 50 at 70?
Unless you expect your buy and sell transactions to number in the millions, I'd be more inclined to record each individual purchase or sale as a separate row in a single table and show the totals on demand as the derived results of a simple query.