Hello!
How often do you have situations when you need to edit the goods in the order, add a new product to the order, or add the recommended goods to the module, or similar products, etc. ...?
When adding a car sample, you write the name of the product and select it from the drop-down list.
But what if you have this product in the store with exactly the same name, but with a different price or characteristics, and when you add it in the auto-search, the search shows all the goods with the same name and you do not know what to add ...
On this today, I will tell you how to quickly and quickly change the search for a product, which could be searched not by name and, for example, by model, or article.
Addition of goods by article or model is very simply done in opencart, you can of course write some sort of individual conditions for the sample and make it possible to search both by name and model, but we will not do it today, but simply change the ability to search by name for search capability by model or article.
And so all you need to do is change the line in the required files:
1 |
url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' + encodeURIComponent(request.term), |
On:
1 |
url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_model=' + encodeURIComponent(request.term), |
That is, in this line, we changed filter_name to filter_model
Now you can easily search for your products by model, but if you need to search for the SKU, then instead of filter_model we write filter_sku
That's so simple, we changed the search for products in the admin panel.
Now it's time, you need to perform this action in all files where you want to change the possibility of auto selection, for example:
1. If you want to make auto selection by model in the recommended products open the file:
1 |
admin/view/template/module/featured.tpl |
2. If you want to do auto sampling of goods using the model when editing an order, open the file:
1 |
admin/view/template/sale/order_form.tpl |
3. If you want to make auto selection of products by model in similar products open the file:
1 |
admin/view/template/catalog/product_form.tpl |
Well, in general, on the same analogous principle and in other files of the online store where you find auto search for goods by name.
Try if you can not write in the comments.
No Comment
You can post first response comment.