News:

Support the VirtueMart project and become a member

Main Menu

Stock Per Location with different prices sometimes.

Started by beltoforion, April 02, 2020, 18:55:36 PM

Previous topic - Next topic

beltoforion

Hello, I am back to VM after 10 years hehe. okay here goes my question:

How can I create a Product with "Stock per Location"?

I have, at the moment, 2 vendors with several same SKUs different prices and stocks in different cities in my country.

For example:

State | Stock | Price | VSKU
Texas | 20 | $25.00 USD | VexampleSKU
Illinois | 5 | $25.00 USD | VexampleSKU
Michigan | 10 | $15.00 USD | VexampleSKU


I dont want a dropdown list, I want the user to select how much stock they want to add it to cart. I want for my shoppers to see me as the only vendor. They only have to worry about selecting stock from where they prefer it..
wanting to learn to create good templates

Studio 42

you can try using multi-vendor for the 2 vendors.
For the locations, i mean that you need to use a plugin to prevent a shopper to add products from different locations.
Then you add child per location
You have then to modify the children to only display the child from right location.
Of course this need some template overide, some custom coding and 1 new plugin.
You can perhaps use this plugin as base code https://shop.st42.fr/en/products/product-child-variants.htm, it include already most code to do it. Only the locations/vendor selection is missing.
Another tool can be a module so the user have to select the vendor/location on accessing the shop.

pinochico

QuoteYou can perhaps use this plugin as base code https://shop.st42.fr/en/products/product-child-variants.htm, it include already most code to do it. Only the locations/vendor selection is missing.

I think - create child varriant is wrong way, because you need the same SKU for different stock per location as you write in question - or I'm wrong?
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

beltoforion

yeah, for most cases yes. I have both scenarios,

I am importing products from two vendors and both handle the same types of products and sometimes the same SKU, not always.
wanting to learn to create good templates

beltoforion

@Studio 42

with the actual functions VM has , is it not possible to do this?
wanting to learn to create good templates

Studio 42

SKU is not === stock.
He said different location, so different stock ?
If not then simply add the location in the product with a simple customfield value or create your own plugin, so you know the location.
with the actual functions VM has , is it not possible to do this?
You can do many things with product plugin customfields, but you need to create it

beltoforion

Studio 42.
yes different available quantity per location.

If I create a custom field other than price will it have its own stock as well? or is this CHILD products for example?
wanting to learn to create good templates

Studio 42

I said to use child product, because each child have by default own stock.
For me your problem was to have different stock for same SKU, So this it the only  solution i know (without core hacks).
Wiht my plugin, it's certainly with some PHP code, to only display the right location child (i already implemented a redirect to first child for eg. for a customer to never show parent details).
To do this in PHP, you have to use a session variable(for eg. as currency selector) so you know the chosen user selected location to display the right child.

beltoforion

hi, wanna get clear on the post and obviously follow up so anyone looking for something similar would like to see.

I have over 5000 products I am importing with RO CSVI, two vendors who sell me technology products. 1 vendor is a local one, the other vendor has stock in several cities and I get access to the pricelist which includes stock per city per product_sku. But the product_sku is the same independently of the city.

If I create a MultiVariant field with custom Label City and add child for each city this works. but since the number of products is huge, I am looking for an alternative that is why I went for ROCSVI.

now, if I want to update the Stock I have to have 1 SKU per product per city. unless if there is another option of Stockable custom field so I can upload once.
wanting to learn to create good templates