News:

Looking for documentation? Take a look on our wiki

Main Menu

Stock status - from non-numeric CSV (Red, Yellow, Green)

Started by biker_bits, July 17, 2016, 14:24:55 PM

Previous topic - Next topic

biker_bits

Joomla! 2.5.28
VM 3.0.16
CSVI Free 5.15

Hi

Been trying to work around this for a while now...

Just wondered if it is possible to import stock level from a CSV as a word (red, yellow, green) instead of a numeric value?
Unfortunately, this is how the suppliers stock control file is formatted - giving a colour word instead of a value for the actual quantity.

Which (custom?) field can I import this into with CSVI? Then display a dot or a graphic on a product flypage.

Any ideas will be much appreciated!


Studio 42

I think, it's easier to add a new columns and set value depending the string in your sheet directly.
Eg if(red) then 0 else if yellow then 1 else if green then 2. Of course you need to convert this formule for your software
Another simple solution, is to search & replace this column directly.

biker_bits

Thank you for your reply!

Even if I replace a colour letter/word in the feed with a numeric code, how do I import this into VM to show corresponding stock level?

Sample CSV attached as an XLS.


Studio 42

I don't know how you handel your stock, i only give you a possible solution.
If nothing can be associate, i don't know how you want update a stock.

biker_bits

Stock update comes from the supplier like the attached file. We don't have any control over the format it is in.
It would be much simpler if they showed quantity!
I was just wondering if there was any way of creating a new variable to display the status pulled from the file? Or maybe I was missing an already existing one?

Thank you for all your help!

biker_bits

Just came across this: http://forum.virtuemart.net/index.php?topic=92756.0

I wonder if :

Tell the customer the stock is low, and they should order NOW!

<?php if ($this->product->product_in_stock <= 10) { ?>
                  <div>ONLY <?php echo $this->product->product_in_stock ?> In Stock. ORDER BEFORE IT'S TOO LATE</div>
               <?php    }?>

Could be altered to say (replace 10 with Y):

Tell the customer the stock is low, and they should order NOW!
<?php if ($this->product->product_in_stock = Y) { ?>
                  <div>ONLY <?php echo $this->product->product_in_stock ?> In Stock. ORDER BEFORE IT'S TOO LATE</div>
               <?php    }?>

Would this work?

Studio 42

Why you don't use number, as explained before?
You import stock on replacing each color by a number
Eg
red stock 0
yellow stock 2
green stock 10.
YOu can search and replace in your xls file directly and import the csv to update all days.

biker_bits

Now I understand how you meant to implement this! Thank you!
I'll try than when I get a minute and report back

biker_bits

It works!
THANK YOU for this simple and genius solution!

The only thing... it either shows red=0 or green=anything else. I've tried setting CSV to 1 for yellow - still shows green.
Where does VM set level at which indications change?

biker_bits

Worked how to get yellow indication to work too ...

You can see that field from:
VM Backend >> Products >> [Any Product] >> Product Status >> [Low Stock Notification]


Above borrowed from https://www.flexiblewebdesign.com/forum-virtuemart-2-template-fashionmart-support/1643-stock-level-icon-in-category-pages


...or for bulk changes - set notification qty via CSV, using low_stock_notification variable  for each SKU.

Studio 42- HUGE 'thank you' again - SOLVED!  :)