Second Inventory Amount

Hello to everyone, i need to customize my cs cart to control a second amount in products.

For example i want to use the default product amount of cscart for the main warehouse and create a second amount to update the products for my retail store.

Can someone help me how to create the mysql table and how can i put this to tpl files?

thanks in advance

How are you wanting to control this second quantity?

I am looking for a trick to do this as well. I was thinking we might be able to copy our main store, open a 2nd storefront, and use that at the retail location. But it's impossible to give storefronts their own inventory amounts - they are always linked.

I would also really like to see an arrow or something with which we can move inventory to the other list.

But it's impossible to give storefronts their own inventory amounts - they are always linked.

Only if the products are shared, correct?

An alternative might be to set the different stores up as different suppliers and use the suppliers addon to manage the inventory (haven't looked at it in a long time but think it does this properly). Advantage is that it also does shipping correctly (different origins) and may also handle taxes properly

How are you wanting to control this second quantity?

I will upload a XML file direct to sql database, maybe i wiil import the value to a new column in the cscart_product table. I can make the php file to import the values to the cscart_products table, my problem is how to call this value to the tpl file on the storefront.

If you add a field to the cscart_products table and add a column named 'amount2' you can then alter the 'products' schema (app/schemas/exim/products.php) so you can import/export using CSV.

If you want to manipulate it directly in the DB, you can do that too.

Once it's in the table, it can be referenced in the template files such as {$product.amount2}

If you add a field to the cscart_products table and add a column named 'amount2' you can then alter the 'products' schema (app/schemas/exim/products.php) so you can import/export using CSV.

If you want to manipulate it directly in the DB, you can do that too.

Once it's in the table, it can be referenced in the template files such as {$product.amount2}

Hi, thanks it works but why when i change the value in the amount2 i need to clear the cache so the right text will apear in the storefront. My code to the tpl is {if $product.amount2 > 0}

Available in retail store
{else}
Unvailable in retail store
{/if}

I'm going to guess that it is because you don't have 'amount2' as a retrieved field for the product array on whatever template you are referencing. Many of the requests for listings only request a subset of the product fields. Ie.. $product.amount2 is empty and then being used in a compare which makes it equate to zero. And 0 > 0 is not true.

The cache (assuming you mean the registry cache -ie ?cc) is used to store cached values that are assumed to be static and the registry of hooks. The template cache (?ctpl) is used for caching the actual templates.

My guess is that your $product.amount2 is coming up as empty.

Don't have enough info to point you any further....

Only if the products are shared, correct?

An alternative might be to set the different stores up as different suppliers and use the suppliers addon to manage the inventory (haven't looked at it in a long time but think it does this properly). Advantage is that it also does shipping correctly (different origins) and may also handle taxes properly

Hmm that's interesting. I never looked into suppliers add-on, since this is something I have never needed. So you're saying it would be possible to have 2 identical stores (product wise) and each store has its own inventory amounts?

Like I said, I haven't looked into it in a long time. But it was implemented to support drop-shipping so I would assume that it manages inventory on a supplier by supplier basis within the addon (but note that how I think something should work does not always coincide with how cs-cart has implemented something).

Note also that the suppliers addon was done long before multiple storefronts. Whether it behaves properly in that environment is a question for cs-cart and/or the Suppliers documentation in the knowledge base.