Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/
./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent
| # HAProxy config | |
| mkdir /etc/haproxy | |
| cat > /etc/haproxy/haproxy.cfg << EOF | |
| global | |
| maxconn 4096 | |
| defaults | |
| mode http | |
| level street_address | |
| city 3ème Arrondissement Paris | |
| state Île-de-France | |
| sw_lat 48.86710531970849 | |
| parent_hash[city] 3rd arrondissement of Paris | |
| accuracy 8 | |
| sw_lng 2.354801119708498 | |
| parent_hash[accuracy] 5 | |
| parent_hash[ne_lat] 48.8711592 | |
| parent_hash[sw_lat] 48.8564786 |
| <?php | |
| require_once 'app/Mage.php'; | |
| Mage::app('default'); | |
| $productIds = array(100, 101, 102); | |
| $option = array( | |
| 'title' => 'Test Option', | |
| 'type' => 'file', | |
| 'is_require' => 1, |
| <?php | |
| //STEP 1: Save the below file as Cron_Import.php on the Magento base folder. | |
| //STEP 3: Test this on your SSH login to check if this works on command line. Use the below command | |
| //wget -T0 -t1 -O - http://<www.example.com>/Cron_Import.php/?files=3XSEEEE.csv | |
| //uncommentwhen moved to server - to ensure this page is not accessed from anywhere else | |
| //if ($_SERVER['REMOTE_ADDR'] !== '<your server ip address') { | |
| // die("You are not a cron job!"); | |
| //} |
| Sample Datapump API integration script example importing single item | |
| // assuming that your script file is located in magmi/integration/scripts/myscript.php, | |
| // include "magmi_defs.php" and "magmi_datapump.php" first (note: there are two folders "inc" in different subfolders). | |
| require_once("../../inc/magmi_defs.php"); | |
| require_once("../inc/magmi_datapump.php"); | |
| // create a Product import Datapump using Magmi_DatapumpFactory |
| function addMediaGalleryAttributeToCollection(Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $_productCollection) { | |
| $_mediaGalleryAttributeId = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'media_gallery')->getAttributeId(); | |
| $_read = Mage::getSingleton('core/resource')->getConnection('catalog_read'); | |
| $_mediaGalleryData = $_read->fetchAll(' | |
| SELECT | |
| main.entity_id, `main`.`value_id`, `main`.`value` AS `file`, | |
| `value`.`label`, `value`.`position`, `value`.`disabled`, `default_value`.`label` AS `label_default`, | |
| `default_value`.`position` AS `position_default`, | |
| `default_value`.`disabled` AS `disabled_default` |
| DELETE FROM catalog_product_bundle_option_value WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_datetime WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_decimal WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_gallery WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_int WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_media_gallery_value WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_text WHERE store_id <> 0; | |
| DELETE FROM catalog_product_entity_varchar WHERE store_id <> 0; | |
| DELETE FROM catalog_product_option_price WHERE store_id <> 0; |
| $id=1; // get Customer Id | |
| $customer = Mage::getModel('customer/customer')->load($id); | |
| $transaction = Mage::getModel('core/resource_transaction'); | |
| $storeId = $customer->getStoreId(); | |
| $reservedOrderId = Mage::getSingleton('eav/config')->getEntityType('order')->fetchNewIncrementId($storeId); | |
| $order = Mage::getModel('sales/order') | |
| ->setIncrementId($reservedOrderId) | |
| ->setStoreId($storeId) |