/* add body class */
var loc = window.location.pathname.match(/^\/?(\w+)\b/);
if(loc) $(document.body).addClass(loc[1].toLowerCase());







/* add body class */
var loc = window.location.pathname.match(/^\/?(\w+)\b/);
if(loc) $(document.body).addClass(loc[1].toLowerCase());
#bookmark #shopify #scss #supply
desktop only – @include at-query ($min, $medium)
tablet and mobile – @include at-query ($max, $medium)
mobile only – @include at-query($max, $small)
pain free NODE.js https://gist.github.com/isaacs/579814
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc . ~/.bashrc mkdir ~/local mkdir ~/node-latest-install cd ~/node-latest-install curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 ./configure --prefix=~/local make install # ok, fine, this step probably takes more than 30 seconds... curl -O -L https://npmjs.org/install.sh
The first step toward developing on Stencil is to install the Stencil CLI (command-line interface). You can do this via the following command:
npm install -g @bigcommerce/stencil-cli
git clone https://github.com/bigcommerce/cornerstone.git
after download complete cd cornerstone then run
npm install
stencil init
at the top level of your Stencil Theme. It will ask you a few questions to get your started.
stencil start
to run a local server so you can start developing your theme.
stencil bundle
to validate your code and create a zip bundle file that can be uploaded to BigCommerce.
https://github.com/bigcommerce/stencil-cli/issues/311
upgrade you cli
npm i -g @bigcommerce/stencil-cli
server {
server_name example.com *.example.com ;
Â
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
Â
root /var/www/example.com/htdocs;
index index.php;
Â
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}
Â
location / {
try_files $uri $uri/ /index.php?$args ;
}
Â
location ~ \.php$ {
try_files $uri /index.php;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
Â
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}
Â
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { deny all; access_log off; log_not_found off; }
}
Add new Product if no existing product is there in existing Magento store.
Go to System > Data Transfer > Export
Select entity type as product and click on on continue button that is in the bottom of the page. Once you click on continue button you can download the csv file of exported products . Use the exported sheet for reference to fill the values and then fill yours values accordingly , fill image name with file extension as .jpg or .png etc as mentioned in this screenshot:
then go to var folder create one folder having name ( import ) and place the image having same name as mentioned in the import csv file and then
Go to System > Data Transfer > Import
and select entity type as an product select import behavior as per yours need and then browse for file from Select File to Import browse option after this enter the path of import folder in our case it is var/import in the Images File Directory text box as mentioned in the following screenshot :
Then click on check data button on top right corner. If you did everything correct you will get this screen
Click import button and then do reindexing using CMD:
php bin/magento indexer:reindex
and then flush the cache:
php bin/magento cache:flush
and then check yours frontend it will show imported products with images.
http://magento.stackexchange.com/questions/85292/have-any-idea-how-can-create-or-import-product-in-magento-2?rq=1
I want to add my custom block on listing page[Magento-2] but without any modification on list.phtml
or any .phtml
file. Is there any possibility by using xml
file ?
You can do that if you create new module to override this block: vendor\magento\module-catalog\Block\Product\ListProduct.php
to override this block, you need to create di.xml
at app\code\Vendor\Module_Name\etc
di.xml
content:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Block\Product\ListProduct" type="Vendor\Module_Name\Block\Product\ListProduct" />
</config>
Create new file name ListProduct.php
at app\code\Vendor\Module_Name\Block\Product
ListProduct.php
content:
namespace Vendor\Module_Name\Block\Product;
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
{
public function getProductDetailsHtml(\Magento\Catalog\Model\Product $product)
{
$html = $this->getLayout()->createBlock('Magento\Framework\View\Element\Template')->setProduct($product)->setTemplate('Vendor_ModuleName::test.phtml')->toHtml();
$renderer = $this->getDetailsRenderer($product->getTypeId());
if ($renderer) {
$renderer->setProduct($product);
return $html.$renderer->toHtml();
}
return '';
}
}
You can change block Magento\Framework\View\Element\Template
to your block
create test.phtml
file at app\code\Vendor\Module_Name\view\frontend\templates
Updating/Upgrading to Magento 2.0.6 (via composer
)
composer require magento/product-community-edition 2.0.6 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
Magento_Catalog/templates/product/list.phtml
<?php //$image = 'category_page_grid' or 'category_page_list'; $_imagehelper = $this->helper('Magento\Catalog\Helper\Image'); $productImage = $_imagehelper->init($_product, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(400)->getUrl(); ?> <img src="<?php echo $productImage; ?>" />
app/design/frontend/Vendor/theme_name/Magento_Catalog/page_layout/catalog_product_view.xml
<move element="product.info.details" destination="product.info.main" after="product_options_wrapper_bottom"/>
php -f bin/magento setup:upgrade
sudo shutdown -h now