Looking at the differences in the code, how/where the code is used, and the report that the catalog side works correctly but the admin side does not, the admin/includes/classes/observers/class.products_with_attributes_stock.php needs a little modification:
Lines 410-411 need to be modified from:
Code:
if (/*$value['option'] == $orders_products_sba_customid->fields['products_options_id'] &&*/ $value['value_id'] == $orders_products_sba_customid->fields['products_options_values_id']) {
to:
Code:
if ($value['option_id'] == $orders_products_sba_customid->fields['products_options_id']
&& $value['value_id'] == $orders_products_sba_customid->fields['products_options_values_id']) {
(hopefully there are not a bunch of hashtags in the above pasted content. Apologies if there is.)
To explain a little about the various placement of the customid and possibilities, each attribute could have its own customid if listed independently like if a specific product was an option from a dropdown, or like used as described, the combination of attributes identifies a specific product where that has its own customid. The code supports creating variations of this.
As to the "final" placement, well that's up to where you want it. I went with placing it near the model_number if it is its own content, or I believe also included the ability to replace the model_number if that is so desired. (If that feature isn't present, it was a design consideration at least.)
Move the "echo" to where you want it, doesn't hurt anything. Remove it from the other "modified" files, it doesn't hurt anything there either. :) May add a feature to enable/disable from known files, but at the same time, absence of the template related code doesn't hurt operation...
Oh, and yes, the change described above was based on looking at the code and the reported issue of "crossing" over to a different variant.
Bookmarks