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
// Common | |
// (for styles used in both mobile and desktop views) | |
& when (@media-common = true) {} | |
// Mobile | |
// (for all mobile styles.) | |
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {} | |
// Tablet | |
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {} |
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
// get current store and product store to restore values after save | |
$currentStore = $this->storeManager->getStore(); | |
$productStore = $product->getStoreId(); | |
// save to desired storeId | |
$this->storeManager->setCurrentStore($storeId); | |
$product->setStoreId($storeId); | |
// you can use also $product->setName ... | |
$product->setData($attributeCode, $value); | |
$this->productResource->saveAttribute($product, $attributeCode); |
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 | |
namespace Chapagain\HelloWorld\Block; | |
class HelloWorld extends \Magento\Framework\View\Element\Template | |
{ | |
public function __construct( | |
\Magento\Backend\Block\Template\Context $context, | |
array $data = [] | |
) | |
{ | |
parent::__construct($context, $data); |
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
array_map('trim', explode(',', $str)); |
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
<template name="magento2:__" value="<?php echo __('$SELECTION$'); ?>" description="Translation" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:collection" value="class Collection extends AbstractCollection { /** * Initialize resource model * * @return void */ protected function _construct() { $this->_init($model$::class, $resourceModel$::class); } }" toReformat="true" toShortenFQNames="true"> | |
<variable name="model" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="resourceModel" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> |
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 admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'admin'; | |
-- REST Customer & Admin password | |
SET @pass = '123123q'; -- pone el pass q mas te guste | |
SET @salt = MD5(UNIX_TIMESTAMP()); | |
UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, @pass), 256), ':', @salt, ':1'); | |
UPDATE customer_entity SET password_hash= CONCAT(SHA2(CONCAT(@salt, @pass), 256), ':', @salt, ':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
update core_config_data set value = 0 where path = 'web/secure/use_in_frontend'; | |
update core_config_data set value = 0 where path = 'web/secure/use_in_adminhtml'; |
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 core_config_data SET value='___YOUR_NEW_URL____' WHERE path LIKE '%base_url%'; |
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
SET foreign_key_checks = 0; | |
SET foreign_key_checks = 1; | |
# GLOBAL DISABLE | |
SET GLOBAL FOREIGN_KEY_CHECKS=0; | |
SET GLOBAL FOREIGN_KEY_CHECKS=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
UPDATE `customer_entity` | |
SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1') | |
WHERE `entity_id` = 1; | |
-- REST Customer & Admin password | |
SET @pass = '123123q'; -- pone el pass q mas te guste | |
SET @salt = MD5(UNIX_TIMESTAMP()); | |
UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, @pass), 256), ':', @salt, ':1'); | |
UPDATE customer_entity SET password_hash= CONCAT(SHA2(CONCAT(@salt, @pass), 256), ':', @salt, ':1'); |