Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipping address default #42

Closed
alexfromvl opened this issue Mar 28, 2017 · 2 comments
Closed

Shipping address default #42

alexfromvl opened this issue Mar 28, 2017 · 2 comments

Comments

@alexfromvl
Copy link
Contributor

alexfromvl commented Mar 28, 2017

Add to default SHIPPING ADDRESS - Goods shall be shipped to the Buyer on Ex–warehouse delivery terms.

The problem is that the shipping address field is mandatory. If there is not a single field, then it's impossible to create an order.

Adding an address will solve the problem of creating test orders.

@alexfromvl
Copy link
Contributor Author

Add PR #43

@JamesRamm
Copy link
Collaborator

Hi
Thanks for the contribution!
I think that exposing the Address model to the wagtail admin right now would make it relatively confusing and doesnt go as far as needed. I'd prefer a more comprehensive solution around creating 'customers'. I think this would be some future work (perhaps a 0.2.0 or 0.3.0 release).

I agree that some way to create Orders from the wagtail admin is required. This can either be by:

  • Improving the current Order admin so that the address can be explicitly added in the order, rather than selecting an existing one (preferred, but more complex)
  • Providing a demo/default address in a migration (easy, perhaps not ideal)

For now, a work around would be to create an address manually in the django shell::

   from longclaw.longclawshipping.models import Address

   address = Address(name='test', line_1='test', city='test', postcode='test', country='test')
   address.save()

The address will then be available in the wagtail admin.

To implement unit tests, you can submit a blank address in the request data, something like:

   
    data = {
        'address': {
            'shipping_name': '',
            'shipping_address_line_1': '',
            'shipping_address_city': '',
            'shipping_address_zip': '',
            'shipping_address_country': '',
            'billing_name': '',
            'billing_address_line_1': '',
            'billing_address_city': '',
            'billing_address_zip': '',
            'billing_address_country': ''
        },
        'email': 'test@test.com',
        'shipping_rate': 0
    }
    self.client.post(reverse('checkout'), data)

This was referenced Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants