2017 © Pedro Peláez
 

magento2-module magento2-connector

AddShoppers - Magento 2 Module Connector

image

addshoppers/magento2-connector

AddShoppers - Magento 2 Module Connector

  • Monday, September 5, 2016
  • by addshoppers
  • Repository
  • 1 Watchers
  • 0 Stars
  • 428 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Addshoppers_Connector

Addshoppers Connector Magento2 extension, (*1)

Module integrates Addshoppers app with Magento 2, (*2)

Install

  1. Open your command line terminal and go to your Magento 2 root installation directory., (*3)

  2. Run the following commands to install the module:, (*4)

        composer require addshoppers/magento2-connector
        php bin/magento setup:upgrade
    
  3. Clean Magento Cache and enable the extension by going to Magento Admin Panel -> Marketing -> On-site Marketing, (*5)

  4. (Optional) If you want to enable the Social Login feature, go to Admin Panel -> Content -> Blocks and add a New Block with the Identifier "addshoppers_social_login". Copy and paste the following code in the Content field:, (*6)

        

        <script type="text/javascript">// <![CDATA[

        // Init code          
        function init() {
           AddShoppersWidget.API.Event.bind("sign_in", createAccount);    
        };
        // Create Account 
        function createAccount(params) {  
           if (params.source == "social_login") {       
            services = ['facebook', 'google', 'linkedin', 'twitter', 'paypal'];
            var data = AddShoppersWidget.API.User.signed_data(); 
            for( var i=0; i < services.length; i++ ) {        
              service = services[i];
              if (AddShoppersWidget.API.User.signed(service)) {
                    var email = data[service + '_email'];
                    if (service == 'twitter') {
                        //alert('popup get email'); 
                        var email = prompt("Please enter your email", "");
                    };
                    if (email) {
                        if (service !='twitter' ) {          
                          var name = data[service + '_firstname'] + '_' + data[service + '_lastname']; 
                        } else {
                        var name = data[service + '_name']; 
                        };
                    name = name.replace(/ /g, '­-');
                        var loc = "{{config path='web/unsecure/base_url'}}social_login/?asusrnm=" + name + "&aseml=" + email + "&data=" + JSON.stringify(data);
                      document.getElementById("createme").src = loc;
                      break; 
                    };
                }; 
              };  
            };        
        }

        // Bind events
        if (window.addEventListener) {      
           window.addEventListener("load", init, false); 
        } else {
           document.onreadystatechange = function() { 
            if(document.readyState in {loaded: 1, complete: 1}) {
          document.onreadystatechange = null; 
               init();      
            } 
          }         
        } 
        </script>

        <p><iframe id="createme" src="about:blank" frameborder="0" scrolling="no" width="0" height="0"></iframe></p>

        <div style="text-align: center;">
        <!-- Put your Social Shopper Login button code here. Facebook is already included for this example. -->

        <!-- Facebook -->
        <div class="social-commerce-signin-facebook" data-style="logoandtext" data-size="small">&nbsp;</div>
        <!-- Paypal -->
        <div class="social-commerce-signin-paypal" data-style="logoandtext" data-size="small">&nbsp;</div>
        <!--LinkedIn -->
        <div class="social-commerce-signin-linkedin" data-style="logoandtext" data-size="small">&nbsp;</div>
        <!-- Google -->
        <div class="social-commerce-signin-google" data-style="logoandtext" data-size="small">&nbsp;</div>
        <br />
        <div>Please click the sign in with any social button above and login to your account.</div>
        </div>

Include the Social Login Block in your Theme using the follwing PHP code: (i.e If you want to add the social login in the customer login section, go to your theme_path/Customer/view/frontend/templates/form/login.phtml), (*7)

    <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('addshoppers_social_login')->toHtml();?>

The Versions

05/09 2016

dev-master

9999999-dev

AddShoppers - Magento 2 Module Connector

  Sources   Download

OSL-3.0 AFL-3.0

09/02 2016

2.0.1

2.0.1.0

AddShoppers - Magento 2 Module Connector

  Sources   Download

OSL-3.0 AFL-3.0