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
<img src='<?php echo $this->getViewFileUrl('images/footer-logo.png'); ?>' alt="Demo"> | |
<img src="{{view url="images/slide-bg.jpg"}}" alt="test" /> | |
# https://magento.stackexchange.com/questions/93688/add-a-static-image-on-phtml-page-and-cms-blocks-magento2/93697 | |
<img src='<?php echo $this->getViewFileUrl('Company_Module::images/image-icon.png'); ?>' alt="image-icon" width="30" height="25"> |
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 get URL in magento2, you have to first create instance of \Magento\Framework\App\ObjectManager to get current store: | |
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); //instance of\Magento\Framework\App\ObjectManager | |
$storeManager = $_objectManager->get('Magento\Store\Model\StoreManagerInterface'); | |
$currentStore = $storeManager->getStore(); | |
// To get base URL | |
$baseUrl = $currentStore->getBaseUrl(); | |
//Output: https://www.example.com/ |
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
# Steps: | |
# Open a Powershell (Window). | |
# Go to the folder with the cd command (eg.: cd "path of your folder"). | |
# e.g: cd C:\testFolder | |
# then type below command & replace .jpg file format with your file format. | |
# space is replace with underscore | |
# https://www.dropbox.com/s/4n1kdsfrohjt6tr/20200107_screenshot.jpg?dl=0 | |
get-childitem *.jpg | foreach {rename-item $_ $_.name.replace(" ","_")} |
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
# SQL query delele all customers and orders from your Magento 1.* install. | |
# USE AT OWN RISK. ALWAY BACKUP YOUR DATABASE FIRST. | |
-- ----------------------------------------- | |
-- delete all customers and customer logs -- | |
-- ----------------------------------------- | |
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE customer_address_entity; |
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
# first method | |
### This error appears when you remove a template folder, which is still referenced in the database. The simplest way to fix it is, go to the database, and in table 'theme', find the theme name which does not exist in app/design/frontend/package. | |
### DELETE the reference to the missing theme from the table. | |
# Second method | |
### I have the same error Required parameter 'theme_dir' was not passed. I work with 2.1.0 from the beginning, not with updating. And I have one custom product attribute "style". | |
### The problem occurs when I try to save the new photo in the material. Without the image, the product saved normally. | |
### Fix with commenting the exception under the file: | |
### vendor/magento/framework/view/design/Fallbck/Rule/Simple.php | |
### It worked for me. But I think it's a hack. |
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 | |
# Path: \app\design\frontend\packageName\themeName\Magento_Catalog\templates\product\view\attributes.phtml | |
/** | |
* Copyright © Magento, Inc. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
// @codingStandardsIgnoreFile | |
/** | |
* Product additional attributes template | |
* |
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
# app\design\frontend\packagename\default\template\newsletter\ | |
<div style="background:#fff;" class="article right_section_col"> | |
<div class="heading"> | |
<h3><?php echo $this->__('Join Our Newsletter') ?></h3> | |
</div> | |
<form action="<?php echo $this->getUrl('newsletter/subscriber/new') ?>" method="post" id="newsletter_validate_detail_footer2"> | |
<div style="margin-top:17px;" class="search-bar"> | |
<input type="email" placeholder="Please Enter Emali..." maxlength="30" name="email" id="newsletter2" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="sfield" /> | |
<input type="submit" name="search" class="searchbutton" value="Submit" style="padding: 1px 0 0!important;" /> |
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 | |
/** | |
* Copyright © 2015 Magento. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
// @codingStandardsIgnoreFile | |
/** @var $block \Magento\Catalog\Block\Product\View */ | |
?> |
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
# I am exporting MySQL database from xampp through command prompt | |
# First of all, open command prompt. | |
# Import Database :- C:/xampp/mysql/bin/mysql -u root -p databasename < C:/test.sql (sql file name) | |
# Export Database :- C:/xampp/mysql/bin/mysqldump -u root -p databasename > C:/text.sql(sql file name) | |
# goto | |
C:\windows\system32>cd c:/xampp/mysql/bin | |
c:\xampp\mysql\bin>mysqldump -h localhost -u root -p dbname > export.sql | |
NewerOlder