Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Country nil! #83

Closed
manat129 opened this issue Mar 26, 2015 · 4 comments
Closed

Country nil! #83

manat129 opened this issue Mar 26, 2015 · 4 comments

Comments

@manat129
Copy link

The country is nil when i proceed to checkout, in browser console there was an errors Uncaught TypeError: Cannot read property 'length' of undefined (piggybak.states.js?body=1:30). I was already check country in rails_admin and all countries is there. Can somebody give me some solution for this situation?

@juanroldan1989
Copy link

Hey @manat129 could you please post in some logs about this error and inside which page did you get it ?

Thanks !

@manat129
Copy link
Author

Started GET "/checkout/orders/geodata" for 127.0.0.1 at 2015-03-26 08:35:36 +0700
Processing by Piggybak::OrdersController#geodata as JSON
Piggybak::Country Load (1.2ms) SELECT "piggybak_countries".* FROM "piggybak_countries" ORDER BY name ASC
Piggybak::State Load (13.2ms) SELECT "piggybak_states".* FROM "piggybak_states" WHERE "piggybak_states"."country_id" IN (3, 16,..., 250)
Completed 200 OK in 343ms (Views: 164.1ms | ActiveRecord: 14.4ms)

In page when i wanna to proceed the line_item as orders, in my case in page /checkout

@manat129 manat129 reopened this Mar 26, 2015
@manat129
Copy link
Author

My bad,.. I'm not set option for country Active shipping and Avtive billing "true" :)

@pmaojo
Copy link

pmaojo commented Jan 27, 2016

I had the same problem couse I was making the same mistake, not allowing that options. Thankyou.
Anyone who wants to activate all countries and states for billing and shipping:

Run 0n terminal:

rails c
Piggybak::Country.update_all(active_billing: "true")
Piggybak::Country.update_all(active_shipping: "true")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants