Day: January 22, 2016

Magento: 自动生成产品SKU Auto generated SKU when add product in magento

方法一: Open /app/design/adminhtml/default/default/template/catalog/product/edit.phtml and add the following code to the bottom of the file: <?php $dbread = Mage::getSingleton('core/resource')->getConnection('core_read'); $sql = $dbread->query("SELECT * FROM catalog_product_entity ORDER BY created_at DESC LIMIT 1"); $res = $… Read More

Magento: 设置category类别为必填 How to make product category selection required

You can rewrite the method Mage_Adminhtml_Catalog_ProductController::validateAction() and check if the product is new and category_ids hasn’t been sent through POST then throw an exception. Something like this: app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php public function validateAction() { $response… Read More