Giter Site home page Giter Site logo

magerun-addons's Introduction

MageRun Addons

Some additional commands for the excellent N98-MageRun Magento command-line tool.

The purpose of this project is just to have an easy way to deploy new, custom commands that I need to use in various places. It's easier for me to do this than to maintain a fork of n98-magerun, but I'd be happy to merge any of these commands into the main n98-magerun project if desired.

Installation

There are a few options. You can check out the different options in the MageRun docs.

Here's the easiest:

  1. Create ~/.n98-magerun/modules/ if it doesn't already exist.

     mkdir -p ~/.n98-magerun/modules/
    
  2. Clone the magerun-addons repository in there

     cd ~/.n98-magerun/modules/
     git clone [email protected]:kalenjordan/magerun-addons.git
    
  3. It should be installed. To see that it was installed, check to see if one of the new commands is in there, like diff:files.

     mr diff:files
    

Commands

Bust Frontend Browser Caches

This command modifies the skin and js base URLs with a timestamp-specific URL, so that browsers will pull down fresh CSS and JS.

$ mr design:refresh

It's intended to be used in conjunction with a web server rewrite rule that will rewrite, for example:

/<timestamp>/skin/...

to

/skin/...

Note: I should mention that the URL parsing to generate the URLs needs work. It supports either a URL ending in .com or a URL relative to the base (.e.g. {{base_url}}skin).

Create dummy order

This is very experimental and has some defaults in it such as the default billing address for a customer that aren't very international-friendly.

$ mr order:create:dummy [--customer="..."] [--product="..."] [--store="..."] [--shipping="..."] count

Unless specified it picks a random customer, random product, and a random order creation date up to two years ago from the present time, and creates a defined number of orders order for a selected store.

The product can be specified either explicitly by providing a SKU or from a range of SKUs by using a wildcard (e.g. --product="2456%").

Due to obvious reasons not all shipping methods are supported. Currently you can specify either flatrate_flatrate or tablerate_bestway. If no shipping method is specified flatrate_flatrate will be used by default.

Assign order to new customer

Assign an order to a new customer by ID.

This is very experimental - doesn't modify all of the places that customer data exists on the order models, such as the shipping and billing address - just the customer name, email, ID on the order entity.

$ mr order:assign 10000000001 10

Assigns the order #10000000001 to customer ID 10.

Anonymize customer data

Anonymize customer email addresses across a bunch of tables: order, order address, newsletter, quotes, newsletter subscriber.

$ mr customer:anon

Core file diff

Diff core files to see if they've been modified

$ mr diff:files

This just does a simple diff against a fresh copy of the Magento version's code base. Need to add support for it to understand overrides such as a file in app/code/local or lib/.

Theme diff

Diff theme files to see what has been modified.

$ mr diff:theme customtheme/default default/default

See what customizations have been made in your custom theme against the base theme.

Summary screenshot: Image

Details screenshot: Image

Grab mailchimp unsubscribes

Grab all of the mailchimp unsubscribes to your primary list

$ mr mailchimp:unsubscribe:list

If you're using Ebizmarts_MageMonkey to manage your Mailchimp integration, this will allow you to grab a list of all of the unsubscribed emails to your primary list.

The main purpose for doing this is if you need to import these unsubscribes somewhere. The routine will dispatch an event mailchimp_list_unsubscribe_discovered which you can observe in order to handle them.

Uninstall a module

Uninstall a module by deleting all the module's files and removing database tables.

$ mr dev:module:remove Aitoc_*

NOTE: This is not fully baked yet, at the moment it just deletes the main module config file and the code directory. Pretty trivial, but I'm going to add in database tables, layout files, template files, etc.

Oh and wildcards aren't supported in the module name yet either, but I just had to do that as an example :)

Generate gift card codes

The missing tool to generate EE gift card codes!

$ mr giftcard:generate-codes --prefix=SWEET-DISCOUNTS-

magerun-addons's People

Contributors

bobbyshaw avatar cmuench avatar kalenjordan avatar schmengler avatar schrank avatar tim-bezhashvyly avatar versedi avatar wsheldon avatar zainengineer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magerun-addons's Issues

Random time

It seems that your algorithm doesn't create the random time for order creation. It just random the day, but the hour is a fixed number.
I suggest that in the function createAt .... you rand the time instead of the day, so it can random the time for us to use.
I'm currently work on a project that need this feature so much. By the way, thank you for you contribution.,
Wish you all the best.

PHP 7 compatibility

The following issue has been found in src/KJ/Magento/Util/Comparison/Filter/Null.php:

