Author Topic: Stock Per Location with different prices sometimes.  (Read 517 times)

beltoforion

  • Jr. Member
  • **
  • Posts: 161
  • Everything is Possible!
    • Ofix-Comp
Stock Per Location with different prices sometimes.
« on: April 02, 2020, 18:55:36 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Stock Per Location with different prices sometimes.
« Reply #1 on: April 02, 2020, 23:00:11 pm »
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 155
    • MiniJoomla
  • VirtueMart Version: 3
Re: Stock Per Location with different prices sometimes.
« Reply #2 on: April 03, 2020, 01:11:04 am »
Quote
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.

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 from products, orders and database table
Virtuemart Email Manager - customs email templates

beltoforion

  • Jr. Member
  • **
  • Posts: 161
  • Everything is Possible!
    • Ofix-Comp
Re: Stock Per Location with different prices sometimes.
« Reply #3 on: April 03, 2020, 02:06:47 am »
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

  • Jr. Member
  • **
  • Posts: 161
  • Everything is Possible!
    • Ofix-Comp
Re: Stock Per Location with different prices sometimes.
« Reply #4 on: April 03, 2020, 02:15:40 am »
@Studio 42

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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Stock Per Location with different prices sometimes.
« Reply #5 on: April 03, 2020, 17:36:21 pm »
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

  • Jr. Member
  • **
  • Posts: 161
  • Everything is Possible!
    • Ofix-Comp
Re: Stock Per Location with different prices sometimes.
« Reply #6 on: April 03, 2020, 22:28:37 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Stock Per Location with different prices sometimes.
« Reply #7 on: April 03, 2020, 22:55:53 pm »
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.