The Commerce Shipping Quick Estimate Module was built to provide means for retrieving shipping estimates without having to go through the entire checkout process. The module currently implements an additional block, "Shipping Estimate Calculator", which must be enabled and placed within a region on your site.

Requirements

  • Drupal Commerce
  • Drupal Commerce Cart
  • Drupal Commerce Shipping

Instructions

  1. Download the module below
  2. Upload it to /sites/all/modules folder
  3. Enable the module via the Modules page (/admin/modules)
  4. Enable and place the block as necessary via the Blocks page (/admin/structure/block)

Current Limitations

  • This module is currently set to pull estimates from within the United States. International support has not been implemented
  • No fallback for when JavaScript is disabled

Common Issues

Repos

Page

https://www.drupal.org/sandbox/jasonkryst/2333095

Git

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jasonkryst/2333095.git commerce_shipping_quick_estimate
cd commerce_shipping_quick_estimate

Comments

jasonkryst’s picture

Issue summary: View changes
jasonkryst’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

t-lo’s picture

Hi Jason,

Thanks for the contribution!

It looks like you've added the maintainers git code above, the git details should be:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jasonkryst/2333095.git commerce_shipping_quick_estimate
cd commerce_shipping_quick_estimate

I'll go through the code now

t-lo’s picture

A couple of coding standards issues reported by the pareview site, but nothing major:
http://pareview.sh/pareview/httpgitdrupalorgsandboxjasonkryst2333095git

t-lo’s picture

You need to add the "commerce_cart" module to your dependencies as you use it's function "commerce_cart_order_load":

 // Load User Cart and set necessary profile information.
    $order = commerce_cart_order_load($user->uid);

If the cart module isn't enabled it causes a fatal error in the AJAX callback:

HTTP Result Code: 200
Debugging information follows.
Path: /system/ajax
StatusText: OK
ResponseText:
Fatal error: Call to undefined function commerce_cart_order_load() in /home/codio/workspace/sites/all/modules/commerce_shipping_quick_estimate/commerce_shipping_quick

jasonkryst’s picture

Issue summary: View changes
jasonkryst’s picture

Issue summary: View changes

Updated the project summary for this ticket to include additional details

jasonkryst’s picture

Hi T-lo,

Thank you for your input! I have updated the project info file as well as the readme file to include the additional requirements for the module to function properly. The necessary changes have been uploaded to the repos.

Thank you!
Jason Kryst

t-lo’s picture

Hi Jason,

Confirmed commerce cart enabled on install and fixed that issue, thanks.

jasonkryst’s picture

Status: Active » Needs review

T. lo,

Thank you for verifying the changes. I am going to move this into Needs Review for additional comments.

Jay

veso_83’s picture

Hi jasonkryst,

The module is pretty nice and seems to work fine; I’ve tested it manually and reviewed the code, I have only one comment in your function commerce_shipping_quick_estimate_block_view it will be better if you use maybe if/else statement because switch is primarily used for multiple choices while in your case your have just one option.

Good luck.

jasonkryst’s picture

Veso,

Thank you for your input. In regards to switching the switch to an if, that does make sense. Although, I plan on eventually expanding this module's functionality over time. When I started developing Drupal modules about three years ago, I used the Pro Drupal 7 Development book as a guide, which trained me to use switch statements within block declarations and set-up pages.

I appreciate your comments, they are very helpful!

Thank you,
Jay

veso_83’s picture

Hi jasonkryst,
You are right in this case good luck

jdrichmond’s picture

Status: Needs review » Reviewed & tested by the community

Individual user account
Follows the guidelines for individual user accounts.

No duplication
Does not cause module duplication and fragmentation.

Master Branch
Follows the guidelines for master branch.

Licensing
Follows the licensing requirements

3rd party code
Follows the guidelines for 3rd party code.

README.txt/README.md
Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Follows the guidelines for project length and complexity.

Secure code
Yes

Coding style & Drupal API usage
Nothing found that needs to be addressed before release.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Module review

Non-blocking issues:

  • You can remove the .gitignore file
  • All user-facing text should go through the t() function for translatability
  • Use single quotes where possible to adhere to Drupal core standards and a very slight performance gain
  • Do you have to save the new profiles? That seems like it could wipe out information that's already present
  • You can use theme('item_list') instead of building the ul manually

Thanks for your contribution, jasonkryst!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

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