Magento2: Removing Parent Product during Create New Order (from admin) generates error.

Created on 4 Nov 2016  路  3Comments  路  Source: magento/magento2


When attempting to add a configurable product via the Admin panel > Sales > Order > Create New Order button. If you add a Parent product without selecting a child product you get a message that you need to choose an option. If you attempt to remove the parent product without a child product selected you get the error:
Notice: Undefined index: type in /home/m2track/public_html/vendor/magento/module-gift-message/Model/Save.php on line 74

Preconditions


Magento 2.1.2 CE
PHP 7
NginX Hosted service (mage mojo)
Chrome Browser.

Steps to reproduce

  1. Make sure you have a configurable item in your products list (parent with child item)
  2. Log in to admin panel
  3. go to Sales > Order > Create New Order
  4. Select an existing customer
  5. Choose your store (if you have more then one)
  6. Click Add Products button
  7. checkmark the PARENT product
  8. Set your quantity to 1 for the pop up window
  9. Click "Add Selected Products To Orders"
  10. You should get an error "Configurable product "MF1-BAS" does not have sub-products" (meaning you didn't select a child product instead of the parent).
  11. Choose "remove" under the "Action dropdown
  12. Click "Update Items and Quantities"
  13. Receive error "Notice: Undefined index: type in /home/m2track/public_html/vendor/magento/module-gift-message/Model/Save.php on line 74"
    yet the product gets removed.

Expected result

  1. The user should only select the Parent Product, but then be FORCED to sub-select the configurable child product in the pop up window when the select the quantity. This will prevent BOTH (no child selected, and the remove error message) errors from happening.

Actual result

  1. I should mention that this error does NOT occur if you select a child product instead of the parent and remove it instead.
  2. The error will happen if you add both the Parent product AND the child product as well, and remove the parent (which also removes the child product).

adding_parent_prod_remove_error1
adding_parent_prod_remove_error2
adding_parent_prod_remove_error3

Catalog needs update bug report

All 3 comments

Hi, thank you for your report. I was not able to reproduce your issue by original steps, It is always force me to select option in pop-up.
But I succeed in such steps sequence:

  1. Make sure you have a configurable item in your products list (parent with only one child item)
  2. Add parent Configurable product to the wishlist from front-end
  3. Set quantity for the child product to 0(set to out of stock)
  4. Log in to admin panel
  5. Go to Sales > Order > Create New Order
  6. Select an existing customer
  7. Choose your store (if you have more then one)
  8. Click on gear "Configure and Add to Order" in My Wishlist block
    Expected result
    User must select configurable option in pop-up
    Actual result
    No option selection available in configurable product in pop-up
    Use is able to add parent configurable into Items ordered block

To get message about configurable product doesn't have sub-products I have to open another tab and delete child product. After update previous tab with order creation in admin.

I create internal MAGETWO-61530 issue with my steps. Unfortunately I cannot reproduce this issue with your steps. Is it OK for you @spyrule

According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.

@veloraven , If you read the response from @olysenko , there is an internal ticket applied. Not sure why this is being closed.

@olysenko - Yes, I'm ok with your method.

Was this page helpful?
0 / 5 - 0 ratings