Copyright – Is It Legal to Use Open Source Modules with Magento Commerce?

I have just read the Magento Commerce Software License Agreement v1. (Https://magento.com/sites/default/files/magento-commerce-software-license-agreement.pdf)

Under Section 2B it says

Customer may (g) use any copyleft software in conjunction with
the software

Does that mean that I can not use open source modules or extensions in Magento Commerce? As far as I know, all common open source licenses are OSL Copyleft.

Enter image description here

magento2 – Magento 2 How do I check if the customer changes his password?

You can check / compare the customer's old password and the updated password value using the following code.

encryptor = $encryptor;
        $this->_messageManager = $messageManager;
        $this->objectManager = $objectManager;
    }

    public function execute(MagentoFrameworkEventObserver $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        $currentPasswordHash = $this->getCurrentPasswordHash($customer->getEntityId());
        try{
            $newPasswordHash = $this->encryptor->encrypt("new password value");
            if($currentPasswordHash == $newPasswordHash){
                // password is same
                $this->_messageManager->addWarning(__("New Password is same as current password. Please choose another one"));
            }
        }catch(Exception $e){
            echo 'Error::'.$e->getMessage();
        }
    }

    private function getCurrentPasswordHash($customerId){
        $resource = $this->objectManager->get('MagentoFrameworkAppResourceConnection');
        $connection = $resource->getConnection();
        $sql = "Select password_hash from customer_entity WHERE entity_id = ".$customerId;
        $hash = $connection->fetchOne($sql);
        return $hash;
    }
}

If you want to use decrypted password values ​​to compare and verify, you can use the following line of code in your Observer.

$decrypt = $this->encryptor->decrypt("password hash");

I hope it helps!!!

magento2 – Magento 2 adds a title to the Footer Links block

I tried to add an h3 header to the footer links block.

Add the title to the cms footer block

This looks difficult to maintain and it was not quite what I wanted.

I can add a static block with my own links and probably get an easier to maintain solution. However, I would prefer to do this in a Magento2 way.

It is possible to specify a template for the linkage block, and I can do this, but not pull through the actual links.

        
        
            Magento_Theme::html/custom.phtml
        
        
            
                Delivery and returns
                delivery-information
            
        
        
            
                Glossary
                glossary
            
        
    

Can someone help with an elegant solution?

magento2 – M2 – Displays the progress bar in the Magento Modal popup

I have a system configuration button whose HTML code is shown below to display the pop-up button.

I want to display the progress bar in the modal content.






How does the following code work with the prcess bar?
Synchronization process is just getting the job collection and syncing with ERP.

use SymfonyComponentConsoleHelperProgressBar;

// creates a new progress bar (50 units)
$progressBar = new ProgressBar($output, 50);

// starts and displays the progress bar
 $progressBar->start();

 $i = 0;
 while ($i++ < 50) {    

// advances the progress bar 1 unit
$progressBar->advance();

// you can also advance the progress bar by more than 1 unit
// $progressBar->advance(5);
}

// ensures that the progress bar is at 100%
$progressBar->finish();

Some ref. Taken:
https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/widget_modal.html

magento2 – Magento 2: Override a function of a model with a plugin

I want to override a function (public function getName) of a model (Customer.php). Searched Google. I created a plugin, but it was not displayed. Is that not correct? Thank you very much

I would like to overwrite this as follows:
(Original file: Manufacturer / Magento / Module Customer / Model / Customer.php)

public function getName()
    {
        $name = '';

        if ($this->_config->getAttribute('customer', 'prefix')->getIsVisible() && $this->getPrefix()) {
            $name .= $this->getPrefix() . ' ';
        }
        $name .= $this->getFirstname();
        if ($this->_config->getAttribute('customer', 'middlename')->getIsVisible() && $this->getMiddlename()) {
            $name .= ' ' . $this->getMiddlename();
        }
        $name .= ' ' . $this->getLastname();
        if ($this->_config->getAttribute('customer', 'suffix')->getIsVisible() && $this->getSuffix()) {
            $name .= ' ' . $this->getSuffix();
        }
        return $name;
    }

to

public function getName()
    {
        $name = '';

        if ($this->_config->getAttribute('customer', 'prefix')->getIsVisible() && $this->getPrefix()) {
            $name .= $this->getPrefix() . ' ';
        }
        $name .= $this->getLastname();
        if ($this->_config->getAttribute('customer', 'middlename')->getIsVisible() && $this->getMiddlename()) {
            $name .= ' ' . $this->getMiddlename();
        }
        $name .= ' ' . $this->getFirstname();
        if ($this->_config->getAttribute('customer', 'suffix')->getIsVisible() && $this->getSuffix()) {
            $name .= ' ' . $this->getSuffix();
        }
        return $name;
    }

1: registration.php

2: etc / module.xml




    
        
        
        
    

3: etc / di.xml




    
        
    

4: plugin / customer / model / customer.php

_config->getAttribute('customer', 'prefix')->getIsVisible() && $this->getPrefix()) {
            $name .= $this->getPrefix() . ' ';
        }
        $name .= $this->getLastname();
        if ($this->_config->getAttribute('customer', 'middlename')->getIsVisible() && $this->getMiddlename()) {
            $name .= ' ' . $this->getMiddlename();
        }
        $name .= ' ' . $this->getFirstname();
        if ($this->_config->getAttribute('customer', 'suffix')->getIsVisible() && $this->getSuffix()) {
            $name .= ' ' . $this->getSuffix();
        }
        return $name;
    }
}

magento2 – Magento 2 How do I check if the customer changes his password?

I use an observer, which fires every time the customer processes his account.
I use customer_address_save_before For some reason, this event will also be triggered if I change my e-mail address, my name, or my password from the front-end customer.
How can I check if the customer is editing his password?
something like $passwordOld = $customer->getOldPassword(); $passwordNew = $customer->getNewPassword();

Of course these are just examples, the methods do not exist.
Thank you so much!

product – Magento 1.9 Mysql Query to retrieve data

I'm stuck in some way to get data from Magento 1.9.
The solution I needed is MySQL query so I can collect all the data in a table.

The values ​​in the table that I needed from the different table are
Product ID, name, article number, description, price, image name, image path, meta title, meta description.
I do not know much encoding, so definitely needed MySQL query.
I'm looking forward to a solution from experienced developers. cheers