'null' is a reserved keyword as of PHP version 7.0 and should not be used to name a class, interface or trait or as part of a namespace

Add ccsave

I've added a hardcoded ccsave to the setupPaymentMethod. Could be vastly improved upon but is a good start for generallizing of some the payment methods. I was trying to get auth.net to work, but there is a second POST somewhere that does not have the credit card info and fails to create the order.

protected function setupPaymentMethod()
{
$quotePayment = $this->getQuote()->getPayment();

    if ($paymentInput = $this->_input->getOption('payment')) {

        if($paymentInput == "ccsave")
        {
            $data = array(
                    'method' => 'ccsave',
                    'cc_type' => 'MC',
                    'cc_number' => '5424000000000015',
                    'cc_exp_month' => '12',
                    'cc_exp_year' => (date('Y') + 6),
                    'cc_cid' => '444'
            );

            $quotePayment->importData($data); 

            \Mage::app()->getRequest()->setPost("payment", $data);
        }

        elseif ($ccTokenInput = $this->_input->getOption('cc_token')) {
            \Mage::app()->getRequest()->setPost('payment', array(  //works for Braintree
                'method' => $paymentInput,
                'cc_token' => $ccTokenInput
            ));
        }
    } else {
        $quotePayment->setMethod('checkmo');
    }

    $this->getQuote()->setPayment($quotePayment);

    return $this;

}

mr command not found

When we run mr commands, it show an error that mr: command not found.
How would be install it?
We have not found any "diff" option in when is run
php n98-magerun.phar list

No LICENSE file.

Hi,

We wish to use this project, but as it doesn't have any sort of license we are unable to, can you clarify the licensing terms, i.e. MIT, Apache2, etc?

Thanks

order:create:dummy - Error in EE 1.13.0.2

Hi,

i got this exception:

1. Using customer: Test Private ([email protected])
Using product: The Only Children: Paisley T-Shirt (56)
Using created_at date: 2013-07-10
Problem creating order: Error: Please specify the product's option(s).
2. Using customer: Test Member ([email protected])
Using product: Black Leather Pants (27)
Using created_at date: 2012-11-08
PHP Fatal error:  Call to a member function hasEmail() on a non-object in /home/cmuench/Workspaces/PHP/n98/magento/ee-1.13.0.2/app/code/core/Mage/Sales/Model/Quote/Address.php on line 364
PHP Stack trace:
PHP   1. {main}() /home/cmuench/bin/n98-magerun.phar:0
PHP   2. N98\Magento\Application->run() /home/cmuench/bin/n98-magerun.phar:8
PHP   3. Symfony\Component\Console\Application->run() phar:///home/cmuench/bin/n98-magerun.phar/src/N98/Magento/Application.php:513
PHP   4. N98\Magento\Application->doRun() phar:///home/cmuench/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:121
PHP   5. Symfony\Component\Console\Application->doRun() phar:///home/cmuench/bin/n98-magerun.phar/src/N98/Magento/Application.php:467
PHP   6. Symfony\Component\Console\Application->doRunCommand() phar:///home/cmuench/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:191
PHP   7. N98\Magento\Command\AbstractMagentoCommand->run() phar:///home/cmuench/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:904
PHP   8. Symfony\Component\Console\Command\Command->run() phar:///home/cmuench/bin/n98-magerun.phar/src/N98/Magento/Command/AbstractMagentoCommand.php:353
PHP   9. KJ\Magento\Command\Order\Create\DummyCommand->execute() phar:///home/cmuench/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
PHP  10. KJ\Magento\Command\Order\Create\DummyCommand->_createOrder() /home/cmuench/.n98-magerun/modules/kalenjordan-magerun-addons/src/KJ/Magento/Command/Order/Create/DummyCommand.php:47
PHP  11. KJ\Magento\Command\Order\Create\DummyCommand->createOrderFromQuote() /home/cmuench/.n98-magerun/modules/kalenjordan-magerun-addons/src/KJ/Magento/Command/Order/Create/DummyCommand.php:78
PHP  12. KJ\Magento\Command\Order\Create\DummyCommand->setupShippingAddress() /home/cmuench/.n98-magerun/modules/kalenjordan-magerun-addons/src/KJ/Magento/Command/Order/Create/DummyCommand.php:146
PHP  13. Mage_Sales_Model_Quote_Address->importCustomerAddress() /home/cmuench/.n98-magerun/modules/kalenjordan-magerun-addons/src/KJ/Magento/Command/Order/Create/DummyCommand.php:250

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.