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 | |
/* Making the change to an Anchor Category activates the Layered Navigation, also known as filtered navigation. If you have multiple Categories this can be a time-consuming task to do manually. The better way is to use the following code to run through and change all Categories to Anchor in just 1 Click. *It is always a good idea before making changes to the database that you first create a database backup. This has become very quick and easy using the Magento Admin. *To make your backup using Magento Admin, navigate to [System] [Tools] [Backups]. *once there select the option Database Backup (don’t worry it doesn’t take long). Now that you are ready, create a new file called category-achor-yes.php and place it in the root of your Magento install (where your index.php file is).*/ | |
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); | |
// Load Up Magento Core | |
define('MAGENTO', realpath('')); | |
require_once(MAGENTO . '/app/Mage.php'); |
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
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
<referenceBlock name="reviews.tab" remove="true" /> | |
<referenceBlock name="product.review.form" remove="true" /> | |
<referenceBlock name="product.info.review" remove="true" /> | |
</body> | |
</page> |
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 | |
// To split the date and time from datetime value | |
$date = strtotime('10/29/2018 10:54:15 PM'); | |
$dat = date('m/d/y', $date); | |
$tme = date('H:m:s A',$date); | |
?> |
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
<!-- To prevent cut copy paste in text field --> | |
<input type="text" onselectstart="return false" onpaste="return false;" onCopy="return false" onCut="return false" onDrag="return false" onDrop="return false" autocomplete=off /> |
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
UPDATE `customer_entity` | |
SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1') // change YOURPASSWORD to your password to reset | |
WHERE `entity_id` = 199 and `email`="[email protected]"; |
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 deployment correct order | |
php bin/magento deploy:mode:set production | |
php bin/magento cache:clean | |
php bin/magento cache:flush | |
php bin/magento setup:upgrade | |
php bin/magento setup:di:compile | |
php bin/magento setup:static-content:deploy | |
## if developer mode is enabled | |
php bin/magento setup:static-content:deploy -f |
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
SET foreign_key_checks = 0; | |
truncate adminnotification_inbox; | |
truncate log_customer; | |
truncate log_quote; | |
truncate log_summary; | |
truncate log_summary_type; | |
truncate log_url; | |
truncate log_url_info; | |
truncate log_visitor; | |
truncate log_visitor_info; |
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
UPDATE `customer_entity_varchar` caev | |
JOIN `customer_entity` ce ON ce.entity_id=caev.entity_id | |
JOIN `eav_attribute` ea ON ea.entity_type_id=ce.entity_type_id AND caev.attribute_id=ea.attribute_id | |
SET caev.value=MD5('admin123') | |
WHERE ea.attribute_code='password_hash'; |
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 | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product'); //get current product | |
echo $product->getId(); | |
echo $product->getName(); | |
?> | |
<?php | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$productid = $this->getRequest()->getParam('id'); |
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
-- Call static block in phtml file | |
<?php $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('static_block_identifier')->toHtml(); ?> | |
-- In xml layout file | |
<block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/test.phtml"/> | |
-- In cms blocks and cms pages | |
{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/test.phtml"}} | |
OlderNewer