I'm trying to edit address form for Saleor ecommerce platform

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

I'm trying to edit address form for Saleor ecommerce platform

ruslan.aldar
hello. 
I'm trying to build an local merchant website. So I don't know how to edit address form for Saleor. It uses google i18n address form. 
and when i'm trying to delete some fields like company_name, city city_area, postal_code, country, country_area, i'm having problem.

on the page : http://localhost:8000/checkout/shipping-address/

i'm getting 
{% with address_form_lines=address_form.i18n_fields_order %}
this kind of error. 

Making migration doesn't solve the problem and I don't know why it's requesting the field which is doesn't exist!  I even tried deleting DB, migrating again!

If someone knows it please tell me. 
Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to edit address form for Saleor ecommerce platform

Avraham Serour
You seem to have pasted a line from your template, not the error you are getting, no way of helping you there.

Please post the actual error you are getting

On Sat, Apr 7, 2018 at 2:00 PM, ruslan.aldar <[hidden email]> wrote:
hello. 
I'm trying to build an local merchant website. So I don't know how to edit address form for Saleor. It uses google i18n address form. 
and when i'm trying to delete some fields like company_name, city city_area, postal_code, country, country_area, i'm having problem.


i'm getting 
{% with address_form_lines=address_form.i18n_fields_order %}
this kind of error. 

Making migration doesn't solve the problem and I don't know why it's requesting the field which is doesn't exist!  I even tried deleting DB, migrating again!

If someone knows it please tell me. 
Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFWa6t%2BAX%3D_TGh5LLa-RyX9Xc9Y_YVm-iL965d3r1DkcK4zU2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to edit address form for Saleor ecommerce platform

ruslan.aldar
Hello thank you for your reply.
the problem is when I'm removing fields like company_name, city, city_area, postal code from account/models.py , i18n.py. 

Mostly this error appears when I delete one line in I18N_MAPPING.

on the web:

KeyError at /checkout/shipping-address/

'company_name'
Request Method:GET
Request URL:http://localhost:8000/checkout/shipping-address/
Django Version:2.0.3
Exception Type:KeyError
Exception Value:
'company_name'
Exception Location:C:\Users\rusla\Documents\GitHub\zahial\saleor\saleor\account\i18n.py in _convert_to_bound_fields, line 199

Error during template rendering

In template C:\Users\rusla\Documents\GitHub\zahial\saleor\templates\account\snippets\address_form.html, error at line 3

company_name

1{% load bootstrap_field from bootstrap4 %}
2<div class="i18n-address">
3 {% with address_form_lines=address_form.i18n_fields_order %}
I deleted commented out every company name in my source code. But I still having same issue.
I guess i18naddress requires those fields by default. 


On Sunday, April 8, 2018 at 8:38:14 PM UTC+8, Avraham Serour wrote:
You seem to have pasted a line from your template, not the error you are getting, no way of helping you there.

Please post the actual error you are getting

On Sat, Apr 7, 2018 at 2:00 PM, ruslan.aldar <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="jzOkiqcMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ruslan...@...> wrote:
hello. 
I'm trying to build an local merchant website. So I don't know how to edit address form for Saleor. It uses google i18n address form. 
and when i'm trying to delete some fields like company_name, city city_area, postal_code, country, country_area, i'm having problem.

on the page : <a href="http://localhost:8000/checkout/shipping-address/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A8000%2Fcheckout%2Fshipping-address%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBSEMx9klg5UuX-KYO0SZUzF8sXw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A8000%2Fcheckout%2Fshipping-address%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBSEMx9klg5UuX-KYO0SZUzF8sXw&#39;;return true;">http://localhost:8000/checkout/shipping-address/

i'm getting 
{% with address_form_lines=address_form.i18n_fields_order %}
this kind of error. 

Making migration, or deleting db, doesn't solve the problem and I don't know why it's still requesting the field which is doesn't exist!  I even tried deleting DB, migrating again!
 

If someone knows it please tell me. 
Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jzOkiqcMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jzOkiqcMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c8a39ae6-d0fe-4714-b87b-733e89ade8f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to edit address form for Saleor ecommerce platform

samuel muiruri
In reply to this post by ruslan.aldar
"adress_form_lines" you need to follow it to where you get the data from then follow that to wherever the model is, maybe it's instanced somewhere inside the model like

class Model(models.Model):
    ...

    def __str__(self):
           return self.company_name

anyway likely it's noted where in the code it crashed later on down the line of the error

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b1d7a083-12b5-4682-804e-baf12feb17a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.