Jump to content

Product Reference In Select Menu


Recommended Posts

Please, could someone tell me how to get the product ref into the "Add Product" select menu when editing orders in PS 1.6? Just like the look of adding accessories in product editing ...

 

And in addition, it would be very useful, if only active products where shown...

 

Many thanks in advance, I´ve been looking for a solution a rather long time!

Share this post


Link to post
Share on other sites
You could bind the autocomplete field #add_product_product_name in orders page, to ajax_products_list.php just like #product_autocomplete_input in the product page

Or, you can apply the following (lines number are given wrt PS 1.6.1.4).

  • /controllers/admin/AdminOrdersController.php, replace line 1797 by (exclude non active products from search)
foreach ($products as $index => &$product) {
    if (!$product['active']) {
        unset($products[$index]);
        continue;
    }
    // Same as before after that...
  • /js/admin/orders.js, replace lines 351 to 357 by (adapt to above + format product line):
parse: function(data) {
    var products = new Array();
    if (typeof(data.products) != 'undefined')
        for (var i in data.products)
            products.push({
                data: data.products[i],
                // Adjust value as you want the product line to be displayed...
                value: data.products[i].id_product + " - " + data.products[i].name + " (ref: " + data.products[i].reference + ")",
            });
    return products;
},

 

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More