Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
8 Jun 2011 at 15:25 UTC
Updated:
4 Jan 2014 at 00:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
longwaveTagging as release blocker and bumping priority, as the saved address selector, payment method dropdown and add line item button do not work on the order edit form in their present state.
Comment #2
bwynants commentedsure about the addresses? #1186914: selecting a customer address in the 'create order' tab does not work works for me? and add line also works after #1186894: add a line item I did not check if the payment details are stored...
Comment #3
longwaveI think your patch will work *except* when the saved address is in a different country, the state/province selector may fail with "An illegal choice has been detected".
But ideally, we should use D7's Ajax features where possible, as it makes things more standard, removes custom JavaScript and generally makes things easier for other developers who want to extend these pages.
Comment #4
bwynants commentedyou know the saying: "first make it work, then make it beautiful"?
I'm running a very small store on beta 3 now with all fixes i submitted....
Comment #5
longwaveOh, I agree, and I'm happy to commit your quick fixes to get things working once I get time to review and test them, while still aiming for this in the long term. But if the order edit page doesn't work properly, and can't work with the existing jQuery replacement method due to D7 form rebuild issues (e.g. the payment method switcher), we still need to fix this before release.
Comment #6
bancarddata commentedI have applied the above patch, but am still having problems. I assume my issues are related - When I try to save an order I get a bunch of CC related errors:
This is on the edit order screen. Are these the same problems, only that the patch only deals with the NEW order, and not the EDIT order? If so, are the changes to the edit screen similar to the patch above?
I am also still having problems with the add line item button. It works, but doesn't actually appear to be working (the items are not shown to be added but if I go out of the order and back in, they are there).
Thanks.
Comment #7
Island Usurper commentedThe create order form shouldn't affect the edit form. Make sure these problems you're seeing aren't present before the patch is applied. However, that does mean that we ought to do the same things to the edit form that don't use Drupal's AJAX system already.
Comment #8
bancarddata commentedI cannot seem to get my create or edit forms to work at all (payment method AJAX forms not displaying, added products get added but do not actually become visible on the form unless I close out of it and go back in, credit cards will not process - says credit card number is a required field, and even the customer search does not seem to find any results ever). Should I be using these referenced patches against the dev branch or the 3.0-beta3 branch?
Comment #9
bwynants commentedissue is marked ad 'dev' so use them on dev...
Comment #10
longwaveCommitted patch from the original post. This only changes the "create order" screen; the "edit order" page is still broken in a number of ways depending on what modules you have enabled.
Comment #11
bancarddata commentedThanks all - I have upgraded to the latest beta4 and my customer search, payment method, and address selection functions all seem to be working properly on the create order page. However, I still have to refresh in order to see that a product has been added. If I click "Add product", it shows me the list as expected. I then pick a product, click "Select", and it shows a Qty field. I then click "Add to order" and the whole section disappears and does not show the item I just added. If I refresh, it shows up ok. After refreshing, upon adding a second or subsequent product, they all show up properly after hitting "Add to order". Should that be fixed now, or is that still outstanding?
Comment #12
longwave@bancarddata: I have committed a fix for the issue you describe in http://drupalcode.org/project/ubercart.git/commitdiff/21a1422
Comment #13
longwaveFrom #1232886-6: "Incorrect Decimal Value" when adding products to the create order screen
Also, the "add product" UI could be improved further with Ajax.
Comment #14
longwaveAttached patch cleans up the payment method pane on order edit, including the COD and Other payment methods. Needs testing with more payment methods.
Comment #15
longwaveUpdated version of the above, removing more redundant code. Payment methods now automatically store their data in $order->payment_details on the order edit screen, though they can still use the 'edit-process' op to make changes if necessary.
Testing and reviews are welcome.
Comment #16
longwave@bancarddata:
Can you explain further? In latest -dev, the states list updates correctly when changing country for me.
This should now be fixed.
This should be fixed by the patch in #15, please test if possible.
Comment #17
longwaveCommitted #15.
There is still more work to be done on the billing/shipping address panes and the customer selector pane.
Comment #18
bancarddata commentedIt does appear that most of my problems are now fixed! If I choose credit card, the AJAX tells me to use the terminal under View Order to process the payment - perfect!
The add product AJAX works correctly from the beginning.
The problem with the Country/Province seems to be limited to copying addresses from Ship-to to Bill-to. If I select Canada as the country, it properly updates the province list and I can choose, for instance, BC. However, if I then try to copy that to the "Bill to" address, the Province will not copy. It seems the country gets copied but the AJAX never fires to update the Province list before it tries to copy the "British Columbia" back over to the billing address. Instead, all I get is an empty list for State/Province and have to switch the country to US and then back to Canada and then manually pick the province.
Thanks longwave!
- Scott
Comment #19
longwaveOK, yep, that's on my todo list, and was one of the issues I was hinting at in #17.
Comment #20
bancarddata commentedYeah, and the way the Quantity field pops up after you click Select on the product you wish to add is a bit goofy. Personally, I wouldn't mind if it skipped the quantity field and just went straight to a line item on the order. From there I can adjust the quantity as needed.
Of course, my opinion of the best case scenario would to just have a grid (start with maybe 5 or 10 empty rows and have a button where you can add 5 or 10 more lines at a time if needed) where I can start typing a SKU or a description and it would start searching for potential matches right away in a little drop-down box. Then arrow down to pick the one you are looking for, tab, enter quantity, tab to weight, tab to cost, tab to price, tab to next line, etc. Make it a lean, mean, order takin' machine, in other words.
Just an idea.
Comment #21
tr commentedI reverted commit 7db0983ce, which was applied in comment #10, because it broke the "Orders" test cases. Tests need to be updated to accommodate changes to the "Create orders" page introduced by that commit. Test cases now run green in HEAD.
Comment #22
Island Usurper commentedIt looks like the test failed because of the AJAX (naturally), but also because #tree was set to TRUE. Once that was taken care of, I found that just giving an email to the search form couldn't find the test user.
Rerolled 7db0983ce to include these fixes, and now the Order tests pass.
Comment #23
bancarddata commentedThanks for your continued efforts on this issue. The form has come a long way already. My only concern is the adding products section. It is painful, and I end up seeing AJAX errors pretty regularly, I assume mainly because i have not performed *exactly* the correct steps in the proper sequence to add a product to the order. Is something like an auto-fill ("starts with" for the SKU, and "contains" for the product title) on a grid form possible?
Comment #24
bancarddata commentedI am not sure if this is at all related, but I cannot get the credit cards to run anymore from the View Order -> Process card screen. It shows up ok and I can enter in the card details, but it gives the following error:
REJECTED: Credit card number is required.
It seems like it is not grabbing the info from the form on the Process card page, but rather perhaps looking for the CC info that used to be collected on the Edit Order screen? From my perspective, I don't want the CC info ever stored anywhere. It should only be in there long enough to authorize payment and then cleared out. Maybe in the future we will be more inclined to use Authorize.net's CIM feature for customer's convenience. But right now, I just want to do it the safe way.
Comment #25
Island Usurper commentedI don't have any problems with that. I've tried creating a brand new order, changing the payment method of an old order, and checking out with a credit card, and they all work just fine.
Have you flushed Drupal's cache since you applied the patch? It kind of sounds like the form cache still has old data in it.
Comment #26
bancarddata commentedJust following up - it does appear to be working again since I flushed the cache (blush). Still new enough to all of this to make those newbie mistakes...
On another note related to the overall layout of the order page, I made a couple of adjustments to uc_order/uc_order.order_pane.inc to make it more useful for our needs. Mainly, I need the SKUs to show up and have the list ordered by that. I am thinking this will not be useful for everyone, but perhaps making this an option would be useful (or allowing a selection of which fields to display and allowing the user to select which column to be sorted by).
Below is a diff of my uc_order.order_pane.inc that adds the SKU field to the product listing and orders by that. It also places all of the kits at the bottom without the SKU since the SKU field in kits is an aggregate of all SKUs in the kit and totally screws up the view). I am sure this is pretty ugly code and could be made much neater, but I am still getting my feet wet here.
495c495
< $result = db_query("SELECT nid, title FROM {node} WHERE type IN (:types) ORDER BY title", array(':types' => $types));
---
> $result = db_query("SELECT node.nid, node.type AS type, node.title AS kittitle, CONCAT(uc_products.model,' - ',node.title) AS title FROM {node}, {uc_products} WHERE node.type IN (:types) AND node.nid = uc_products.nid ORDER BY type, title", array(':types' => $types));
498c498,502
< $options[$row->nid] = $row->title;
---
> if ($row->type == "product_kit") {
> $options[$row->nid] = $row->kittitle;
> } else {
> $options[$row->nid] = $row->title;
> }
Comment #27
Island Usurper commentedCommitted the patch since it works for both of us.
I'm glad you're eager to help, but you really need to make a new feature request to deal with the order pane layout. Also, unified diffs (made with -u) are vastly preferred, and as attachments to the comment.
I didn't think product kits were supposed to show up on orders, but are supposed to be split up into component parts. Just something to think about.
Comment #28
bancarddata commentedUnderstood and thanks for the advice - I will get one started and if I have patches to contribute I will make them as you state. I am not entirely sure if what I have in #26 is really commit-worthy. I would wanna see what others have to say about it; I made a similar change to the product_kit editor page that shows the SKUs in the list. I will start a new "feature request" and attach that as a patch as you specify.
And I will go ahead and start a new issue with my ideas for the order pane so we can get that in its own place. Sorry for keeping this thread open so long beyond its designated title...
Oh, and I agree, product kits (at least for those that are set "As individual products") shouldn't be added to orders. The individual parts should. However, it would be awfully nice to be able to add the kit from the manual order page rather than adding 20 parts individually, just like a customer would be able to do from the front-end website. That is *kinda* how it works now. Anyway, material for the new issue I will create shortly.
Comment #29
mcctnt2000 commentedHey bancarddata,
I have that same long list of errors as you (see below):
Notice: Undefined index: cc_number in _uc_authorizenet_charge() (line 466 of /home/content/53/8013653/html/sites/all/modules/ubercart/payment/uc_authorizenet/uc_authorizenet.module).
Notice: Undefined index: cc_exp_month in _uc_authorizenet_charge() (line 467 of /home/content/53/8013653/html/sites/all/modules/ubercart/payment/uc_authorizenet/uc_authorizenet.module).
Notice: Undefined index: cc_exp_year in _uc_authorizenet_charge() (line 467 of /home/content/53/8013653/html/sites/all/modules/ubercart/payment/uc_authorizenet/uc_authorizenet.module).
Notice: Undefined index: cc_cvv in _uc_authorizenet_charge() (line 468 of /home/content/53/8013653/html/sites/all/modules/ubercart/payment/uc_authorizenet/uc_authorizenet.module).
There was an error processing the credit card. See the admin comments for details.
Notice: Undefined index: cc_number in uc_payment_method_credit() (line 536 of /home/content/53/8013653/html/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module).
The Admin Comments state:
08/29/2011 - 15:33 Combat Training Aids Authorization and capture
REJECTED: Credit card number is required.
Amount: $1,480.50
AVS response: P - AVS not applicable for this transaction
CVV match: -
I have the latest Dev version. I've scoured the internet, to no avail. Any help would be greatly appreciated. I apologize if this has been thoroughly addressed as I have not been able to make heads or tails as to the current status of this particular issue via this thread or any others.
Note: these errors occur while trying to manually process a credit card transaction via the create order option in the store. It seems that after I enter the credit card info and hit the process button it gets erased.
Comment #30
bancarddata commentedYeah it seems the problem is back for me as well. I had flushed cache before and it worked once. I haven't been back since due to the long list of things that still need to be addressed but tried again today and those errors are back. Clearing cache does not help. Perhaps we can work together to figure this out since Island Usurper cannot reproduce the problem. I have started a new issue here: #1264886: Unable to process credit cards from offline order page