izar74:
Hi,
just a question about SBA and Edit Orders. I installed both modules on a fresh 1.55e install. It seem all fine untill You try edit an order, in wich case i got this error:
[11-Oct-2017 00:16:09 UTC] Request URI: /../edit_orders.php?origin=index&page=1&oID=3&action=update_order, IP address: ::1
#1 products_with_attributes_stock_admin->updateEditOrdersAddProduct() called at [C:..\includes\classes\class.base.php:103]
#2 base->notify() called at [C:....min\includes\functions\extra_functions\edit_orders_functions.php:971]
#3 eo_add_product_to_order() called at [C:\w....admin\edit_orders.php:381]
[11-Oct-2017 00:16:09 UTC] PHP Warning: Invalid argument supplied for foreach() in C:.....min\includes\classes\observers\class.products_with_attributes_stock.php on line 576
[11-Oct-2017 00:16:09 UTC] PHP Stack trace:
[11-Oct-2017 00:16:09 UTC] PHP 1. {main}() C:.....min\edit_orders.php:0
[11-Oct-2017 00:16:09 UTC] PHP 2. eo_add_product_to_order() C:.....min\edit_orders.php:381
[11-Oct-2017 00:16:09 UTC] PHP 3. base->notify() C:....min\includes\functions\extra_functions\edit_orders_functions.php:971
[11-Oct-2017 00:16:09 UTC] PHP 4. products_with_attributes_stock_admin->updateEditOrdersAddProduct() C:..\includes\classes\class.base.php:103
>
> What i noticed is that this error show if an article in the order has no SBA variant, infact it also show in the upper part the warning :
> " Product 2 in the list below, named 'xxxxx', with a quantity of 1 did not exist. Attribute(s) selected:
> Quantity: 50grams
> Its attribute(s) were not updated.
>
> Reading around i found quite nothing on how to integrate the 2 contributions or solve this, any help would be really appreciated.
>
> Zencart 1.55e
> Edit Orders 4.3.0 (last version from github)
> SBA 1.5.4 (github last version)
> PHP 5.6.31
> **izar74:**
>
> An update...
>
> The error shown before will be generate always when updating an order, no matter if the order has articles with SBA variants or not.
> If you put an article with no SBA variant in the order it will not update and show the Warning:
> " Product 2 in the list below, named 'xxxxx', with a quantity of 1 did not exist. Attribute(s) selected:
> Quantity: 50grams
> Its attribute(s) were not updated."
>
> Sorry for the double post
Yeah, you're the first one to report anything about it. Issues confirmed to exist and have been corrected through the following "comparison" commit (though this was discovered through use of EO 4.1.7 on ZC 1.5.5 that was slightly modified to work with SBA).
<https://github.com/mc12345678/Stock_By_Attributes_Combined/compare/fa00792d8da3ca96da05aa62f6e221e299a2f0ae...02ef626fd13bdc37207af5e9633d1a60cda91485>
These exist on the master branch of the plugin.