Post by inowgsmro » Fri Apr 05, 2019 7:45 pm

Hello,

I was looking inside the code for Opencart 3.0.2.0 and I saw that Settings -> Options -> Product count was disable, but in fact in the source code on the website, it spanned the product count, but it was actually put with display none. The actual setting is useless because it is pushing the DB the same as with display on.

From what I've learned from other platforms that if I disable a function, it does not use it anymore or query it. It so happens that Opencart does not disable it, it hides it.

So, any help within the files?

Newbie

Posts

Joined
Mon Apr 01, 2019 5:25 pm

Post by letxobnav » Fri Apr 05, 2019 11:07 pm

nope, if the setting is to not do the product count, it does not do the product count.
Well, it does but only for the pagination not for the category display.

Code: Select all

				$data['categories'][] = array(
					'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
					'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
				);

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by cedcommerceteam » Tue Apr 16, 2019 2:57 pm

Hey @inowgsmro
No please check controller file either category or filter or menu in catalogue section

The total count model function is always called if the product count setting is enabled

($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : '')

I think you misunderstood that setting this is for only hide the count of products besides the category in small brackets.
So that if the category has a large number of products so it does not slow down the page

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm
Who is online

Users browsing this forum: No registered users and 178 guests