Search By Product Code Query

We want to add a list of products in bulk using there product id for a promotion but the search tab does only allows 1 product id at a time. http://prntscr.com/cx2ioi

Cant we make the query for the same to use " in ( values ) " rather than " = value "

We want to add a list of products in bulk using there product id for a promotion but the search tab does only allows 1 product id at a time. http://prntscr.com/cx2ioi

Cant we make the query for the same to use " in ( values ) " rather than " = value "

Do you mean that you want to define product codes comma separated?

Yes we want to add a list of product codes by comma separation to get results in one shot

What CS-Cart version do you use?

4.2.4 MVE

4.2.4 MVE

app/functions/fn.catalog.php

Replace:

        $pcode = trim($params['pcode']);
        $fields['combination'] = 'inventory.combination';
        $u_condition .= db_quote(" $union_condition (inventory.product_code LIKE ?l OR products.product_code LIKE ?l)", "%$pcode%", "%$pcode%");
        $inventory_condition .= db_quote(" AND inventory.product_code LIKE ?l", "%$pcode%");

with:

        $_pcode = explode(',', trim($params['pcode']));
        $_inventory_condition = array();
        foreach ($_pcode as $pcode) {
            $fields['combination'] = 'inventory.combination';
            $u_condition .= db_quote(" $union_condition (inventory.product_code LIKE ?l OR products.product_code LIKE ?l)", "%$pcode%", "%$pcode%");
            $_inventory_condition[] = db_quote(" inventory.product_code LIKE ?l", "%$pcode%");
        }
        $inventory_condition .= db_quote(" AND (" . implode(' OR ', $_inventory_condition) . ")", "%$pcode%");

It didnot work

We are trying to add the products from the promotions > New Promotion > Condition > Products In

http://prntscr.com/cyljf7

It didnot work

It works on my local installation. PM me temporary FTP access and we will check it

It says you cant accept any more msgs.

Your PM is also full. We have found that the search by SKU field is used for search by custom product attribute, which is called ff_sku.

Please let me know what field in the database do you want to use - ff_sku or product_code?

Please use product_code.

Please use product_code.

In this case it will be required to rework 3rd party module. Please contact us for the quote

And if its ff_SKU then ?

And if its ff_SKU then ?

We have already found where the code is located and can change it for you free of charge

Sure please let us know the change.

Sure please let us know the change.

Please clear your PM and PM me what variant is more suitable for you

Please clear your PM and PM me what variant is more suitable for you

Sent