Replace In Stock With An Actual Quantity/

Hi guys,

New multi-vendor software buyer here. I am tying to tune software to our needs and most of the time docs and other posts help. However for this one I cannot find it anywhere.

We want to replace "in stock" for available quantity with an actual available quantity displayed. Our vendors list their product by weight and they can specify if a buyer can buy the whole lot or can buy a minimum amount set by a vendor. So we want to show available lot amount in case a buyer wants the whole lot even though it'd possible that somebody bought a few lots already with minimum quantities before that.

So for a example a vendor set their product as1000kg and minimum lot is 100kg. The price is set per kg.
Then two buyers have bought 2 x 100 kg so it is only 800kg left in the lot. Then there is 3rd buyer who wants to buy what's left so they need to see 800kg as available.

Also for that reason we would probably need a checkbox with something like "Set purchase quantity to available quantity " just to get available quanity number into quanity for purchase field.

Or it can be just an extra button that says "Buy the whole lot" and when clicked it takes what's available from the lot and set a purchase quantity to it.

We can do without the checkbox or the button but it would be nice to have so buyers do not need to type the numbers to get the whole lot.

We want to replace "in stock" for available quantity with an actual available quantity displayed.

Try Settings -> Appearance -> Show number of available products

Thanks, that has done a trick but it is adding "item(s)" word to an available number.

Any way to remove it? I have already changed "Availability" to "Availability(kg)" in front of it so "item(s)" after a number does not sound right. I can try to revert back to "Availability" and then change "item(s)" to "kg" but I am not sure if this text is being used in some other places/pages and I cannot be sure it won't look out of place in any other page or place where this text is used.

In this case you can open the design/themes/responsive/templates/common/product_data.tpl file and change

{$product_amount} {__("items")}

to

{$product_amount}

Then clear cache

If you are familiar with CS-Cart addon and hooks, you can make these changes via hooks

Thanks but it does not seem to do anything. Mine has a word "item(s)" added but in your code it adds "items".

BTW, how do you find all references in templates and codes? It does not seem there is any search through templates or PHP files. I would normally just search, find file where it appears and correct to whatever is needed. But even a search through a browser does not work in a selected template because it is not loaded in full in browser memory. So it is really had to find anything.

For example in featured vendors block it shows a vendor name and a country. I want to add a state name in between. I found a template where it is returned along with a vendor logo and it is done with {$smarty.capture.$location nofilter} code in responsive / templates / blocks / vendor_list_templates / featured_vendors.tpl I have tried everything but I cannot find where location property/function is defined.

I used to be an ASP.Developer for more than 10 years but it is not PHP and I left IT more than 10 years ago.

Thanks but it does not seem to do anything. Mine has a word "item(s)" added but in your code it adds "items".

"items" is the name of language variable. The value of this variable in English is "items(s)". So we pointed you to the correct template

BTW, how do you find all references in templates and codes? It does not seem there is any search through templates or PHP files. I would normally just search, find file where it appears and correct to whatever is needed. But even a search through a browser does not work in a selected template because it is not loaded in full in browser memory. So it is really had to find anything.

Only years of experience :)

For example in featured vendors block it shows a vendor name and a country. I want to add a state name in between. I found a template where it is returned along with a vendor logo and it is done with {$smarty.capture.$location nofilter} code in responsive / templates / blocks / vendor_list_templates / featured_vendors.tpl I have tried everything but I cannot find where location property/function is defined.

The required template can be found here

design/themes/responsive/templates/common/company_data.tpl

Thanks, it started working later. And suddenly search with Ctrl+F has started looking through the whole template body. So it is a bit easier now to find something at least when I know what file to search through.