woo-address-book icon indicating copy to clipboard operation
woo-address-book copied to clipboard

Add address book selector to the Cart shipping calculator

Open matt-h opened this issue 5 years ago • 3 comments

The cart shipping calculator has you put country/state/zip. If we could also have it choose from your address book this would save manual entry if the address is already in your address book.

You should still be able to set these manually if it is not in your address book.

Suggested here:

  • https://wordpress.org/support/topic/address-list-in-shipping-calculator-form/
  • https://wordpress.org/support/topic/missing-features-16/ Number 5
  • https://wordpress.org/support/topic/new-cart-address-does-not-carry-through-to-checkout/
  • https://wordpress.org/support/topic/add-shipping-address-book-dropdown-in-cart-page/

matt-h avatar Apr 30 '20 13:04 matt-h

Hey there @matt-h -- I'm working on a PR for this for Hacktoberfest. I've got a proof-of-concept working and will do a little cleanup to get it tight.

Question for you -- I'm going to need to load some javascript on the cart page. Right now I've appended my new javascript to the end of the main scripts.js file and extended the enqueue conditional to include is_cart(). I figure that makes sense rather than splitting the functionality into a new JS file, but I thought I'd see what your thoughts were. As it stands currently it's only about 20 lines of JS unminified.

eriktdesign avatar Sep 27 '21 00:09 eriktdesign

@eriktdesign thanks. I think that makes sense to keep it in just one JS file. The script will be loaded on the next page (checkout) anyway so loading it on the cart I think is just fine and it will be cached once you get to the checkout.

matt-h avatar Sep 27 '21 13:09 matt-h

+1

SamuelAshbrook avatar Mar 09 '23 14:03 SamuelAshbrook