Zen Cart Logo
Forums / All Other Contributions/Addons / Stock_by_attributes - which code allows manual updates of the stock?

Stock_by_attributes - which code allows manual updates of the stock?

Views: 481

Results 1 to 2 of 2
8 Sep 2011, 7:16 AM
#1
astridah avatar

astridah

New Zenner

Join Date:
Jul 2009
Posts:
9
Plugin Contributions:
0

Stock_by_attributes - which code allows manual updates of the stock?

I use Filemaker 11 Advanced to update the products, something I normally find much easier than the native control panel or Magnetic One.

But how can I update the stock by attributes with this program (or any other database management program, I suppose?)

Could somebody be so kind as to guide me to the exact php/sql-code that does this? Is it possible to only do this with SQL, or is the php necessary (seems like it depends on arrays)?

Would it be possible to add a database field for attributes_id in the table stock_by_attributes, or a quantity field in the products_attributes table, and thus make a more direct link?

I have given up the idea of having two options tied to one attribute anyways (I need to show exactly the attributes we have in stock, not all possible combinations), so I will just show one attribute option (being made up of both color and size where needed).

16 Apr 2012, 8:16 PM
#2
astridah avatar

astridah

New Zenner

Join Date:
Jul 2009
Posts:
9
Plugin Contributions:
0

Re: Stock_by_attributes - which code allows manual updates of the stock?

I forgot to give the update on this one:

The simple solution was to make sure that the sum of all the attribute quantities equals the product quantity.
Then both the attribute quantity and the product quantity will be substracted when an order is made.