:::: MENU ::::

Mage Psycho Magento 2 Regular, Special & Tier Price Importer

Today we write review about the Mage Psycho Magento 2 Regular, Special & Tier Price Importer extension. We will talk about what extension have. We don’t test this extension so we cannot guarantee the 100% extension working.

Overview

This Price Importer Extension for Magento 2 is the fastest import tool for bulk updating different prices like regular, cost, MSRP/MAP, special, tier & customer group price.

Magento 2 has built-in data transfer for importing products and advanced pricing. But it lacks the functionality of updating all types of prices whether it’s regular or advanced pricing in a single go.
Also, the native import has very limited options for pricing.

With this extension, store admin can achieve the simplest & the fastest way to import all types of pricing with just a single CSV file(more import sources will be added soon).
And with the export pricing option, store admin can easily prepare the import file.

Key Features

  • Provides bulk import functionality for all types of the price (regular, cost, MSRP/MAP, special, tier & customer group price) with just a single CSV file
  • Option to preview the uploaded file which gives the glance view of the file data
  • The detailed error message provided during import validation helps to fix the price data faster
  • Support for different types of price rounding (whole number to the psychological pricing)
  • Price values can be increased(+), decreased(-) by a fixed amount value or percentage
  • Price values can also be set as a certain percentage of some reference attribute value
  • Ability to import prices via different methods (admin, command-line interface (CLI) & cron jobs)
  • Ability to export the different prices makes import file preparation much easier

You can buy extension form here. Also you can use the coupon code to get discount COUPON-458

Author: Qaisar Satti
Category: Extension Review
Last Modified: March 10, 2020


magento 2 get current quote

Today we talk about how Magento 2 get current quote. You can get quote data from the checkout session. You can get data to manipulate the data in the cart. So let start with our example.

namespace QaisarSatti/HelloWorld/Block;

use Magento\Backend\App\Action;


class GetQuote extends Action
{

    protected $checkoutSession;

    public function __construct(
              \Magento\Checkout\Model\Session $checkoutSession    
           )
    {
        $this->checkoutSession = $checkoutSession;
    }

    public function getQuotes()
    {
            return $this->checkoutSession->getQuote();

       
    }
}

Now we call our function and get a quote data.

$allItems = $this->getQuotes()->getAllVisibleItems();
foreach ($allItems as $item) {
    echo $item->getProductId();
}
Author: Qaisar Satti
Category: Magento 2
Last Modified: February 17, 2020


magento 2 get all customers

Today we talk about how Magento 2 get all customers. Sometimes you need to list down all the customers for many reasons. For exporting the customer the data or show all customer listing. So let start with our example to list down all the customer.

namespace QaisarSatti/HelloWorld/Block;

use Magento\Backend\App\Action;


class Delete extends Action
{

    protected $customerCollection;

    public function __construct(
        \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerCollection
    )
    {
        $this->customerCollection = $customerCollection;
    }

    public function getAllCustomers()
    {
            return $this->customerCollection->create();

       
    }
}

Now we call the function and list down all the customer data.

$allCustomers = $this->getAllCustomers();
foreach ($allCustomers as $customer) {
    echo $customer->getEmail();
    echo $customer->getFirstname();
    echo $customer->getLastname();
}
Author: Qaisar Satti
Category: Magento 2
Last Modified: February 17, 2020


Magento 2 get customer address

Today we discuss how in Magento 2 get customer address. Which include the default shipping address and default billing address also the all customer address list too. There are two types of addresses related to customer shipping and billing. you can add the unlimited address as a customer. let start with our example.

Customer Default Billing Address

Get the customer defaut billing address.

namespace QaisarSatti/HelloWorld/Block;

use Magento\Backend\App\Action;

class Delete extends Action
{

    protected $customerFactory;
    protected $addressFactory;

    public function __construct(
        \Magento\Customer\Model\CustomerFactory $customerFactory,
        \Magento\Customer\Model\AddressFactory $addressFactory
    )
    {
        $this->customerFactory = $customerFactory;
        $this->addressFactory = $addressFactory;
    }

    public function getCustomerDefaultBillingAddress()
    {
        $customerObject = $this->customerFactory->create()->load(10);  
        $billingAddressId = $customerObject->getDefaultBilling();
        return $billingAddress = $this->addressFactory->create()->load($billingAddressId);
       
    }
}

Customer Default Shipping Address

Get the customer defaut billing address.

namespace QaisarSatti/HelloWorld/Block;

use Magento\Backend\App\Action;

class Delete extends Action
{

    protected $customerFactory;
    protected $addressFactory;

    public function __construct(
        \Magento\Customer\Model\CustomerFactory $customerFactory,
        \Magento\Customer\Model\AddressFactory $addressFactory
    )
    {
        $this->customerFactory = $customerFactory;
        $this->addressFactory = $addressFactory;
    }

    public function getCustomerDefaultBillingAddress()
    {
        $customerObject = $this->customerFactory->create()->load(10);  
        $shippingAddressId = $customerObject->getDefaultShipping();
        return $shippingAddress = $this->addressFactory->create()->load($shippingAddressId);
       
    }
}

Customer All Address

Get the customer all address.

namespace QaisarSatti/HelloWorld/Block;

use Magento\Backend\App\Action;

class Delete extends Action
{

    protected $customerFactory;
    protected $addressFactory;

    public function __construct(
        \Magento\Customer\Model\CustomerFactory $customerFactory,
        \Magento\Customer\Model\AddressFactory $addressFactory
    )
    {
        $this->customerFactory = $customerFactory;
        $this->addressFactory = $addressFactory;
    }

    public function getCustomerDefaultBillingAddress()
    {
        $customerObject = $this->customerFactory->create()->load(10);  
        return $customerObject->getAddresses();
       
    }
}
Author: Qaisar Satti
Category: Magento 2
Last Modified: February 17, 2020


Magento 2 current order

In this tutorial, we talk about how to get Magento 2 current order. Which includes order information current order id, Increment Id and other order-related data too like shipping information, billing information, and customer information. Now we start with our example.

You have to inject the checkout model session to get the latest order information.

protected $_checkoutSession;


public function __construct(
\Magento\Checkout\Model\Session $checkoutSession,

) {

        $this->_checkoutSession = $checkoutSession;


    }

Now with $_checkoutSession obejct you can get order following information.

 $order = $this->_checkoutSession->getLastRealOrder();
 $orderId=$order->getEntityId();  // order id
 $order->getIncrementId();  // order increment id
 $order->getShippingMethod(); // shippingm ehtod
 $order->getPayment();   // payment method
 $order->getCustomerEmail(); // customer email
Author: Qaisar Satti
Category: Magento 2
Last Modified: February 4, 2020


Magento 2 order PayPal information

Today we talk about how in Magento 2 order PayPal information. In this tutorial, we focus on how to get order PayPal information which includes the PayPal express token and PayPal correlation id. So let start with our example.

First, we get payment additional information.

[cc lang="php" tab_size="2" lines="40"]
$paymentAdditionalInfo = $order->getPayment()->getAdditionalInformation();

With the heplp of addiotnal information obejct we get paypal expreess token.

// get PayPal express checkout token
$token = $paymentAdditionalInfo['paypal_express_checkout_token'];

With the heplp of addiotnal information obejct we get paypal correlation id.

// get PayPal correlation ID
$correlationId = $paymentAdditionalInfo['paypal_correlation_id'];
Author: Qaisar Satti
Category: Magento 2
Last Modified: February 4, 2020


Magento 2 delete file or image

Today we discuss how to delete a file or image in Magento 2. In this tutorial, we focus on Magento 2 ways to delete the file or image. As a PHP developer, you already about the function unlink(filepathhere) will delete the file for you. So let start with our example.

namespace QaisarSatti/HelloWorld/Block;

use Magento\Backend\App\Action;
use Magento\Framework\Filesystem\Driver\File;
use Magento\Framework\Filesystem;
use Magento\Framework\App\Filesystem\DirectoryList;

class Delete extends Action
{

    protected $fileSystem;
    protected $file;

    public function __construct(
        Filesystem $fileSystem,
        File $file
    )
    {
        $this->fileSystem = $fileSystem;
        $this->file = $file;
    }

    public function delete()
    {
        $fileName= "helloworld.jpg";
        $mediaRootDir = $this->fileSystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath();
        if ($this->file->isExists($mediaRootDir . $fileName)) {
            $this->file->deleteFile($mediaRootDir . $fileName);
        }
       
    }
}

Delete FIle with ObjectManager.

$fileName= "helloworld.jpg";
$file = $this->_objectManager->get('Magento\Framework\Filesystem\Driver\File');
$mediaDirectory = $this->_objectManager->get('Magento\Framework\Filesystem')->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA);
$mediaRootDir = $mediaDirectory->getAbsolutePath();

if ($file->isExists($mediaRootDir . $fileName))  {

    $file->deleteFile($mediaRootDir . $fileName);
}
Author: Qaisar Satti
Category: Magento 2
Last Modified: February 17, 2020


Pages:1234567...23