承接 aashan/module-link-guest-orders 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aashan/module-link-guest-orders

最新稳定版本:v1.0.5

Composer 安装命令:

composer require aashan/module-link-guest-orders

包简介

Links guest orders to customer accounts if there is any user account associated with the order email.

README 文档

README

Build Status

Link Guest Customer

Overview

By default, Magento 2 doesn't automatically link the guest orders as customer orders if the account with email supplied during the checkout process already exists. That is where this module comes in handy. This module automatically synchronizes the orders on the basis of order email address. You can even sync previously added orders through the admin panel.

Image Image Image

Installation

  • Composer Installation

    Inside your project root directory, run composer require aashan/module-link-guest-orders.

    Make sure to run post installation scripts.

  • Manual Installation

    This module can be installed by downloading the latest release and extracting the files under <your project root>/app/code/Aashan/LinkGuestOrder. Once the files have been extracted, run the post installation scripts.

  • Install via Git

    To install it via git, follow the following process.

    • cd <your project directory>
    • mkdir app/code/Aashan/LinkGuestOrder && cd app/code/Aashan/LinkGuestOrder
    • git init
    • git remote add origin https://github.com/aashan10/magento2-link-guest-order.git
    • git pull origin master

    Once the installation is complete, please follow post installation scripts.

  • Post Installation

    Once you have your module installed by one of the above methods, run the following commands to make sure that the module is setup correctly.

    • bin/magento setup:upgrade
    • bin/magento cache:clean

API

The module provides a simple API for auto linking the orders to their respective customers. The main API is available through Aashan\LinkGuestOrder\Helper\OrderLinkHelper helper class. It consists of a method linkOrderToCustomer which takes object of Magento\Sales\Model\Order class as the only argument.

Below is an example on using the API.

<?php 
...

use Aashan\LinkGuestOrder\Helper\OrderLinkHelper;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
...

public function __constructor(
	...,
	OrderLinkHelper $helper,
	CollectionFactory $factory,
	...
){
	$this->helper = $helper;
	$this->factory = $factory;
};

...
...

public function linkOrderById($orderId){
	$order = $this->factory
				->create()
				->addFieldToFilter(
					'entity_id', 
					$orderId
				)
				->getFirstItem();
	$this->helper->linkOrderToCustomer($order);
}
...

Contributing

Follow the Github docs for contribution guide given here.

统计信息

  • 总下载量: 5.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-10-15