Jump to content

[Solved] Quick Coding Question.


WingTsun247

Recommended Posts

This issue was solved. Thanks to: okom3pom

 

I have made a script (plugin), which generates XML Export files for specific shops. Everything is fine with that. The problem is, I need to SELECT only products, which are NOT DISABLED. Currently it SELECTS ALL Products from the DB.

 

This is how I select Products:

This is whrere I need to make changes, to make it select only enabled ones.

$product  = Product::getProducts((int)Context::getContext()->language->id, 0, 0, 'id_product', 'ASC');

After this I do a foreach loop like this:

foreach($product as $key => $data) {

The other way would be to do smth like this:

if($data['IsDisabledOrSmth']) {
    // do nothing..
}
else {
    // let my script to go further..
}

Note!

Everything, other than Selecting only the ENABLED products are working fine in the script.

 

Thank you for your time,

WingTsun.

Edited by WingTsun247 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...