How to remove sign in popup from Magento 2 checkout page?

Magento2 has this authentication pop up on checkout page, which many store owners wont like to see on their checkout page.

Background of this pop up area and Related files

The pop up itself is generated by Magento_Customer::account/authentication-popup.phtml

But this pop up works very differently on checkout page. In fact this is a separate pop up than the one you see in header area. It is embedded in a series of js files which are governed by knockout-js

Other file responsible is: vendor/magento/module-checkout/view/frontend/web/js/proceed-to-checkout.js

Here is how to remove it finally

Edit file or overload the file

app/design/frontend/YourVendor/YourTheme/Magento_Checkout/web/template/onepage.html

delete the following lines and save the file

<!-- ko foreach: getRegion('authentication') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->

Reference:

https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/template/onepage.html

https://github.com/magento/magento2/blob/fc66fe443d87c4e69fe9022d7c95fe66e0565978/app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml#L39

How to show correct item count in Magento 2 Checkout Order summary?

By default, app/design/Magento/Checkout/view/frontend/web/template/summary/cart-items.html file is being used
Or vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html

To overload this file, create file cart-items.html in your theme folder. Make sure you place the file in Magento_Checkout/web/template/summary/

Edit the line

<span data-bind="text: getCartLineItemsCount()"></span>

And replace it with

<span data-bind="text: getItemsQty()"></span>

Reference Files:

vendor/magento/module-checkout/view/frontend/web/js/view/summary/cart-items.js

https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html

https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js

How to dump all options for any attribute in Magento 2 programmatically?

The following code does not adhere to Magento’s developer recommendations. Using object manager in such a way externally is a TERRIBLE idea.

Comment out line number 2 and then run the script. Edit line 11 and put the attribute code you want to dump

<?php
header("Location: /");exit;
use \Magento\Framework\App\Bootstrap;
error_reporting(E_ALL);
ini_set("display_errors", 1);
include('./app/bootstrap.php');
$bootstrap     = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();

$eavConfig = $objectManager->get('\Magento\Eav\Model\Config');
$attribute = $eavConfig->getAttribute('catalog_product', 'manufacturer');
$options   = $attribute->getSource()->getAllOptions();
$options   = array_slice($options, 1);
usort($options, function($a, $b)
{
    return strcasecmp($a['label'], $b['label']);
});
if (count($options))
    $v = "<table>";
foreach ($options as $option) {
    $v .= "<tr><td>" . $option['value'] . '</td><td>' . $option['label'] . '</td></tr>';
}
if (count($options))
    $v .= "</table>";
echo $v;
?>
   <style>
    table tr:nth-child(odd){background:#444;color:#fff}
   </style>

How to remove files with “No Content Changes Found” in Git Desktop

There are 3 possible ways git can find a file changed (even if you didn’t change it)

  1. Line Endings have changed
  2. File permissions have changed
  3. Bonus: if modification time has changed

for first case try these settings in bash shell. One of these will fix it for you

$ git config core.eol
$ git config core.autocrlf
$ git config core.safecrlf

For second case, here is the flag

git config core.filemode false

Bonus One: If Modification time was changed

If your working tree has files with updated “last modification time” and you see a huge list of files with “no content changes found”, try this:

git add .
 // ^ dont use . [DOT] if you want to fix for particular sub-folder

You can do git add for all affected files, after that it stops displaying them as modified in git status (and doesn’t actually stage them for commit if there are no changes).

References: https://stackoverflow.com/a/37221298/2229148

Mouse and Keyboard sharing across Computers

We use multiple computers in workspace or in home. Often need to share same mouse and keyboard for all because you probably have a wireless/wired keyboard mouse set. here arises the issue that how to share same set of input controllers for both machines.

Below are a few free and paid options for you to choose from. They all work as expected when computers are connected via LAN or WiFi

  1. Mouse without Borders
  2. Barrier
  3. ShareMouse
  4. Synergy

Microsoft Garage Mouse without Borders

This is all time classic program to share clipboard, mouse movements and what not. For windows to windows mouse sharing this is the best.

It is FREE too

Barrier

This is best alternative in FREE category. It supports MAC OS and Windows both. so this is the one you should go with if you dont have just windows machines.

Sharemouse

This is a good one for cross OSs. It supports both windows and apple mac. Free version is okayish. Can get a bit buggy if you are using a HDMI switch for same monitor mirroring. But still gets the job done.

If you got some bucks to spare, use the paid version which has more features

Synergy

Synergy is the best paid software for this purpose. HANDS DOWN

Supports MAC, Windows and Linux just like the others but provides you support (because you have paid)