Hello. Recently I updated ubercart to its actual version 6.x-2.6 and discovered a problem. When you press in Cart page Checkout button it`s just seems to reload a cart page (do not get you to checkout). After some time of checking whats wrong, I disabled uc_attributes_in_cart module and the problem disappeared. After enabling problem appears again.

Any ideas how to fix that? Thank you.

Comments

echoz’s picture

@Bronislovas are you using uc_signup (and also updated to 6.x-1.0-rc2)?
I also am getting this, but just posted to the uc_signup issue queue here #1241196: checkout button in cart not going to checkout screen because the issue has come up there and perhaps related.

Bronislovas’s picture

@echoz Thanks for reply. I am not using uc_signup module.

echoz’s picture

Title: Appears problem with checkout button in UC 6.x-2.6 » Checkout button in cart reloads cart screen, rather than going to checkout screen, after update to ubercart 6.x-2.6

Has been reported more extensively in #1238842: Update Cart and Checkout buttons on Cart screen loop back to cart screen! marked as duplicate. Now 4 people have confirmed Ubercart attributes in cart breaks with ubercart 6.x-2.6, which does have a new feature on the cart screen, "Change 'Remove' checkbox on cart page to a button" from #529110: Users misunderstand "Remove” checkbox on cart page

Anyone with programing skill who would take a look at this?

akay’s picture

Through the process of elimination, I can confirm this module causes checkout to fail in ubercart 6.x-2.6.

I also discovered that another (much simpler) custom module I installed called uc_removebutton (from http://drupal.org/node/529110#comment-2076328) also causes the checkout button to fail. Maybe there is a correlation between these two modules which will aid in debugging?

I tried the dev version and it causes the issue also.

akay’s picture

Status: Active » Needs review
StatusFileSize
new791 bytes

I did a bit of digging into the code and found that it was issuing multiple submit callbacks. After reducing the number of callbacks to one and implementing an array_merge function for the submit callback, I am now able to get past this submit loop.

The patch is against the dev version. Please test.

Although it fixes this issue, when I modify any attributes of products in the cart, cart items are randomly deleted now. I have a feeling fixing this bug made another one pop up, but probably not as a result of this fix.

echoz’s picture

@akay, your patch in #5 works in my testing, and I can not reproduce your secondary issue of disappearing items when modifying attributes, which seems to work fine. I am so grateful you worked on this, thank you!

@Bronislovas, can you test? I'll attempt to round up the few other people that found the bug in the other post, that I marked as duplicate.

echoz’s picture

oops, the "Remove" button doesn't work. This is the new feature in ubercart 6.x-2.6 that began the conflict with this module (Ubercart attributes in cart) as well as apparently some other modules that alter the cart.

Bronislovas’s picture

@akay, @echoz I checked the patch. Checkout button seems to work again!

But yes 'Remove' button not works correctly. I noticed that you need to press it 2x times then the item is removed. I made a test and it seems on the first time it tries to Update an item. For example if you are in Cart page and for product choose let`s say other Weight and then press Delete button, then the product is being somehow updated and if Weight attribute is associated with price modification, then entire checkout is being recalculated. But for quantity of product is doing nothing, just reload the Cart page and as mentioned above on the second press delete the item.

Hope this helps.

echoz’s picture

Success using:
ubercart 6.x-2.x-dev (Aug 29)
ubercart attributes in cart 6.x-1.2, patched with #5
(note I used the release version, not dev, since the dev version adds a new feature that seemed incomplete in my testing)

I'm also using uc_signup 6.x-1.0-rc3

Everything works as far as I've tested - remove button, update attributes, cart's submit button. Please test!

I certainly would prefer not to use a dev version of ubercart, but this setup really needs this little gem of a module, such a shame it is no longer supported.

AllyMediaGroup’s picture

Trying patch on same issue, will let you know if the disappearing items happen to me

AllyMediaGroup’s picture

I cannot get the patch to work, still reloads screen.

echoz’s picture

@AllyMediaGroup, with using ubercart 6.x-2.x-dev?

hozt’s picture

Do we have a working fix for this? I do not want to update to Ubercart dev to solve the problem. Until we have a working solution I had to disable this so customers can get to the checkout screen.

echoz’s picture

I wanted to patch ubercart with only what was needed from the dev commits to make this patch work, but could not determine which commit would have made the difference. That would be acceptable, as then I wouldn't have the dev version moving forward, needing to keep it updated as dev.

Josephnewyork’s picture

Don't remove the update submit form submit... That patch basically removes the update and checkout->submit form submitters, when the only issue seems to be just the checkout->submit.

Try just commenting uc_attributes_in_cart.module@246 like this:
//$form['checkout']['#submit'][] = 'uc_attributes_in_cart_cart_view_form_submit';
And it should work fine, at least is works perfect for me now...

Or if you hate patching modules (like me), I just added this to my sites' custom module's hook_form_alter:

function custom_form_alter( &$form, $form_state, $form_id ) {
	switch($form_id) {
		case 'uc_cart_view_form' :
			if($form['checkout']) {
				$form['checkout']['#submit'][0] = $form['#submit'][0];
				unset($form['#submit']);
			}
			break;
	}
	
}

This fixes this bug in a different way but in the long-run, just removed the multiple submit that the new Ubercart doesn't like.

So this module isn't being supported!?

echoz’s picture

Status: Needs review » Reviewed & tested by the community

@Joe Weitzel, this works for me! I've changed status to RTBC.
Tested with ubercart 6.x-2.6 + ubercart attributes in cart 6.x-1.2 with only the line commented out as indicated in #15.

Thank you Joe, you rock!
I wrote that this module is not supported because of the info on the project page, "Development status: No further development". Also note, "Maintenance status: Seeking new maintainer", so someone could pick it up.

Josephnewyork’s picture

Maybe my company could pick it up... I'll think about it. Thanks for clarifying echoz

Jose Ramirez’s picture

I added this code to "uc_attributes_in_cart-6.x-1.x-dev.tar.gz"

function uc_attributes_in_cart_cart_view_form_submit($form, &$form_state) {
uc_cart_update_item_object((object)$form_state['values']);

and I think all work better. I only need click once Update to change attribute and qty.

macmaci’s picture

I am not using uc attributes in cart module and getting same issue. Using ubercart 6.x-2.7 and Drupal 6.22 + uc signup 6.x-1.0-rc3. Checkout button will not go to checkout page. Any help would be appreciated.

echoz’s picture

@macmaci, I suspect you are using another module that alters the cart, and you would need to post to that issue queue.

jludwig’s picture

Here's a patch that implements Xino's code.

It also fixes macmaci's issue with the checkout button not redirecting properly by adding cart/checkout to the $form_state['redirect'].

polmaresma’s picture

#15
This works for me.
Thank's a lot.

jvieille’s picture

#21 solved the issue of not being able to modify quantities in cart

djdevin’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)