Update product stock directly from Magento database

Magento
Sometime in some situation development time we need to update products quantity and stock status directly in the magento database. here I describe the most efficient way to do this is to update the products quantity and stock status directly in the database. Product quantity is stored in cataloginventory_stock_item table in qty and stock status in is_in_stock column, also we have to update cataloginventory_stock_status, the columns qty and stock_status with the corresponding Boolean value. So, the SQL query should look something like below query: [sourcecode language="plain"] UPDATE cataloginventory_stock_item item_stock, cataloginventory_stock_status status_stock SET item_stock.qty = '$new_quantity', item_stock.is_in_stock = IF('$new_quantity'>0, 1,0), status_stock.qty = '$new_quantity', status_stock.stock_status = IF('$new_quantity'>0, 1,0) WHERE item_stock.product_id = '$product_id' AND item_stock.product_id = status_stock.product_id [/sourcecode] where $new_quantity contains the product quantity sent by our ERP system and $product_id is the…
Read More

Improve search result function magento

Magento
Magento default seek capacity is really exceptional, yet in the event that you need to enhance with additional clear and relevant effect then need to taking after progressions. Magento will sort on a rising request. In different statements, the most applicable items will be at the base. We need plunging request, in different statements, the best comes about at the top. We are set to change it by pointing out the diving sort request in the template record. Search for the form.mini.phtml document, and in the event that its not in your topic's template/catalogsearch envelope, include it. [sourcecode language="plain"] <input type="hidden" name="order" value="relevance" /> <input type="hidden" name="dir" value="desc" /> [/sourcecode] This changes the search so that our most relevant results show first. Make a copy of app/code/core/Mage/CatalogSearch/Model/resource/Fulltext.php And place it…
Read More