Post by yorkshireboy » Sat Jan 28, 2017 5:55 pm

When logged into admin there is an Alarm bell symbol in the top right hand corner of the screen, next to the link to the store and logout buttons.

There is also a number shown which equates to the number of out of stock products you have, counted as quantity = 0

This number of 'Out of Stock' items includes both Enabled and Disabled products - does anyone know how to adjust the code so that it only shows Enabled products with Quantity = 0?

Any help to point me in the right direction would be appreaciated

I'm using OC2.0.3.1

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Sat Jan 28, 2017 7:09 pm

In the file admin/controller/common/header.php, find following line:

Code: Select all

$product_total = $this->model_catalog_product->getTotalProducts(array('filter_quantity' => 0));
Now add filter_status=1 there. That means replace above line by following one:

Code: Select all

$product_total = $this->model_catalog_product->getTotalProducts(array('filter_quantity' => 0, 'filter_status' => 1));

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by yorkshireboy » Sat Jan 28, 2017 10:00 pm

Hi Opencartmart - your instructions worked perfectly - thank you!!

When you click on the number of out of stock items in the header, it takes you to the product page with quantity set as 0.

Is there a way that status would also be set as 'Enabled' when it opens the Product page?

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Sat Jan 28, 2017 11:25 pm

Change following line:

Code: Select all

$data['product'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&filter_quantity=0', true);
by

Code: Select all

$data['product'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&filter_quantity=0&filter_status=1', true);

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by yorkshireboy » Sun Jan 29, 2017 12:12 am

Thanks Opencartmart - worked perfectly also.

Really appreaciate your assistance, and helping me learn :)

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Sun Jan 29, 2017 1:21 pm

Glad to help. Thanks

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 41 guests