I has installed module, but for my configuration the hook_add_to_cart_submit not working right because don't have the
$form_state['default_product'] and $form_state['products'], but I have the $form_state['default_product_id'].
I fixed and attached the patch, please, include in beta2 release,

Thank you,
Igor

Comments

Igor Mancos created an issue. See original summary.

dieuwe’s picture

Title: hook_add_to_cart_submit » Option set not being saved in hook_add_to_cart_submit
Priority: Normal » Critical
StatusFileSize
new1.02 KB

Have recreated the patch with git diff and updated it to be run relative to module directory.

Also changed the use of else if to elseif and placed the else on newline.

Depending on your Commerce setup, this patch is absolutely required to make this module work so I am setting this to critical. I didn't dig further into seeing what combination of modules makes this happen.

Without this patch your commerce_option database table will stay empty because no data will ever be saved.

dieuwe’s picture

Title: Option set not being saved in hook_add_to_cart_submit » Option record not being saved in hook_add_to_cart_submit

Clarify title (this issue doesn't actually have anything to do with "sets", just the options data.

dieuwe’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Active » Closed (fixed)

Turns out this is actually already implemented in the latest dev (stumbled upon that while looking into another issue).

benjifisher’s picture

This was fixed in #2417947: Commerce 7.x-1.11: Option values are not stored. It is a little hard to find that issue since it is tagged as Version 7.x-2.x-dev. The patch was committed to the 7.x-1.x branch as well. I have added it as a related issue.

@dieuwe, it is usually a good practice to mark an issue "Fixed". After two weeks with no further comments, it will automatically change to "Closed (fixed)". In this case, it would be even better to mark it as a duplicate if you had been able to find #2417947.

BTW, this fix was the last thing committed to the 7.x-1.x branch: 2015-02-05.

benjifisher’s picture

It looks as though the 7.x-1.x-dev version of this module is essentially the same as the 7.x-1.0-beta2 version except for this issue. That is because the second-to-last commit on the 7.x-1.x branch is

Revert files to state of before project takeover. All new development will be on 2.x

Basically, the 7.x-1.x branch is abandoned, and there is no upgrade path to the 7.x-2.x branch. :-(

benjifisher’s picture

For convenience, I am uploading two patches. One is the version that was applied to the 7.x-1.x branch by the maintainer. That introduces a lot of whitespace changes, so I have also attached a version that suppresses the lines where only whitespace is changed. This is useful only for comparing to the other patches on this issue: the "nows" version of the patch does not apply.