Documentation for hook_checkoutapi lists the available $op values as form, save, validate, review, review_validate and review_save. Similarly, in the example code, the 'review_save' case is provided (though in the example it goes nowhere and does nothing). This disagrees with the operations listed in the 'return value' section (form, save, validate, review, review_validate, review_submit) and the actual checkoutapi code.

This caused me quite some headscratching as I was trying to use review_save to save some stuff ... could the documentation be updated to change review_save to review_submit please? (The discrepancy appears to persist in the 5.x-4.x docs, so should probably be amended there as well, but with no direct experience of 4.x I couldn't say which of them was correct.)

Comments

vegeneric’s picture

bumping this... i wasted a lot of time trying to figure out why nothing was working until i stumbled across this post.

vegeneric’s picture

I believe hook_product_specials() is also documented incorrectly... http://www.drupalecommerce.org/api/function/hook_product_specials/53 lists three parameters ($node, $specials, $txn) while the actual function accepts four ($node, $specials, $type, $txn).

gordon’s picture

Actually I think this is correct for 5.x-3.x, but it was changed in 4.x to include $type to allow the module to determine if it should add the discount, since you may not want the discount added in certain places.