Skip to main content

Posts

Showing posts from June, 2015

Magento create custome options for all products using programatically

For this we can update custome options programaticallyfor alla products at a time :) <?php require_once 'app/Mage.php'; umask(0); Mage::app('admin'); $option = array(     'title' => 'custom option title',     'type' => 'drop_down', // could be drop_down ,checkbox , multiple     'is_require' => 1,     'sort_order' => 0,     'values' => getOptions() ); $collection = Mage::getModel('catalog/product'); $product_id = $collection->getIdBySku('Ac-43SS'); $product = $collection->load($product_id); $product->setProductOptions(array($option)); $product->setCanSaveCustomOptions(true); $product->save(); echo $sku; function getOptions() {     return array(         array(             'title' => 'Ship It',             'price' => 0,             'price_type' => 'fixed',             'sku' => $sku,

Total orders delete from database

SET FOREIGN_KEY_CHECKS = 0 ; ############################## # SALES RELATED TABLES ############################## TRUNCATE ` sales_flat_creditmemo `; TRUNCATE ` sales_flat_creditmemo_comment `; TRUNCATE ` sales_flat_creditmemo_grid `; TRUNCATE ` sales_flat_creditmemo_item `; TRUNCATE ` sales_flat_invoice `; TRUNCATE ` sales_flat_invoice_comment `; TRUNCATE ` sales_flat_invoice_grid `; TRUNCATE ` sales_flat_invoice_item `; TRUNCATE ` sales_flat_order `; TRUNCATE ` sales_flat_order_address `; TRUNCATE ` sales_flat_order_grid `; TRUNCATE ` sales_flat_order_item `; TRUNCATE ` sales_flat_order_payment `; TRUNCATE ` sales_flat_order_status_history `; TRUNCATE ` sales_flat_quote `; TRUNCATE ` sales_flat_quote_address `; TRUNCATE ` sales_flat_quote_address_item `; TRUNCATE ` sales_flat_quote_item `; TRUNCATE ` sales_flat_quote_item_option `; TRUNCATE ` sales_flat_quote_payment `; TRUNCATE ` sales_flat_quote_shipping_rate `; TRUNCATE ` sales_fla