Post by VanioBoy » Fri Nov 27, 2020 9:44 pm

How do I change the status color of the product page using warehouse_state? Now I take from a quantity of products - a product with 0 pieces is red. As of this week, I have products with quantity 5 and status "expected", I want the color to be orange. And products with quantity 5 and status "In stock" - green color. How do I get stock_status_id from the database?

New member

Posts

Joined
Wed Nov 09, 2016 5:52 pm


Post by OSWorX » Fri Nov 27, 2020 10:09 pm


Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by lavinpratap » Sat Nov 28, 2020 3:44 pm

You can use opencart extensions like the following to show out of stock status in frontend.

https://www.opencart.com/index.php?rout ... n_id=40263

Image

----------------
Download - Out of Stock Module


Newbie

Posts

Joined
Fri May 22, 2020 2:12 pm

Post by VanioBoy » Sat Nov 28, 2020 4:07 pm

It doesn't work for me

New member

Posts

Joined
Wed Nov 09, 2016 5:52 pm


Post by lavinpratap » Sat Nov 28, 2020 6:39 pm

You can get this by the following code

catalog/controller/product//product.php

$product_info = $this->model_catalog_product->getProduct($product_id);

to get the product status - $product_info['stock_status']
to get the product quantity - $product_info['quantity']

----------------
Download - Out of Stock Module


Newbie

Posts

Joined
Fri May 22, 2020 2:12 pm

Post by straightlight » Sat Nov 28, 2020 8:36 pm

Or, you could create an event since the $data['product_id'] can still be pulled.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Alejandrin » Fri Feb 26, 2021 7:24 pm

How do I change the status color of the product page using warehouse_state? Now I take from a quantity of products - a product with 0 pieces is red. As of this week, I have products with quantity 5 and status "expected", I want the color to be orange. And products with quantity 5 and status "In stock" - green color. How do I get stock_status_id from the database?


KrogerFeed

Newbie

Posts

Joined
Fri Feb 26, 2021 7:23 pm
Who is online

Users browsing this forum: No registered users and 59 guests