Using Ubercart 2.x. This module doesn't appear to discern whether or not an implementation of hook_add_to_cart in another module returns TRUE and thus let the product be added.

Compare with uc_cart.module handling of results at line 1308.

Comments

erik seifert’s picture

Sorry i have the same check like uc_cart

is_array($result) && !empty($result)

is the same like

is_array($result) && count($result) > 0 

Do you have an example for me ?

Sborsody’s picture

Sorry I should have been more descriptive.

If $result['success'] is set to TRUE in the return results, uc_ajax_cart pops up a blank message and the item isn't added to the cart. The check to see if there's any return arguments is only the beginning. There can be return arguments that allow a product to get added to a cart. Note also the behavior expected if $result['silent'] is set.

Look at uc_cart.module where it checks success value (and after that silent value).

1308       if ($row['success'] === FALSE) {
erik seifert’s picture

Thanks, will be in next version ( next week ).

erik seifert’s picture

Corrected in 1.0

erik seifert’s picture

Status: Active » Fixed

- fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.