pietjanssen Posted August 10, 2016 Share Posted August 10, 2016 (edited) Why is it needed to load all countries on every click in the front pages. On line 74 $countries = Country::getCountries($this->context->language->id); If i look at the code, then its only needed in the admin page where you can export the subscribers. Because profiler comes everytime with this query as slow and also in the memory uses list. Edited August 10, 2016 by pietjanssen (see edit history) Link to comment Share on other sites More sharing options...
OpenSource Expert Posted August 11, 2016 Share Posted August 11, 2016 Remove the content from __construct() and add in getContent() if ($this->id) { $this->file = 'export_'.Configuration::get('PS_NEWSLETTER_RAND').'.csv'; $this->post_valid = array(); // Getting data... $countries = Country::getCountries($this->context->language->id); // ...formatting array $countries_list = array($this->l('All countries')); foreach ($countries as $country) $countries_list[$country['id_country']] = $country['name']; // And filling fields to show ! $this->fields_export = array( 'COUNTRY' => array( 'title' => $this->l('Customers\' country'), 'desc' => $this->l('Filter customers\' country.'), 'type' => 'select', 'value' => $countries_list, 'value_default' => 0 ), 'SUSCRIBERS' => array( 'title' => $this->l('Newsletter subscribers'), 'desc' => $this->l('Filter newsletter subscribers.'), 'type' => 'select', 'value' => array( 0 => $this->l('All customers'), 2 => $this->l('Subscribers'), 1 => $this->l('Non-subscribers') ), 'value_default' => 2 ), 'OPTIN' => array( 'title' => $this->l('Opted-in subscribers'), 'desc' => $this->l('Filter opted-in subscribers.'), 'type' => 'select', 'value' => array( 0 => $this->l('All customers'), 2 => $this->l('Subscribers'), 1 => $this->l('Non-subscribers') ), 'value_default' => 0 ), ); } Link to comment Share on other sites More sharing options...
pietjanssen Posted August 18, 2016 Author Share Posted August 18, 2016 I will do that, thank you for the reply. Hope that it will be fixed in an next release or module update. Link to comment Share on other sites More sharing options...
rocky Posted August 19, 2016 Share Posted August 19, 2016 Post it on the Forge if you want it fixed. It's unlikely PrestaShop will see this post and fix it. Link to comment Share on other sites More sharing options...
pietjanssen Posted August 19, 2016 Author Share Posted August 19, 2016 Created an ticket http://forge.prestashop.com/browse/PSCSX-8315 Link to comment Share on other sites More sharing options...
rocky Posted August 19, 2016 Share Posted August 19, 2016 Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now