Jump to content

Get page with selector fails in non default language


PCkuijper
 Share

Recommended Posts

I'm working on implementing apeisa's shop module in our new multilanguage website. But when i switch to the english version of the site it fails to find the order.

The selector used:

template=sc-order, sc_session={$sid}, status=unpublished, limit=1, sort=-created

returns the correct page on the default language, but returns nothing on a secondary language.

I've checked the session and that remains exactly the same.

I've found that when I check the active box on the 2nd language url on it works again. But haven't found a way to automatically do this when creating the orders.

Link to comment
Share on other sites

If a page is not active for your secondary language there is nothing to find/get in that language.

If you create orders via the API you can set a language active via this:

https://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/

Pages created via the PW admin should already activate all languages by default.

  • Like 1
Link to comment
Share on other sites

Glad you got it sorted. If you've searched via the native forum search i'm gonna give you a tip:

Always use Google to search the forum. Native search is downright useless most of the times and pretty crappy at best.

"site:processwire.com/talk set language active api" in Google would have given some results :)

Link to comment
Share on other sites

I always use google to find my answers, although without the site:processwire.com/talk (PW forums tend to be the top 10 results anyway).

But for some reason I couldn't find it anywhere. Guess my searched weren't formatted as they should've (overcomplicated things)

Thanks once more

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...