This file contains 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
We should take a look `\Magento\Framework\App\RouterList` |
This file contains 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
1) Using an expression as a join: new Zend_Db_Expr | |
$query = 'SELECT author_id, SUM(amount) AS author_debit_amount FROM author_debits GROUP BY author_debits.author_id'; | |
$collection->getSelect()->joinLeft( | |
new Zend_Db_Expr('('.$query.')'), | |
'main_table.author_id = t.author_id', | |
array('author_debit_amount') | |
); |
This file contains 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 | |
namespace Some\Module\Plugin; | |
use Magento\Catalog\Api\ProductRepositoryInterface; | |
use Magento\Framework\View\Result\Page; | |
class ProductLayout | |
{ |
This file contains 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
For example: | |
require(["jquery","mage/translate"], function($){ | |
$.mage.translate.add({"Filters":"Filters","Processing":"Processing","per page":"per page","records":"records"}) | |
}); |
This file contains 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
//Orders, Invoices, Shipments | |
DELETE FROM sales_order; | |
DELETE FROM sales_creditmemo_comment; | |
DELETE FROM sales_creditmemo_item; | |
DELETE FROM sales_creditmemo; | |
DELETE FROM sales_creditmemo_grid; | |
DELETE FROM sales_invoice_comment; | |
DELETE FROM sales_invoice_item; | |
DELETE FROM sales_invoice; |
This file contains 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 | |
$userData = ["username" => "[email protected]", "password" => "123456"]; | |
$ch = curl_init("http://magen2.loc/rest/V1/integration/customer/token"); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData)); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Content-Lenght: " . strlen(json_encode($userData)))); | |
$token = curl_exec($ch); |
This file contains 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 | |
class ApiClient | |
{ | |
const METHOD_GET = 'GET'; | |
const METHOD_PUT = 'PUT'; | |
const METHOD_POST = 'POST'; | |
const METHOD_DELETE = 'DELETE'; | |
protected $validMethods = [ | |
self::METHOD_GET, | |
self::METHOD_PUT, |
This file contains 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
$attributeData = [ | |
"attribute": [ | |
"is_wysiwyg_enabled": true, | |
"is_html_allowed_on_front": true, | |
"used_for_sort_by": true, | |
"is_filterable": true, | |
"is_filterable_in_search": true, | |
"is_used_in_grid": true, | |
"is_visible_in_grid": true, | |
"is_filterable_in_grid": true, |
This file contains 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
//put under pub/test.php | |
<?php | |
require dirname(__FILE__) . '/../app/bootstrap.php'; | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
/** @var \Magento\Framework\App\Http $app */ | |
$app = $bootstrap->createApplication('TestApp'); |