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
# ERROR: The directory "/chroot/home/username/domain.com/html/generated/code" cannot be deleted Warning!rmdir(/chroot/home/username/domain.com/html/generated/code): Directory not empty | |
# You need to remove it manually, if it is ubuntu then locate in your magento 2 root directory and run "rm -rf var/generation" and "rm -rf var/cache" command. | |
# Screenshot: https://www.dropbox.com/s/e786vkgpeuzko67/20181230_generated.jpg?dl=0 | |
rm -rf var/generation | |
rm -rf var/cache | |
# and Then try to run below commands in sequence. | |
php bin/magento setup:di:compile | |
php bin/magento setup:upgrade | |
php bin/magento cache:clean |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="author" content="[email protected]"> | |
<title>Equal height Blocks</title> | |
<style type="text/css"> | |
* { | |
box-sizing: border-box; | |
-moz-box-sizing: border-box; |
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 | |
/* When we make custom product attribute in WooCommerce, they are registered as a custom taxonomy. | |
* So we can use WordPress function get_the_terms() to retrieve them. | |
* When register these custom taxonomy, WooCommerce adds a prefix of pa_ to our custom product attribute. | |
* So if we create an attribute called Height, who's slug is 'height', then the custom taxonomy would be 'pa_height'. | |
* Now we are going to retrieve all terms in this attribute (height) of a product. | |
*/ | |
$pa_height = get_the_terms( $product->id, 'pa_height'); | |
if ( ! empty( $pa_height ) && ! is_wp_error( $pa_height ) ) { | |
foreach ( $pa_height as $pa_height_item ) { |
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 | |
/* add below code in wp-config.php file. | |
* | |
*/ ?> | |
<?php define( 'WP_AUTO_UPDATE_CORE', true ); ?> |
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
# not tested | |
RewriteCond %{HTTPS} !=on | |
# This checks to make sure the connection is not already HTTPS | |
RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] | |
# not tested | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / |
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
<img src="<?php echo get_template_directory_uri().'/images/logo.png' ?>" /> | |
<?php echo do_shortcode('[contact-form-7 id="5" title="Footer newsletter"]'); ?> |
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
# Call Media Url in phtml file | |
<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'/wysiwyg/portfolio3.jpg';?>" class="class-name" alt="" /> | |
# Get breadcrumbs | |
<?php echo $this->getChildHtml('breadcrumbs') ?> | |
# Get Skin Url | |
<img src="<?php echo $this->getSkinUrl('images/go_btn.png'); ?>" alt="Image name" class="class-name" width="" height="" /> | |
# Get Static Block |
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 | |
ini_set("memory_limit","10000M"); | |
require_once "app/Mage.php"; | |
umask(0); | |
Mage::app(); | |
$category = Mage::getModel ( 'catalog/category' ); | |
$tree = $category->getTreeModel (); | |
$tree->load(); | |
$ids = $tree->getCollection()->getAllIds(); | |
if ($ids) { |
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 | |
/* There is no widget available for this, but pasting the following code into a CMS page or Static Block will allow you to | |
* put a search block where you want to have it: | |
* You may need to add some CSS to display it to your needs. | |
*/ | |
<form id="search_mini_form_cms" action="{{store url='catalogsearch/result'}}" method="get"> | |
<div class="input-box"> | |
<label for="search_cms">Search:</label> | |
<input id="search_cms" type="search" name="q" value="" class="input-text required-entry" maxlength="128" placeholder="Search entire store here..." autocomplete="off"> | |
<button type="submit" title="Search" class="button search-button"><span><span>Search</span></span></button> |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="author" content="[email protected]"> | |
<title>No Right Clicking Allowed</title> | |
<style type="text/css"> | |
* { | |
box-sizing: border-box; | |
-moz-box-sizing: border-box; |