This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$docker = new \Docker\Docker(); | |
$imageManager = $docker->getImageManager(); | |
$context = new \Docker\Context\Context('/path/to/docker/Dockerfile'); | |
$inputStream = $context->toStream(); | |
$buildStream = $imageManager->build($inputStream, [ | |
't' => "meinimage", | |
'rm' => true, | |
'nocache' => false | |
], ImageManager::FETCH_STREAM); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$productCollection = $objectManager->create("\Magento\Catalog\Model\ResourceModel\Product\Collection"); | |
foreach($productCollection as $product) { | |
$productRepository = $objectManager->create("\Magento\Catalog\Api\ProductRepositoryInterface"); | |
$q = rand(0, 1000); | |
$p = $productRepository->getById($product->getId()); | |
$p->setStatus(($q > 0 ? 1 : 0)); | |
$p->setStockData(array( | |
'qty' => $q, | |
'is_in_stock' => ($q > 0 ? 1 : 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update cataloginventory_stock_status set qty=ceil((RAND()*100)) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"require": { | |
"magento/module-bundle-sample-data": "100.1.*", | |
"magento/module-theme-sample-data": "100.1.*", | |
"magento/module-catalog-sample-data": "100.1.*", | |
"magento/module-customer-sample-data": "100.1.*", | |
"magento/module-cms-sample-data": "100.1.*", | |
"magento/module-widget-sample-data": "100.1.*", | |
"magento/module-catalog-rule-sample-data": "100.1.*", | |
"magento/module-sales-rule-sample-data": "100.1.*", | |
"magento/module-review-sample-data": "100.1.*", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/app/bootstrap.php'; | |
/* $redis = new Credis_Client('redis'); */ | |
$redis = new Credis_Client('localhost'); | |
$i = 0; | |
$json = array(); | |
foreach($redis->keys('*') as $key) { | |
$data = array(); | |
$data['key'] = $key; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
require( | |
['jquery', 'Magento_Customer/js/customer-data', 'domReady!'], | |
function($, customerData){ | |
$(function(){ | |
customerData.get('customer').subscribe(function(customer) { | |
alert("Name is" + customer.fullname); | |
}); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mage::getModel("catalog/product") | |
->loadByAttribute('sku', "XXX") | |
->getData(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$productAttributeRepository = $this->objectManager->get('\Magento\Catalog\Model\Product\Attribute\Repository'); | |
$attr = $productAttributeRepository->get('color'); | |
$attr->setIsFilterableInSearch('0'); | |
$attr->save(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bin/n98-magerun2.phar dev:console | |
>>> $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
=> Magento\Framework\ObjectManager\ObjectManager {#15223} | |
>>> $appState = $objectManager->get("Magento\Framework\App\State") | |
=> Magento\Framework\App\State {#15471} | |
>>> $appState->setAreaCode("frontend") | |
=> null | |
>>> $a = $objectManager->get('Magento\Catalog\Block\Product\ListProduct') | |
=> Magento\Catalog\Block\Product\ListProduct\Interceptor {#16073 | |
+"imageBuilder": Magento\Catalog\Block\Product\ImageBuilder {#16069}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'app/Mage.php'; | |
Mage::app('default'); | |
Mage::app()->setCurrentStore(1); | |
Mage::app()->getTranslator()->init('frontend', true); | |
$_order = Mage::getModel('sales/order')->load($argv[1]); | |
$_order->sendNewOrderEmail(); |