Skip to content

victorandeloci/useful_magento_scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

useful_magento_scripts

Useful scripts to import/export/assign things in Magento

About

I've used and tested this in Magento 1.9. Take care.

I've not created all of this just by myself. These scripts were created based on old scripts provided by rafaldimas and questions, like following:

Usage

Alter order status with comment

  1. Put your order ids in the respective array:
$ordersIds = array(
    '1',
    '2',
);
  1. Then, add the status slug and comment:
$order->addStatusToHistory('complete_shipped', 'Status comment');
  1. Access YOUR_SITE.XYZ/alter-status-add-comment.php

Update SKU (Old SKU to new SKU) by import

  1. Use the sku2sku.csv model.
  • First column for your old SKUs
  • Second column for your new SKUs
  1. Upload the .csv file to /var/export directory

  2. Upload the script file updateskus.php to your root directory

  3. Access YOUR_SITE.XYZ/updateskus.php

Assign category ids to product mass

  1. Use the category_assign.csv model.
  • First column for your SKUs
  1. Upload the .csv file to /var/export directory

  2. Upload the script file category_assign.php to your root directory

  3. Put the category ids in the respective array in category_assign.php:

$categories = array(2, 136, 470);
  1. Access YOUR_SITE.XYZ/category_assign.php

Assign Websites ids to product mass

  1. Use the website_assign.csv model.
  • First column for your SKUs
  1. Upload the .csv file to /var/export directory

  2. Upload the script file website_assign.php to your root directory

  3. Put the website ids in the respective array in website_assign.php:

$websites = array(1, 2);
  1. Access YOUR_SITE.XYZ/website_assign.php

Get payment methods codes from store

  1. Change the $storeId in get_payment_methods_codes.php tou YOUR store id:
$storeId = 1;
  1. Upload the script file get_payment_methods_codes.php to your root directory

  2. Access YOUR_SITE.XYZ/get_payment_methods_codes.php

Disable products by SKU in ALL store views

  1. Use the disable_products_by_sku.csv model.
  • First column for your SKUs
  1. Upload the .csv file to /var/export directory

  2. Upload the script file disable_products_by_sku.php to your root directory

  3. Access YOUR_SITE.XYZ/disable_products_by_sku.php

Set attribute value by attributte name for ALL PRODUCTS

  1. Use the set_attributes.csv model.
  • First column for your attribute names
  • Second column form their values
  1. Upload the .csv file to /var/export directory

  2. Upload the script file set_attributes.php to your root directory

  3. Access YOUR_SITE.XYZ/set_attributes.php

Change status of orders between dates

  1. Upload the script file update_orders_status.php to your root directory

  2. Set your date interval:

$from = new DateTime('2020-01-01 00:00:00');
$from = $from->format('Y-m-d H:i:s');

$to = new DateTime('2020-12-22 23:59:9');
$to = $to->format('Y-m-d H:i:s');
  1. Define your current order status for search:
->addFieldToFilter('status', 'complete_shipped')
  1. Define the final status:
$order->addStatusToHistory('complete', 'Status manually updated on ' . date("d - m - Y") . '.');
  1. Access YOUR_SITE.XYZ/update_orders_status.php

About

Useful scripts to import/export/assign things in Magento

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages