sumnima sumnima sumnima sumnima sumnima sumnima sumnima
Categories
blog ecommerce Storefront WooCommerce wordpress

WooCommerce Storefront Child Theme: Remove Sidebar @ Single Product Page

Hide the sidebar on product pages of Woocommerce Storefront child theme. The following snippet disables the sidebar with no additional CSS required, whilst still making the product page content area 100% wide.

/** * Disable sidebar on product pages in Storefront. * * @param bool $is_active_sidebar * @param int|string $index * * @return bool */ function product_remove_sidebar( $is_active_sidebar, $index ) { if( $index !== "sidebar-1" ) { return $is_active_sidebar; } if( ! is_product() ) { return $is_active_sidebar; } return false; } add_filter( 'is_active_sidebar', product_remove_sidebar', 10, 2 );

code to the functions.php file in your Storefront child theme.

Categories
blog mongo

mongo

#mongo #bookmark

To reset database. Go to server terminal, then type these commands by order:

sudo docker exec -it mongodb bash mongo show dbs use your-db-name db.dropDatabase()

After typing those, go back to your deployment folder then enter “mupx restart”

Categories
blog conf Meteor Nginx

nginx conf meteor

# this section is needed to proxy web-socket connections

map $http_upgrade $connection_upgrade {

        default upgrade;

        ''      close;

}

# HTTP

server {

        listen 80;

		server_name classified.officialstupid.com;

location = /favicon.ico {

access_log off;
}

# pass requests to Meteor
location / {
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; #for websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
Categories
blog haiku poem

macbook overheating – winter

Blowing hot memories –
Macbooks,
Freezing finger.

#haiku #nahaiwrimo #macbook #overheating #winter #memories

Categories
blog haiku poem

Death haiku

Death –
Final Truth
Stop blaming other.

2016 – 2018 A D

#haiku #mouse #macOS #Logitech

Categories
blog haiku poem

cold moon wet firewood.

#haiku #micropoetry #1line

Categories
blog js

add body class based on the url using RegEx

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



https://gist.github.com/mware/4118884

Categories
blog shopify

shopify supply scss media

#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)

Categories
bigcommerce blog

node.js, npm, bigcommerce, Stencil CLI, cornerstone… bla bla bla !!!

 

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

 

Installing the Command-Line Interface

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

Adding a Base Theme

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

 

Categories
blog cms multisite Nginx wordpress

wordpress multisite too many server redirects nginx conf

too many server redirects.
 
#wordpress #multisite #wordpressmultisite .conf #nginx #bookmark
 
 
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; }
}
Categories
blog ecommerce magento magento 2

Importing product with images in Magento 2

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

enter image description here

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

Categories
blog magento 2

Add custom block on listing page : Magento2

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 ?

jmtbt

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

 

Categories
blog ecommerce magento magento 2

Updating/Upgrading to Magento 2.0.6 (via composer)

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
Categories
blog ecommerce magento magento 2 Theme

Magento 2 – Keep Product Image Aspect Ratio

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; ?>" />
Categories
blog ecommerce magento magento 2

Moving Product Tabs – Magento 2

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"/>
Categories
blog magento magento 2 SSH

php -f bin/magento setup:upgrade

php -f bin/magento setup:upgrade
Categories
blog Linux Nginx SSH ubuntu

nginx shutdown terminal ssh

sudo shutdown -h now
Categories
blog Nginx

nginx 80 port restart

sudo fuser -k 80/tcp ; sudo /etc/init.d/nginx restart
Categories
blog Let's Encrypt Nginx SSH SSL ubuntu

Quick Secure Nginx with Let’s Encrypt on Ubuntu 14.04

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
Categories
blog browser google chrome

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.