This patch improves the /admin/store/settings/quotes/methods page by displaying the flat rate and weight quote prices directly on that page and providing edit links for each method, instead of than splitting them into separate sub-pages.

Comments

longwave’s picture

Assigned: Unassigned » tr
StatusFileSize
new2.87 KB

Committed with a minor wording change from Actions to Operations.

This patch moves UPS and USPS settings from the secondary tabs to "configure" links directly on the shipping quote settings form. Assigned to TR for review as he has a more vested interest in these modules :)

tr’s picture

Status: Needs review » Needs work
StatusFileSize
new21.39 KB

Patch in #1 works and is consistent with #0.

I do think this is a step in the right direction, but I miss the ability to switch between the different method configuration pages with only one click, using the secondary tabs. Now, in order to switch, I have to hit the back button then click on a different configure (or edit) link. Basically, the configuration pages have lost the context. Perhaps the "Methods" and "Settings" tabs should appear on these configuration pages, like they do on the main admin/store/settings/quotes page?

Also, the original patch has a problem - table layout breaks if a shipping method doesn't declare an "operations" key in hook_uc_shipping_method(). Image attached (using Chrome). I suspect this is because theme_links() is used to format the cell contents, and it returns '' if the links array is empty. Also, the description of hook_uc_shipping_method() in uc_quote.api.php should be changed to reflect the new keys.

EDIT: I originally said this happens in Firefox, but that's incorrect - it happens only in Chrome. Firefox behaves normally.

longwave’s picture

Status: Needs review » Needs work

How about adding a cancel button to the UPS and USPS pages alongside "Save configuration", and redirecting back to the list after either button is pressed? Not sure if we can get the tabs to appear on child pages without some menu API trickery.

longwave’s picture

Also I can't reproduce your screenshot, I don't see why there is a gap in the header. What does the HTML source look like for the table, and what happens if you click "show row weights"?

tr’s picture

It may very well be a bug in the core Drupal JavaScript. I have 14 shipping methods defined on my test site. The table is displayed properly when first visiting admin/store/settings/quotes, but gets corrupted when I scroll down to see the bottom of the table. As soon as the table header reaches the top of the page, the header gets corrupted. Since this happens at exactly the time when the table header is modified to pin it to the top of the page (so it remains visible at all times, even when scrolling through large tables), and since this "pinning" behavior is something that has been messed with in core relatively recently, I suspect that's where the problem lies.

I actually see the same problem at admin/store/settings/payment. Even if you don't have a large table like I do, you should be able to reproduce this by shrinking your browser window vertically so you have to scroll to see the entire table.

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new4.03 KB

This patch is #1 with added "cancel" links on the UPS and USPS forms, so at least there's some way back to the settings page. The breadcrumb trail also works except on the UPS form where it doesn't show up for some reason.

I still can't reproduce the table header bug but suspect it may be a combination of Drupal core version and specific browsers, and nothing we can fix here.

tr’s picture

Status: Needs work » Needs review

I edited #2 - I had mistakenly said this happens in Firefox. That's not right - Firefox works properly. I only see this weird behavior in Chrome.

I can reproduce this with the core table at admin/config/regional/language. It seems to happen only when tableheader.js and tabledrag.js are used together. I'll search the core issue queue and file a bug there if there's not already an issue.

I'll take a look at #6 later today.

longwave’s picture

longwave’s picture

StatusFileSize
new6.87 KB

Updated version of #6 that moves UPS and USPS settings into the "settings" tab which makes a bit more sense to me, leaving the methods page clean while keeping all options visible for access to the other pages.

tr’s picture

#9: 1307900-ups-usps-settings.patch queued for re-testing.

tr’s picture

Status: Needs review » Reviewed & tested by the community

I like this better now, and it works fine.

The only thing that might be confusing to users is the difference between how flatrate/weightquote are handled and how the other methods are handled. But I think that can be fixed with a short paragraph of explanation at the top of the page. I can add that after you commit the patch if you want.

tr’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs documentation

Committed.

Needs documentation of the 'operations' parameter to hook_uc_shipping_method() in uc_quotes.api.php. That looks like it is being taken care of in #1308692: Shipping quote methods should not control their own enabled and weight settings.

Also needs the above-mentioned paragraph of explanation, which I will take care of in a separate commit.

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