diff --git a/app/code/Morfdev/Freshdesk/Api/CustomerManagementInterface.php b/Api/CustomerManagementInterface.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Api/CustomerManagementInterface.php rename to Api/CustomerManagementInterface.php diff --git a/app/code/Morfdev/Freshdesk/Api/OrderRecentManagementInterface.php b/Api/OrderRecentManagementInterface.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Api/OrderRecentManagementInterface.php rename to Api/OrderRecentManagementInterface.php diff --git a/app/code/Morfdev/Freshdesk/Block/Adminhtml/System/Config/Field/GenerateButton.php b/Block/Adminhtml/System/Config/Field/GenerateButton.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Block/Adminhtml/System/Config/Field/GenerateButton.php rename to Block/Adminhtml/System/Config/Field/GenerateButton.php diff --git a/app/code/Morfdev/Freshdesk/Controller/Adminhtml/Index/Redirect.php b/Controller/Adminhtml/Index/Redirect.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Controller/Adminhtml/Index/Redirect.php rename to Controller/Adminhtml/Index/Redirect.php diff --git a/app/code/Morfdev/Freshdesk/Controller/Adminhtml/System/Generate.php b/Controller/Adminhtml/System/Generate.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Controller/Adminhtml/System/Generate.php rename to Controller/Adminhtml/System/Generate.php diff --git a/app/code/Morfdev/Freshdesk/Controller/Info/Data.php b/Controller/Info/Data.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Controller/Info/Data.php rename to Controller/Info/Data.php diff --git a/app/code/Morfdev/Freshdesk/Controller/Webhook/Install.php b/Controller/Webhook/Install.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Controller/Webhook/Install.php rename to Controller/Webhook/Install.php diff --git a/app/code/Morfdev/Freshdesk/Controller/Webhook/Uninstall.php b/Controller/Webhook/Uninstall.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Controller/Webhook/Uninstall.php rename to Controller/Webhook/Uninstall.php diff --git a/app/code/Morfdev/Freshdesk/Model/Authorization.php b/Model/Authorization.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Authorization.php rename to Model/Authorization.php diff --git a/app/code/Morfdev/Freshdesk/Model/Config.php b/Model/Config.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Config.php rename to Model/Config.php diff --git a/app/code/Morfdev/Freshdesk/Model/Management/Customer.php b/Model/Management/Customer.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Management/Customer.php rename to Model/Management/Customer.php diff --git a/app/code/Morfdev/Freshdesk/Model/Management/OrderRecent.php b/Model/Management/OrderRecent.php similarity index 97% rename from app/code/Morfdev/Freshdesk/Model/Management/OrderRecent.php rename to Model/Management/OrderRecent.php index 8260b1e..2434e1f 100644 --- a/app/code/Morfdev/Freshdesk/Model/Management/OrderRecent.php +++ b/Model/Management/OrderRecent.php @@ -29,6 +29,7 @@ use Magento\Sales\Model\ResourceModel\Order\CollectionFactory as OrderCollectionFactory; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory as CustomerCollectionFactory; use Magento\Directory\Model\CountryFactory; +use Magento\Sales\Model\Order\StatusFactory; class OrderRecent implements OrderRecentManagementInterface @@ -90,6 +91,9 @@ class OrderRecent implements OrderRecentManagementInterface /** @var Config */ protected $config; + /** @var StatusFactory */ + protected $orderStatusFactory; + /** * @param OrderRepositoryInterface $orderRepository * @param OrderItemRepositoryInterface $orderItemRepository @@ -110,6 +114,7 @@ class OrderRecent implements OrderRecentManagementInterface * @param CustomerCollectionFactory $customerCollectionFactory * @param CountryFactory $countryFactory * @param Config $config + * @param StatusFactory $orderStatusFactory */ public function __construct( OrderRepositoryInterface $orderRepository, @@ -130,7 +135,8 @@ public function __construct( OrderAddressRepositoryInterface $addressRepository, CustomerCollectionFactory $customerCollectionFactory, CountryFactory $countryFactory, - Config $config + Config $config, + StatusFactory $orderStatusFactory ) { $this->orderRepository = $orderRepository; $this->orderItemRepository = $orderItemRepository; @@ -151,6 +157,7 @@ public function __construct( $this->customerCollectionFactory = $customerCollectionFactory; $this->countryFactory = $countryFactory; $this->config = $config; + $this->orderStatusFactory = $orderStatusFactory; } /** @@ -339,6 +346,7 @@ public function getInfo($email, $scope) 'phone' => $shippingAddress->getTelephone(), ]; } + $status = $this->orderStatusFactory->create()->load($order->getStatus()); $orderInfo[] = [ 'url' => $this->urlBuilder->getUrl('md_freshdesk/index/redirect', ['id' => $order->getEntityId(), 'type' => RedirectType::ORDER_TYPE]), @@ -354,7 +362,7 @@ public function getInfo($email, $scope) 'payment_method' => $order->getPayment()->getMethodInstance()->getTitle(), 'shipping_method' => $order->getShippingDescription(), 'shipping_tracking' => $this->prepareShippingTrackingForOrder($order), - 'status' => $order->getStatusLabel(), + 'status' => $status->getLabel(), 'state' => $order->getState(), 'totals' => [ 'subtotal' => $isBaseCurrencyType ? $currency->toCurrency($order->getBaseSubtotal()) : $currency->toCurrency($order->getSubtotal()), diff --git a/app/code/Morfdev/Freshdesk/Model/Source/CurrencyType.php b/Model/Source/CurrencyType.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Source/CurrencyType.php rename to Model/Source/CurrencyType.php diff --git a/app/code/Morfdev/Freshdesk/Model/Source/RedirectType.php b/Model/Source/RedirectType.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Source/RedirectType.php rename to Model/Source/RedirectType.php diff --git a/app/code/Morfdev/Freshdesk/Model/Source/RendererType.php b/Model/Source/RendererType.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Source/RendererType.php rename to Model/Source/RendererType.php diff --git a/app/code/Morfdev/Freshdesk/Model/Webhook.php b/Model/Webhook.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Model/Webhook.php rename to Model/Webhook.php diff --git a/app/code/Morfdev/Freshdesk/Observer/CustomerCreatedObserver.php b/Observer/CustomerCreatedObserver.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Observer/CustomerCreatedObserver.php rename to Observer/CustomerCreatedObserver.php diff --git a/app/code/Morfdev/Freshdesk/Observer/CustomerUpdatedObserver.php b/Observer/CustomerUpdatedObserver.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Observer/CustomerUpdatedObserver.php rename to Observer/CustomerUpdatedObserver.php diff --git a/app/code/Morfdev/Freshdesk/Observer/OrderCreatedObserver.php b/Observer/OrderCreatedObserver.php similarity index 100% rename from app/code/Morfdev/Freshdesk/Observer/OrderCreatedObserver.php rename to Observer/OrderCreatedObserver.php diff --git a/app/code/Morfdev/Freshdesk/composer.json b/composer.json similarity index 68% rename from app/code/Morfdev/Freshdesk/composer.json rename to composer.json index fcc1164..75222e3 100644 --- a/app/code/Morfdev/Freshdesk/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "morfdev/module-freshdesk", - "description": "N/A", + "description": "The extension connect Magento 2 stores with Freshworks products (Freshdesk/Freshsales/Freshservice/Freshchat) via Magento 2 Connector app", "type": "magento2-module", "version": "1.0.4", "license": [ diff --git a/app/code/Morfdev/Freshdesk/etc/acl.xml b/etc/acl.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/acl.xml rename to etc/acl.xml diff --git a/app/code/Morfdev/Freshdesk/etc/adminhtml/routes.xml b/etc/adminhtml/routes.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/adminhtml/routes.xml rename to etc/adminhtml/routes.xml diff --git a/app/code/Morfdev/Freshdesk/etc/adminhtml/system.xml b/etc/adminhtml/system.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/adminhtml/system.xml rename to etc/adminhtml/system.xml diff --git a/app/code/Morfdev/Freshdesk/etc/di.xml b/etc/di.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/di.xml rename to etc/di.xml diff --git a/app/code/Morfdev/Freshdesk/etc/events.xml b/etc/events.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/events.xml rename to etc/events.xml diff --git a/app/code/Morfdev/Freshdesk/etc/frontend/routes.xml b/etc/frontend/routes.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/frontend/routes.xml rename to etc/frontend/routes.xml diff --git a/app/code/Morfdev/Freshdesk/etc/module.xml b/etc/module.xml similarity index 100% rename from app/code/Morfdev/Freshdesk/etc/module.xml rename to etc/module.xml diff --git a/app/code/Morfdev/Freshdesk/registration.php b/registration.php similarity index 100% rename from app/code/Morfdev/Freshdesk/registration.php rename to registration.php diff --git a/app/code/Morfdev/Freshdesk/view/adminhtml/templates/system/config/field/generateButton.phtml b/view/adminhtml/templates/system/config/field/generateButton.phtml similarity index 100% rename from app/code/Morfdev/Freshdesk/view/adminhtml/templates/system/config/field/generateButton.phtml rename to view/adminhtml/templates/system/config/field/generateButton.phtml diff --git a/app/code/Morfdev/Freshdesk/view/frontend/templates/renderer/bundle.phtml b/view/frontend/templates/renderer/bundle.phtml similarity index 100% rename from app/code/Morfdev/Freshdesk/view/frontend/templates/renderer/bundle.phtml rename to view/frontend/templates/renderer/bundle.phtml diff --git a/app/code/Morfdev/Freshdesk/view/frontend/templates/renderer/default.phtml b/view/frontend/templates/renderer/default.phtml similarity index 100% rename from app/code/Morfdev/Freshdesk/view/frontend/templates/renderer/default.phtml rename to view/frontend/templates/renderer/default.phtml diff --git a/app/code/Morfdev/Freshdesk/view/frontend/templates/renderer/downloadable.phtml b/view/frontend/templates/renderer/downloadable.phtml similarity index 100% rename from app/code/Morfdev/Freshdesk/view/frontend/templates/renderer/downloadable.phtml rename to view/frontend/templates/renderer/downloadable.phtml