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; }
}Category: blog
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:reindexand then flush the cache:
php bin/magento cache:flushand 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:reindexMagento_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
sudo fuser -k 80/tcp ; sudo /etc/init.d/nginx restart
cd /opt/letsencrypt
./letsencrypt-auto certonly -a webroot --webroot-path=/usr/share/nginx/html -d example.com -d www.example.com
sudo ls -l /etc/letsencrypt/live/your_domain_name
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
sudo ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf
Set Up Auto Renewal
/opt/letsencrypt/letsencrypt-auto renew
Slow Google chrome?
1. Click on Start –> In search box, type cmd –> Then “CMD” will be
displayed in the search –> Now right-click on “CMD” —> Select “Run as administrator”.
2. Now enter this command
netsh winsock reset –> Press Enter.
Restart your PC.
