v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
This option can be found under System -> Settings -> 'edit' for your default store -> 'Option' tab -> 'Default Items Per Page (Admin)' option. But do note that this applies to everything across the admin panel, such as customers, orders, etc.
Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager Pro • Drag & Drop Sort Order
Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.
Well, if you don't mind hardcoding the number of products to display on the page, just go to "admin/controller/catalog", open up "product.php", and replace all instances of:
Code: Select all
$this->config->get('config_limit_admin')
Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager Pro • Drag & Drop Sort Order
Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Put this somewhere in admin\view\template\catalog\product_list.twig
Code: Select all
<div class="col-sm-1 text-left">
<select onchange="custom_list_limits(this.value)" class="form-control">
<option value="*"></option>
{% for list_limit in list_limits %}
{% if list_limit == list_limit_value %}
<option value="{{ list_limit }}" selected="selected">{{ list_limit }}</option>
{% else %}
<option value="{{ list_limit }}">{{ list_limit }}</option>
{% endif %}
{% endfor %}
</select>
</div>
Put this somewhere at the bottom of the same twig file with the rest of the javascript. Change the admin folder name if you changed yours.
Code: Select all
<script>//Set the product list limit within the product list (this will also set the limit for all other lists in the admin).
//Come back to this at some point to make it only for the product list
function custom_list_limits(str) {
var xmlhttp = new XMLHttpRequest();
//Send the limit count to the function to update the database
xmlhttp.open("GET","index.php?route=catalog/product/custom_pass_new_limit&user_token={{ user_token }}&q="+str,true);
xmlhttp.send();
//Sleep so the database has time to update
wait(250); //.25 seconds in milliseconds
//Reset the window with the new limit set
window.location = ('/admin/index.php?route=catalog/product&user_token={{ user_token }}')
}
//Sleep
function wait(ms){
var start = new Date().getTime();
var end = start;
while(end < start + ms) {
end = new Date().getTime();
}
}
</script>
Put this in admin\controller\catalog\product.php in getList() just above '$pagination = new Pagination();'
Code: Select all
$data['list_limits'] = array();
$data['list_limits'] = array(
'25' => "25",
'50' => "50",
'75' => "75",
'100' => "100",
'150' => "150",
'200' => "200",
'250' => "250",
'300' => "300"
);
$data['list_limit_value'] = $this->config->get('config_limit_admin');
Put this in the same controller
Code: Select all
public function custom_pass_new_limit() {
$q = intval($_GET['q']);
if (isset($q) && $q > 1) {
$newlimit = $q;
} else {
$newlimit = $this->config->get('config_limit_admin');
}
$this->load->model('catalog/product');
$this->model_catalog_product->custom_set_new_limit($newlimit);
//$this->getList();
}
Put this in admin\model\catalog\product.php.
Code: Select all
public function custom_set_new_limit($str_limit) {
$this->db->query("UPDATE " . DB_PREFIX . "setting SET VALUE = '" . (int)$str_limit . "' WHERE `key` = 'config_limit_admin'");
}
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Users browsing this forum: Semrush [Bot] and 13 guests