Hi @guymal! I have 2 questions to you:
- How are people signing up on your website? Through which of the integrations?
- How the language is switched on your website? Is the locale displayed as a subdomain or a suburl, like yourdomain.com/fr/ ?
Thread Starter
guymal
(@guymal)
Hi @bogdanfix
- People are signing up through sales with Woocommerce. So they are added to my Sendfox list with your Woo integration once they make a purchase.
- The language is set through the url in my example, so mysite.com/fr/somepage but with Polylang you can get the page language simply by using:
$language=pll_get_post_language( $page_id);
Since different sites could be using different methods to determine the current language (subdomain, suburl, entirely different domain etc…)
Thanks
Thanks for the detailed response, @guymal. It will require some customization from my end to add functionality that allows to setup different lists for different locales.
Unfortunately, I am currently not able to take any custom projects.
So, if you could find a way to build that customization, you can easily make a pull request via GitHub: https://github.com/bogdanfix/wp-sendfox
And I will be happy to check and merge that code.
Thread Starter
guymal
(@guymal)
Thanks for the reply @bogdanfix
What I did was create a code snippet that uses
add_filter( 'sf4wp_before_add_contact', 'sendfox_list_by_language', 10, 3 );
and then in that check the woocommerce order to see what product they ordered, check what language the product is in, and then accordingly pick what Sendfox list to use.