├── .github └── workflows │ ├── codesniffer.yml │ ├── linting.yml │ └── setup-upgrade.yml ├── .gitignore ├── Api ├── Config │ ├── RepositoryInterface.php │ └── System │ │ ├── FeedInterface.php │ │ ├── ItemupdateInterface.php │ │ ├── OrderInterface.php │ │ └── ReturnsInterface.php ├── Log │ └── RepositoryInterface.php ├── Order │ ├── Data │ │ ├── DataInterface.php │ │ └── SearchResultsInterface.php │ └── RepositoryInterface.php ├── Returns │ ├── Data │ │ ├── DataInterface.php │ │ └── SearchResultsInterface.php │ └── RepositoryInterface.php └── Selftest │ └── RepositoryInterface.php ├── Block ├── Adminhtml │ ├── Design │ │ ├── Header.php │ │ ├── Heading.php │ │ ├── Log.php │ │ └── Version.php │ ├── Order │ │ ├── Creditmemo │ │ │ ├── Totals.php │ │ │ └── View │ │ │ │ └── Returns.php │ │ ├── Invoice │ │ │ └── Totals.php │ │ └── Totals.php │ └── System │ │ └── Config │ │ ├── Button │ │ ├── Log.php │ │ ├── Selftest.php │ │ └── VersionCheck.php │ │ └── Form │ │ ├── Feeds.php │ │ ├── Field │ │ ├── AdvancedShipmentMapping.php │ │ ├── DeliveryTime.php │ │ ├── ExtraFields.php │ │ ├── Filters.php │ │ ├── Renderer │ │ │ ├── Actions.php │ │ │ ├── Attributes.php │ │ │ ├── Carriers.php │ │ │ ├── Channels.php │ │ │ ├── Conditions.php │ │ │ ├── Countries.php │ │ │ ├── ProductTypes.php │ │ │ └── ShippingMethods.php │ │ └── ReturnLabel.php │ │ └── Table │ │ ├── Itemupdates.php │ │ ├── Orders.php │ │ └── Returns.php └── Info │ └── Channable.php ├── COPYING.txt ├── Console └── Command │ ├── GenerateToken.php │ ├── ItemUpdate.php │ ├── OrderSimulate.php │ └── Selftest.php ├── Controller ├── Adminhtml │ ├── Item │ │ ├── Flush.php │ │ ├── Index.php │ │ ├── MassQue.php │ │ ├── RunQue.php │ │ └── Update.php │ ├── Log │ │ └── Stream.php │ ├── Order │ │ ├── Delete.php │ │ ├── Import.php │ │ ├── Index.php │ │ └── Simulate.php │ ├── Returns │ │ ├── Delete.php │ │ ├── Index.php │ │ ├── MassCreditmemo.php │ │ ├── MassDelete.php │ │ ├── MassProcess.php │ │ ├── Process.php │ │ └── Simulate.php │ ├── Selftest │ │ └── Index.php │ └── VersionCheck │ │ ├── Changelog.php │ │ └── Index.php ├── Feed │ ├── Json.php │ └── Preview.php ├── Item │ └── Webhook.php ├── Order │ ├── Hook.php │ ├── Shipments.php │ └── Status.php └── Returns │ ├── Hook.php │ └── Status.php ├── Cron ├── ItemCleanup.php └── ItemUpdate.php ├── Exceptions └── CouldNotImportOrder.php ├── Helper ├── Feed.php ├── General.php ├── Item.php ├── Preview.php ├── Product.php └── Source.php ├── Logger ├── DebugLogger.php ├── ErrorLogger.php └── Handler │ ├── Debug.php │ └── Error.php ├── Model ├── Base │ └── Metadata.php ├── Carrier │ └── Channable.php ├── Collection │ └── Products.php ├── Config │ ├── Backend │ │ ├── Cron.php │ │ └── Serialized │ │ │ ├── DeliveryTime.php │ │ │ ├── ExtraFields.php │ │ │ ├── Filters.php │ │ │ └── ReturnLabel.php │ ├── Repository.php │ ├── Source │ │ ├── Channels.php │ │ ├── CustomerGroups.php │ │ ├── ReturnLabel.php │ │ ├── ShippingMethods.php │ │ └── Status.php │ └── System │ │ ├── BaseRepository.php │ │ ├── FeedRepository.php │ │ ├── ItemupdateRepository.php │ │ ├── OrderRepository.php │ │ └── ReturnsRepository.php ├── Generate.php ├── Item.php ├── Log │ └── Repository.php ├── Order │ ├── DataModel.php │ ├── Repository.php │ └── ResourceModel │ │ ├── Collection.php │ │ └── ResourceModel.php ├── Payment │ └── Channable.php ├── ResourceModel │ ├── Item.php │ └── Item │ │ └── Collection.php ├── Returns │ ├── Collection.php │ ├── DataModel.php │ ├── Repository.php │ ├── ResourceModel.php │ └── ResourceModel │ │ └── Grid │ │ └── Collection.php ├── Selftest │ └── Repository.php ├── System │ └── Config │ │ └── Source │ │ ├── Attributes.php │ │ ├── Bundle │ │ ├── Image.php │ │ ├── Link.php │ │ ├── Option.php │ │ └── ParentAttributes.php │ │ ├── CategoryList.php │ │ ├── CategoryTypeList.php │ │ ├── Conditions.php │ │ ├── Configurable │ │ ├── Image.php │ │ ├── Link.php │ │ ├── Option.php │ │ └── ParentAttributes.php │ │ ├── Country.php │ │ ├── CronFrequency.php │ │ ├── CustomerGroups.php │ │ ├── Grouped │ │ ├── Image.php │ │ ├── Link.php │ │ ├── Option.php │ │ ├── ParentAttributes.php │ │ └── Price.php │ │ ├── ImageSource.php │ │ ├── InvalidationModus.php │ │ ├── Inventory.php │ │ ├── MainImage.php │ │ ├── ParentAttributes.php │ │ ├── ProductCondition.php │ │ ├── ProductTypes.php │ │ ├── ProductVisibility.php │ │ ├── ReturnsStatus.php │ │ ├── ShippingMethods.php │ │ ├── SourceType.php │ │ ├── Status.php │ │ └── Tax.php └── Total │ ├── TransactionFee.php │ ├── TransactionFeeCreditmemo.php │ └── TransactionFeeInvoice.php ├── Observer ├── Catalog │ └── ProductSaveAfter.php ├── CatalogInventory │ └── StockItemSaveAfter.php ├── Checkout │ └── AllSubmitAfter.php ├── Controller │ └── RemoveCsp.php ├── Sales │ ├── OrderItemCancel.php │ ├── OrderPlaceAfter.php │ └── QuoteSubmitBefore.php ├── SalesRule │ └── ValidatorProcess.php └── Xtento │ └── InvalidateProducts.php ├── Plugin ├── AddDiscountToInvoice.php ├── AfterCheckQty.php ├── AfterGetBackorders.php ├── AfterGetShippingDescription.php ├── AfterStockItemConfiguration.php ├── AfterValidateMinimumAmount.php ├── AroundCsrfValidator.php ├── AroundIsAllowedRequest.php ├── AroundIsAnySourceItemInStockCondition.php ├── AroundIsSalableWithReservationsCondition.php ├── AroundQuantityValidator.php ├── AroundSourceDeductionService.php └── CreditmemoSaveAfter.php ├── README.md ├── Service ├── Category │ └── CategoryData.php ├── ItemUpdate │ └── FlushItems.php ├── Order │ ├── Import.php │ ├── ImportSimulator.php │ ├── Items │ │ └── Add.php │ ├── Process │ │ ├── AddPaymentData.php │ │ ├── CreateInvoice.php │ │ ├── CreateShipment.php │ │ ├── GetCustomIncrementId.php │ │ ├── OrderCommentHistory.php │ │ └── SendOrderEmail.php │ ├── Quote │ │ ├── AddressHandler.php │ │ ├── Create.php │ │ └── CustomerHandler.php │ ├── Shipping │ │ ├── CalculatePrice.php │ │ ├── Fulfillment.php │ │ ├── GetDescription.php │ │ ├── GetMethod.php │ │ └── SetShippingMethod.php │ └── Validator │ │ └── Data.php ├── Product │ ├── CustomOptions.php │ ├── InventoryData.php │ ├── InventorySource.php │ ├── MediaData.php │ ├── PriceData.php │ └── TierPriceData.php ├── Returns │ ├── CreateCreditmemo.php │ ├── GetByOrder.php │ ├── GetReturnStatus.php │ ├── GetSkuFromGtin.php │ ├── ImportReturn.php │ ├── ImportSimulator.php │ ├── JsonResponse.php │ ├── ProcessReturn.php │ ├── ValidateJsonData.php │ └── ValidateRequestData.php ├── Test │ ├── Cron.php │ ├── ExtensionStatus.php │ ├── ExtensionVersion.php │ ├── ItemUpdate.php │ ├── MagentoVersion.php │ ├── OrderImport.php │ ├── PhpExtensions.php │ ├── PhpVersion.php │ └── ProductFeed.php ├── Token │ └── Generate.php └── Webhook │ ├── OrderStatus.php │ └── Shipments.php ├── Setup └── Patch │ └── Data │ ├── CategoryAttributes.php │ ├── ConfigPath.php │ └── CreateToken.php ├── Ui └── Component │ ├── Listing │ └── Column │ │ ├── Item │ │ └── Actions.php │ │ ├── Order │ │ ├── AbstractOrder.php │ │ ├── Actions.php │ │ ├── Billing.php │ │ ├── Customer.php │ │ ├── Error.php │ │ ├── Price.php │ │ ├── Products.php │ │ └── Shipping.php │ │ └── Returns │ │ ├── Actions.php │ │ ├── Creditmemo.php │ │ ├── Item.php │ │ ├── Order.php │ │ ├── Reason.php │ │ └── Status.php │ └── OrderDataProvider.php ├── composer.json ├── etc ├── acl.xml ├── adminhtml │ ├── events.xml │ ├── menu.xml │ ├── routes.xml │ ├── system.xml │ └── system │ │ ├── carriers.xml │ │ ├── feed.xml │ │ ├── general.xml │ │ ├── itemupdates.xml │ │ ├── order.xml │ │ ├── payment.xml │ │ └── returns.xml ├── config.xml ├── crontab.xml ├── db_schema.xml ├── db_schema_whitelist.json ├── di.xml ├── events.xml ├── extension_attributes.xml ├── fieldset.xml ├── frontend │ ├── di.xml │ ├── events.xml │ └── routes.xml ├── module.xml ├── payment.xml ├── pdf.xml └── sales.xml ├── i18n └── en_US.csv ├── registration.php └── view ├── adminhtml ├── layout │ ├── channable_item_index.xml │ ├── channable_order_index.xml │ ├── channable_returns_index.xml │ ├── sales_order_creditmemo_new.xml │ ├── sales_order_creditmemo_updateqty.xml │ ├── sales_order_creditmemo_view.xml │ ├── sales_order_invoice_view.xml │ └── sales_order_view.xml ├── templates │ ├── info │ │ ├── channable_payment.phtml │ │ └── pdf │ │ │ └── channable_payment.phtml │ ├── order │ │ ├── creditmemo │ │ │ └── view │ │ │ │ └── returns.phtml │ │ └── table-tooltip-js.phtml │ └── system │ │ └── config │ │ ├── button │ │ ├── log.phtml │ │ ├── selftest.phtml │ │ └── version.phtml │ │ └── fieldset │ │ ├── feeds.phtml │ │ ├── header.phtml │ │ └── table │ │ ├── itemupdates.phtml │ │ ├── orders.phtml │ │ └── returns.phtml ├── ui_component │ ├── catalogstaging_category_update_form.xml │ ├── category_form.xml │ ├── channable_item_grid.xml │ ├── channable_order_grid.xml │ ├── channable_returns_grid.xml │ └── sales_order_grid.xml └── web │ ├── css │ └── source │ │ ├── _module.less │ │ ├── extend │ │ └── _additional.less │ │ ├── module │ │ ├── _debug.less │ │ ├── _header.less │ │ ├── _version.less │ │ └── ui │ │ │ ├── _button.less │ │ │ └── _modal.less │ │ └── variables │ │ └── _colors.less │ ├── images │ └── channable-logo.png │ ├── js │ ├── button-functions.js │ ├── order-table-tooltip.js │ └── show-more.js │ └── template │ └── grid │ └── order_import_status.html └── frontend └── templates └── info └── channable_payment.phtml /.github/workflows/codesniffer.yml: -------------------------------------------------------------------------------- 1 | name: Codesniffer with the Magento Coding standard 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | 10 | - name: Run codesniffer 11 | run: 12 | docker run 13 | --volume $(pwd)/:/app/workdir 14 | michielgerritsen/magento-coding-standard:latest 15 | --severity=8 16 | -s 17 | -------------------------------------------------------------------------------- /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | name: Lint PHP files 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | php-74: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: prestashop/github-action-php-lint/7.4@v2.3.1 9 | 10 | php-81: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: prestashop/github-action-php-lint/8.1@v2.3.1 14 | 15 | php-82: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: prestashop/github-action-php-lint/8.2@v2.3.1 19 | 20 | php-83: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: prestashop/github-action-php-lint/8.3@v2.3.1 24 | 25 | php-84: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - uses: prestashop/github-action-php-lint/8.4@v2.3.1 29 | -------------------------------------------------------------------------------- /.github/workflows/setup-upgrade.yml: -------------------------------------------------------------------------------- 1 | name: Run setup:upgrade and setup:di:compile 2 | on: [pull_request] 3 | 4 | jobs: 5 | build: 6 | strategy: 7 | matrix: 8 | include: 9 | - PHP_VERSION: php74-fpm 10 | MAGENTO_VERSION: 2.3.7 11 | - PHP_VERSION: php81-fpm 12 | MAGENTO_VERSION: 2.4.6-p4 13 | - PHP_VERSION: php83-fpm 14 | MAGENTO_VERSION: 2.4.7 15 | - PHP_VERSION: php84-fpm 16 | MAGENTO_VERSION: 2.4.8-beta2 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v2 20 | 21 | - name: Start Docker 22 | run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }} 23 | 24 | - name: Create branch for Composer and remove version from composer.json 25 | run: git checkout -b continuous-integration-test-branch && sed -i '/version/d' ./composer.json 26 | 27 | - name: Upload the code into the docker container 28 | run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ 29 | 30 | - name: Install the extension in Magento 31 | run: docker exec magento-project-community-edition composer require magmodules/magento2-channable:@dev --no-plugins 32 | 33 | - name: Activate the extension and run setup:upgrade and setup:di:compile 34 | run: docker exec magento-project-community-edition ./retry "rm -rf /data/generated/code && php bin/magento module:enable Magmodules_Channable && php bin/magento setup:upgrade && php bin/magento setup:di:compile" 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.zip 3 | .DS_Store -------------------------------------------------------------------------------- /Api/Config/RepositoryInterface.php: -------------------------------------------------------------------------------- 1 | addClass('magmodules'); 34 | return $this->toHtml(); 35 | } 36 | 37 | /** 38 | * Support link for extension. 39 | * 40 | * @return string 41 | */ 42 | public function getSupportLink(): string 43 | { 44 | return self::MODULE_SUPPORT_LINK; 45 | } 46 | 47 | 48 | /** 49 | * Support link for Channable. 50 | * 51 | * @return string 52 | */ 53 | public function getChannableSupportLink(): string 54 | { 55 | return self::MODULE_CHANNABLE_SUPPORT_LINK; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Block/Adminhtml/Design/Heading.php: -------------------------------------------------------------------------------- 1 | getHtmlId() . '">'; 29 | $html .= ' '; 30 | $html .= ' '; 31 | $html .= '
' . $element->getData('label') . '
'; 32 | $html .= '
' . $element->getData('comment') . '
'; 33 | $html .= ' '; 34 | $html .= ' '; 35 | $html .= ''; 36 | 37 | return $html; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Block/Adminhtml/Design/Version.php: -------------------------------------------------------------------------------- 1 | generalHelper = $generalHelper; 39 | parent::__construct($context); 40 | } 41 | 42 | /** 43 | * @param AbstractElement $element 44 | * 45 | * @return string 46 | */ 47 | public function _getElementHtml(AbstractElement $element) 48 | { 49 | $html = $this->generalHelper->getExtensionVersion(); 50 | $element->setData('text', $html); 51 | return parent::_getElementHtml($element); 52 | } 53 | 54 | /** 55 | * @param AbstractElement $element 56 | * 57 | * @return string 58 | */ 59 | public function _renderScopeLabel(AbstractElement $element) 60 | { 61 | return ''; 62 | } 63 | 64 | /** 65 | * @param AbstractElement $element 66 | * 67 | * @return string 68 | */ 69 | public function _renderInheritCheckbox(AbstractElement $element) 70 | { 71 | return ''; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Block/Adminhtml/Order/Creditmemo/Totals.php: -------------------------------------------------------------------------------- 1 | getParentBlock(); 29 | $creditmemo = $parent->getCreditmemo(); 30 | if ($creditmemo->getTransactionFee() != 0) { 31 | $parent->addTotal( 32 | new DataObject( 33 | [ 34 | 'code' => 'transaction_fee', 35 | 'strong' => false, 36 | 'value' => $creditmemo->getTransactionFee(), 37 | 'label' => __('Marketplace Transaction Fee'), 38 | ] 39 | ), 40 | 'transaction_fee' 41 | ); 42 | } 43 | 44 | return $this; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Block/Adminhtml/Order/Invoice/Totals.php: -------------------------------------------------------------------------------- 1 | getParentBlock(); 29 | $invoice = $parent->getInvoice(); 30 | if ($invoice->getTransactionFee() != 0) { 31 | $parent->addTotal( 32 | new DataObject( 33 | [ 34 | 'code' => 'transaction_fee', 35 | 'strong' => false, 36 | 'value' => $invoice->getTransactionFee(), 37 | 'label' => __('Marketplace Transaction Fee'), 38 | ] 39 | ), 40 | 'transaction_fee' 41 | ); 42 | } 43 | 44 | return $this; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Block/Adminhtml/Order/Totals.php: -------------------------------------------------------------------------------- 1 | getParentBlock(); 29 | $order = $parent->getOrder(); 30 | 31 | if ($order->getTransactionFee() != 0) { 32 | $parent->addTotal( 33 | new DataObject( 34 | [ 35 | 'code' => 'transaction_fee', 36 | 'strong' => false, 37 | 'value' => $order->getTransactionFee(), 38 | 'label' => __('Marketplace Transaction Fee'), 39 | ] 40 | ), 41 | 'transaction_fee' 42 | ); 43 | } 44 | 45 | return $this; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Feeds.php: -------------------------------------------------------------------------------- 1 | feedHelper = $feedHelper; 42 | parent::__construct($context); 43 | } 44 | 45 | /** 46 | * @return null 47 | */ 48 | public function getCacheLifetime() 49 | { 50 | return null; 51 | } 52 | 53 | /** 54 | * @param AbstractElement $element 55 | * 56 | * @return string 57 | */ 58 | public function render(AbstractElement $element) 59 | { 60 | $element->addClass('magmodules'); 61 | 62 | return $this->toHtml(); 63 | } 64 | 65 | /** 66 | * @return array 67 | */ 68 | public function getFeedData() 69 | { 70 | return $this->feedHelper->getConfigData(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/Renderer/Channels.php: -------------------------------------------------------------------------------- 1 | channels = $channels; 26 | } 27 | 28 | /** 29 | * Render block HTML. 30 | * 31 | * @return string 32 | */ 33 | protected function _toHtml(): string 34 | { 35 | if (empty($this->getOptions())) { 36 | $this->addOption(null, '-- select --'); 37 | foreach ($this->channels->toOptionArray() as $channel) { 38 | $this->addOption($channel['value'], $channel['label']); 39 | } 40 | } 41 | 42 | return parent::_toHtml(); 43 | } 44 | 45 | /** 46 | * Sets the name for the input element. 47 | * 48 | * @param string $value 49 | * @return $this 50 | */ 51 | public function setInputName(string $value): self 52 | { 53 | $this->setData('name', $value); 54 | return $this; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/Renderer/Conditions.php: -------------------------------------------------------------------------------- 1 | conditions = $conditions; 40 | } 41 | 42 | /** 43 | * Render block HTML. 44 | * 45 | * @return string 46 | */ 47 | public function _toHtml() 48 | { 49 | if (!$this->getOptions()) { 50 | foreach ($this->conditions->toOptionArray() as $condition) { 51 | $this->addOption($condition['value'], $condition['label']); 52 | } 53 | } 54 | 55 | return parent::_toHtml(); 56 | } 57 | 58 | /** 59 | * Sets name for input element. 60 | * 61 | * @param $value 62 | * 63 | * @return mixed 64 | */ 65 | public function setInputName($value) 66 | { 67 | return $this->setName($value); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/Renderer/ProductTypes.php: -------------------------------------------------------------------------------- 1 | source = $source; 40 | } 41 | 42 | /** 43 | * Render block HTML. 44 | * 45 | * @return string 46 | */ 47 | public function _toHtml() 48 | { 49 | if (!$this->getOptions()) { 50 | foreach ($this->source->toOptionArray() as $type) { 51 | $this->addOption($type['value'], $type['label']); 52 | } 53 | } 54 | 55 | return parent::_toHtml(); 56 | } 57 | 58 | /** 59 | * Sets name for input element. 60 | * 61 | * @param $value 62 | * 63 | * @return mixed 64 | */ 65 | public function setInputName($value) 66 | { 67 | return $this->setName($value); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/Renderer/ShippingMethods.php: -------------------------------------------------------------------------------- 1 | shippingMethods = $shippingMethods; 26 | } 27 | 28 | /** 29 | * Render block HTML. 30 | * 31 | * @return string 32 | */ 33 | protected function _toHtml(): string 34 | { 35 | if (empty($this->getOptions())) { 36 | foreach ($this->shippingMethods->toOptionArray() as $method) { 37 | $this->addOption($method['value'], $method['label']); 38 | } 39 | } 40 | 41 | return parent::_toHtml(); 42 | } 43 | 44 | /** 45 | * Sets the name for the input element. 46 | * 47 | * @param string $value 48 | * @return $this 49 | */ 50 | public function setInputName(string $value): self 51 | { 52 | $this->setName($value); 53 | return $this; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Block/Info/Channable.php: -------------------------------------------------------------------------------- 1 | flushItems = $flushItems; 46 | $this->redirect = $redirect; 47 | parent::__construct($context); 48 | } 49 | 50 | /** 51 | * Flush Item Table 52 | */ 53 | public function execute(): Redirect 54 | { 55 | $this->flushItems->execute(); 56 | $this->messageManager->addSuccessMessage(__('Table flushed!')); 57 | 58 | /** @var Redirect $resultRedirect */ 59 | $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); 60 | $resultRedirect->setUrl($this->redirect->getRefererUrl()); 61 | return $resultRedirect; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Order/Delete.php: -------------------------------------------------------------------------------- 1 | orderRepository = $orderRepository; 42 | } 43 | 44 | /** 45 | * @return Redirect 46 | */ 47 | public function execute() 48 | { 49 | /** @var Redirect $resultRedirect */ 50 | $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); 51 | 52 | try { 53 | $this->orderRepository->deleteById( 54 | (int)$this->getRequest()->getParam('id') 55 | ); 56 | $this->messageManager->addSuccessMessage(__('Order was removed')); 57 | } catch (\Exception $e) { 58 | $this->messageManager->addSuccessMessage($e->getMessage()); 59 | } 60 | 61 | $resultRedirect->setUrl($this->_redirect->getRefererUrl()); 62 | return $resultRedirect; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Order/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 43 | } 44 | 45 | /** 46 | * Execute function for Order Grid 47 | */ 48 | public function execute() 49 | { 50 | $resultPage = $this->resultPageFactory->create(); 51 | /** @var Page $resultPage */ 52 | $resultPage->setActiveMenu('Magmodules_Channable::general_orders'); 53 | $resultPage->getConfig()->getTitle()->prepend(__('Channable - Orders')); 54 | $resultPage->addBreadcrumb(__('Channable'), __('Orders')); 55 | $resultPage->addBreadcrumb(__('Orders'), __('Orders')); 56 | return $resultPage; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Returns/Delete.php: -------------------------------------------------------------------------------- 1 | redirect = $redirect; 45 | $this->returnsRepository = $returnsRepository; 46 | } 47 | 48 | /** 49 | * @return Redirect 50 | */ 51 | public function execute(): Redirect 52 | { 53 | try { 54 | $this->returnsRepository->deleteById( 55 | (int)$this->getRequest()->getParam('id') 56 | ); 57 | $this->messageManager->addSuccessMessage(__('Returns was deleted')); 58 | } catch (\Exception $e) { 59 | $this->messageManager->addErrorMessage($e->getMessage()); 60 | } 61 | 62 | /** @var Redirect $resultRedirect */ 63 | $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); 64 | return $resultRedirect->setPath( 65 | $this->redirect->getRefererUrl() 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Returns/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 38 | } 39 | 40 | /** 41 | * @return Page 42 | */ 43 | public function execute(): Page 44 | { 45 | /** @var Page $resultPage */ 46 | $resultPage = $this->resultPageFactory->create(); 47 | $resultPage->setActiveMenu('Magmodules_Channable::general_returns'); 48 | $resultPage->getConfig()->getTitle()->prepend(__('Channable - Returns')); 49 | $resultPage->addBreadcrumb(__('Channable'), __('Channable')); 50 | $resultPage->addBreadcrumb(__('Returns'), __('Returns')); 51 | 52 | return $resultPage; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Returns/Process.php: -------------------------------------------------------------------------------- 1 | processReturn = $processReturn; 38 | } 39 | 40 | public function execute() 41 | { 42 | $data = $this->getRequest()->getParams(); 43 | $result = $this->processReturn->execute($data); 44 | 45 | if (!empty($result['status']) && $result['status'] === 'success') { 46 | $this->messageManager->addSuccessMessage($result['msg'] ?? __('Return updated')); 47 | } 48 | 49 | if (!empty($result['status']) && $result['status'] === 'error') { 50 | $this->messageManager->addErrorMessage($result['msg'] ?? __('Unknown Error')); 51 | } 52 | 53 | /** @var Redirect $redirect */ 54 | $redirect = $this->resultRedirectFactory->create(); 55 | $redirect->setUrl($this->_redirect->getRefererUrl()); 56 | return $redirect; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Selftest/Index.php: -------------------------------------------------------------------------------- 1 | resultJsonFactory = $resultJsonFactory; 44 | $this->selftestRepository = $selftestRepository; 45 | parent::__construct($context); 46 | } 47 | 48 | /** 49 | * @return Json 50 | */ 51 | public function execute(): Json 52 | { 53 | $resultJson = $this->resultJsonFactory->create(); 54 | $result = $this->selftestRepository->test(); 55 | return $resultJson->setData(['result' => $result]); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Cron/ItemCleanup.php: -------------------------------------------------------------------------------- 1 | configProvider = $configProvider; 43 | $this->logRepository = $logRepository; 44 | $this->itemModel = $itemModel; 45 | } 46 | 47 | /** 48 | * Execute: Cleanup old entries /items 49 | */ 50 | public function execute() 51 | { 52 | try { 53 | if ($this->configProvider->isItemCronEnabled()) { 54 | $this->itemModel->cleanOldEntries(); 55 | } 56 | } catch (\Exception $e) { 57 | $this->logRepository->addErrorLog('Cron ItemCleanup', $e->getMessage()); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Cron/ItemUpdate.php: -------------------------------------------------------------------------------- 1 | configProvider = $configProvider; 43 | $this->logRepository = $logRepository; 44 | $this->itemModel = $itemModel; 45 | } 46 | 47 | /** 48 | * Execute: ItemUpdate Cron 49 | */ 50 | public function execute() 51 | { 52 | try { 53 | if ($this->configProvider->isItemCronEnabled()) { 54 | $this->itemModel->updateAll(); 55 | } 56 | } catch (\Exception $e) { 57 | $this->logRepository->addErrorLog('Cron ItemUpdate', $e->getMessage()); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Exceptions/CouldNotImportOrder.php: -------------------------------------------------------------------------------- 1 | json = $json; 39 | parent::__construct($name, $handlers, $processors); 40 | } 41 | 42 | /** 43 | * Add debug data to Channable log 44 | * 45 | * @param string $type 46 | * @param mixed $data 47 | */ 48 | public function addLog(string $type, $data): void 49 | { 50 | if (is_array($data) || is_object($data)) { 51 | $this->addRecord(static::INFO, $type . ': ' . $this->json->serialize($data)); 52 | } else { 53 | $this->addRecord(static::INFO, $type . ': ' . $data); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Logger/ErrorLogger.php: -------------------------------------------------------------------------------- 1 | json = $json; 39 | parent::__construct($name, $handlers, $processors); 40 | } 41 | 42 | /** 43 | * Add error data to Channable log 44 | * 45 | * @param string $type 46 | * @param mixed $data 47 | */ 48 | public function addLog($type, $data): void 49 | { 50 | if (is_array($data) || is_object($data)) { 51 | $this->addRecord(static::ERROR, $type . ': ' . $this->json->serialize($data)); 52 | } else { 53 | $this->addRecord(static::ERROR, $type . ': ' . $data); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Logger/Handler/Debug.php: -------------------------------------------------------------------------------- 1 | objectManager = $objectManager; 47 | $this->resourceClassName = $resourceClassName; 48 | $this->modelClassName = $modelClassName; 49 | } 50 | 51 | /** 52 | * @return AbstractDb 53 | */ 54 | public function getMapper(): AbstractDb 55 | { 56 | return $this->objectManager->get($this->resourceClassName); 57 | } 58 | 59 | /** 60 | * @return ExtensibleDataInterface 61 | */ 62 | public function getNewInstance(): ExtensibleDataInterface 63 | { 64 | return $this->objectManager->create($this->modelClassName); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Model/Config/Backend/Serialized/DeliveryTime.php: -------------------------------------------------------------------------------- 1 | getValue(); 25 | if (is_array($data)) { 26 | foreach ($data as $key => $row) { 27 | if (empty($row['code'])) { 28 | unset($data[$key]); 29 | continue; 30 | } 31 | } 32 | } 33 | $this->setValue($data); 34 | return parent::beforeSave(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/Config/Backend/Serialized/ExtraFields.php: -------------------------------------------------------------------------------- 1 | getValue(); 25 | if (is_array($data)) { 26 | foreach ($data as $key => $row) { 27 | if (empty($row['name']) || empty($row['attribute'])) { 28 | unset($data[$key]); 29 | continue; 30 | } 31 | } 32 | } 33 | $this->setValue($data); 34 | return parent::beforeSave(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/Config/Backend/Serialized/Filters.php: -------------------------------------------------------------------------------- 1 | getValue(); 25 | if (is_array($data)) { 26 | foreach ($data as $key => $row) { 27 | if (empty($row['attribute']) || empty($row['condition'])) { 28 | unset($data[$key]); 29 | continue; 30 | } 31 | $data[$key]['value'] = trim($row['value']); 32 | if (($row['condition'] != 'empty') && ($row['condition'] != 'not-empty')) { 33 | if (empty($row['value'])) { 34 | unset($data[$key]); 35 | continue; 36 | } 37 | } 38 | } 39 | } 40 | $this->setValue($data); 41 | return parent::beforeSave(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Model/Config/Backend/Serialized/ReturnLabel.php: -------------------------------------------------------------------------------- 1 | getValue(); 21 | if (is_array($data)) { 22 | foreach ($data as $key => $row) { 23 | if (empty($row['carrier_code'])) { 24 | unset($data[$key]); 25 | continue; 26 | } 27 | } 28 | } 29 | $this->setValue($data); 30 | return parent::beforeSave(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Model/Config/Repository.php: -------------------------------------------------------------------------------- 1 | getStoreValue(self::XML_PATH_EXTENSION_VERSION); 24 | } 25 | 26 | /** 27 | * @inheritDoc 28 | */ 29 | public function getStoreCurrencyCode(): string 30 | { 31 | try { 32 | return $this->getStore()->getCurrentCurrency()->getCode(); 33 | } catch (\Exception $e) { 34 | return 'EUR'; 35 | } 36 | } 37 | 38 | /** 39 | * {@inheritDoc} 40 | */ 41 | public function getMagentoVersion(): string 42 | { 43 | return $this->metadata->getVersion(); 44 | } 45 | 46 | /** 47 | * {@inheritDoc} 48 | */ 49 | public function getMagentoEdition(): string 50 | { 51 | return $this->metadata->getEdition(); 52 | } 53 | 54 | /** 55 | * @inheritDoc 56 | */ 57 | public function isEnabled(): bool 58 | { 59 | return $this->scopeConfig->isSetFlag(self::XML_PATH_ENABLE); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/Config/Source/CustomerGroups.php: -------------------------------------------------------------------------------- 1 | customerGroup = $customerGroup; 33 | } 34 | 35 | /** 36 | * @return array 37 | */ 38 | public function toOptionArray(): array 39 | { 40 | $groups = $this->customerGroup->toOptionArray(); 41 | foreach ($groups as $key => $group) { 42 | if ($group['value'] == '32000') { 43 | unset($groups[$key]); 44 | } 45 | } 46 | return $groups; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Model/Config/Source/ReturnLabel.php: -------------------------------------------------------------------------------- 1 | 'No', 20 | 'regex' => 'Yes, use regex', 21 | ]; 22 | 23 | /** 24 | * Options array 25 | * 26 | * @var array 27 | */ 28 | public $options = null; 29 | 30 | /** 31 | * @return array 32 | */ 33 | public function toOptionArray(): array 34 | { 35 | if (!$this->options) { 36 | foreach (self::OPTIONS as $key => $option) { 37 | $this->options[] = ['value' => $key, 'label' => __($option)]; 38 | } 39 | } 40 | return $this->options; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Model/Config/Source/ShippingMethods.php: -------------------------------------------------------------------------------- 1 | 'channable_custom', 32 | 'label' => '[channable] Use Custom Logic' 33 | ]; 34 | } 35 | return $methods; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Model/Config/Source/Status.php: -------------------------------------------------------------------------------- 1 | options) { 36 | $this->options = [ 37 | ['value' => self::NEW, 'label' => ucfirst(self::NEW)], 38 | ['value' => self::IMPORTED, 'label' => ucfirst(self::IMPORTED)], 39 | ['value' => self::ERROR, 'label' => ucfirst(self::ERROR)], 40 | ['value' => self::FAILED, 'label' => ucfirst(self::FAILED)], 41 | ]; 42 | } 43 | return $this->options; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Model/Config/System/FeedRepository.php: -------------------------------------------------------------------------------- 1 | isSetFlag(self::XML_PATH_BUNDLE_STOCK_CALCULATION, $storeId); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Model/Config/System/ItemupdateRepository.php: -------------------------------------------------------------------------------- 1 | isSetFlag(self::XML_PATH_ITEM_UPDATE_CRON); 24 | } 25 | 26 | /** 27 | * @inheritDoc 28 | */ 29 | public function getItemUpdateStoreIds(): array 30 | { 31 | $storeIds = []; 32 | if (!$this->isEnabled()) { 33 | return $storeIds; 34 | } 35 | 36 | $stores = $this->storeManager->getStores(); 37 | foreach ($stores as $store) { 38 | if (!$this->isItemUpdateEnabled((int)$store->getId())) { 39 | continue; 40 | } 41 | if (!$this->getItemUpdateWebhookUrl((int)$store->getId())) { 42 | continue; 43 | } 44 | $storeIds[] = $store->getId(); 45 | } 46 | 47 | return $storeIds; 48 | } 49 | 50 | /** 51 | * @inheritDoc 52 | */ 53 | public function isItemUpdateEnabled(?int $storeId = null): bool 54 | { 55 | return (bool)$this->getStoreValue(self::XML_PATH_ITEM_UPDATE_ENABLE, $storeId); 56 | } 57 | 58 | /** 59 | * @inheritDoc 60 | */ 61 | public function getItemUpdateWebhookUrl(int $storeId): ?string 62 | { 63 | return $this->getStoreValue(self::XML_PATH_ITEM_UPDATE_WEBHOOK, $storeId); 64 | } 65 | 66 | /** 67 | * @inheritDoc 68 | */ 69 | public function getRunLimit(): int 70 | { 71 | return (int)$this->getStoreValue(self::XML_PATH_ITEM_UPDATE_LIMIT); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Model/Config/System/ReturnsRepository.php: -------------------------------------------------------------------------------- 1 | getStoreValue(self::XML_PATH_RETURNS_ENABLE, (int)$storeId); 24 | } 25 | 26 | /** 27 | * {@inheritDoc} 28 | */ 29 | public function getReturnsWebhookUrl(int $storeId): string 30 | { 31 | $url = $this->storeManager->getStore((int)$storeId)->getBaseUrl(); 32 | return $url . sprintf('channable/returns/hook/store/%s/code/%s', $storeId, $this->getToken()); 33 | } 34 | 35 | /** 36 | * @inheritDoc 37 | */ 38 | public function autoUpdateReturnsOnCreditmemo(?int $storeId = null): bool 39 | { 40 | return (bool)$this->getStoreValue(self::XML_PATH_RETURNS_AUTO_MATCH, (int)$storeId); 41 | } 42 | 43 | /** 44 | * @inheritDoc 45 | */ 46 | public function showOnCreditmemoCreation(?int $storeId = null): bool 47 | { 48 | return $this->getStoreValue(self::XML_PATH_RETURNS_CREDITMEMO, $storeId) 49 | && $this->isReturnsEnabled($storeId); 50 | } 51 | 52 | /** 53 | * @param int|null $storeId 54 | * @return string 55 | */ 56 | public function getGtinAttribute(?int $storeId = null): string 57 | { 58 | return $this->getStoreValue(self::XML_PATH_GTIN_ATTRIBUTE, (int)$storeId) ?: 'sku'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Model/Order/ResourceModel/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 31 | ChannableOrderData::class, 32 | ChannableOrderResource::class 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Model/Payment/Channable.php: -------------------------------------------------------------------------------- 1 | date = $date; 45 | } 46 | 47 | /** 48 | * Initialize table 49 | */ 50 | protected function _construct() 51 | { 52 | $this->_init('channable_items', 'item_id'); 53 | } 54 | 55 | /** 56 | * @param \Magento\Framework\Model\AbstractModel $object 57 | * 58 | * @return $this 59 | */ 60 | protected function _beforeSave(AbstractModel $object) 61 | { 62 | $object->setUpdatedAt($this->date->gmtDate()); 63 | 64 | if (($stock = $object->getData('stock')) && !$object->getData('qty')) { 65 | $object->setQty($stock); 66 | } 67 | 68 | if ($availability = $object->getData('availability') && !($object->getData('is_in_stock'))) { 69 | $object->setIsInStock($availability); 70 | } 71 | 72 | return parent::_beforeSave($object); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Model/ResourceModel/Item/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 30 | 'Magmodules\Channable\Model\Item', 31 | 'Magmodules\Channable\Model\ResourceModel\Item' 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Model/Returns/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 31 | ChannableReturnsData::class, 32 | ChannableReturnsResource::class 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Model/Returns/ResourceModel.php: -------------------------------------------------------------------------------- 1 | _init(static::ENTITY_TABLE, static::PRIMARY); 34 | } 35 | 36 | /** 37 | * Check is entity exists 38 | * 39 | * @param int $primaryId 40 | * 41 | * @return bool 42 | */ 43 | public function isExists(int $primaryId): bool 44 | { 45 | $condition = sprintf('%s = :%s', static::PRIMARY, static::PRIMARY); 46 | $connection = $this->getConnection(); 47 | $select = $connection->select()->from( 48 | $this->getTable(static::ENTITY_TABLE), 49 | static::PRIMARY 50 | )->where($condition); 51 | $bind = [sprintf(':%s', static::PRIMARY) => $primaryId]; 52 | return (bool)$connection->fetchOne($select, $bind); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Model/Returns/ResourceModel/Grid/Collection.php: -------------------------------------------------------------------------------- 1 | getSelect()->joinLeft( 23 | ['sales_order' => $this->getTable('sales_order')], 24 | 'main_table.magento_order_id = sales_order.entity_id', 25 | [ 26 | 'order_status' => 'sales_order.status' 27 | ] 28 | )->joinLeft( 29 | ['sales_creditmemo' => $this->getTable('sales_creditmemo')], 30 | 'main_table.magento_order_id = sales_creditmemo.order_id', 31 | [ 32 | 'qty_creditmemos' => new Zend_Db_Expr('count(sales_creditmemo.entity_id)'), 33 | ] 34 | )->group('main_table.entity_id'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/Selftest/Repository.php: -------------------------------------------------------------------------------- 1 | testList = $testList; 31 | } 32 | 33 | /** 34 | * @inheritDoc 35 | */ 36 | public function test($output = true): array 37 | { 38 | $result = []; 39 | foreach ($this->testList as $data) { 40 | $result[] = $data->execute(); 41 | } 42 | return $result; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Bundle/Image.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '0', 'label' => __('No')], 34 | ['value' => '1', 'label' => __('Yes')], 35 | ['value' => '2', 'label' => __('Only if Empty (Recommended)')], 36 | ['value' => '3', 'label' => __('Combine, simple images first')], 37 | ['value' => '4', 'label' => __('Combine, parent images first')] 38 | ]; 39 | } 40 | return $this->options; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Bundle/Link.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '0', 'label' => __('No')], 34 | ['value' => '1', 'label' => __('Yes')], 35 | ]; 36 | } 37 | return $this->options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Bundle/Option.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '', 'label' => __('No')], 34 | ['value' => 'parent', 'label' => __('Only Bundle Product (Recommended)')], 35 | ['value' => 'simple', 'label' => __('Only Linked Simple Products')], 36 | ['value' => 'both', 'label' => __('Bundle and Linked Simple Products')] 37 | ]; 38 | } 39 | return $this->options; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Model/System/Config/Source/CategoryTypeList.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => 'in', 'label' => __('Include by Category')], 34 | ['value' => 'nin', 'label' => __('Exclude by Category')], 35 | ]; 36 | } 37 | return $this->options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Configurable/Image.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '0', 'label' => __('No')], 34 | ['value' => '1', 'label' => __('Yes')], 35 | ['value' => '2', 'label' => __('Only if Empty (Recommended)')], 36 | ['value' => '3', 'label' => __('Combine, simple images first')], 37 | ['value' => '4', 'label' => __('Combine, parent images first')] 38 | ]; 39 | } 40 | return $this->options; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Configurable/Link.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '0', 'label' => __('No')], 34 | ['value' => '1', 'label' => __('Yes')], 35 | ['value' => '2', 'label' => __('Yes, with Auto-Link (Recommended)')], 36 | ]; 37 | } 38 | return $this->options; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Configurable/Option.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '', 'label' => __('No')], 34 | ['value' => 'parent', 'label' => __('Only Configurable Product')], 35 | ['value' => 'simple', 'label' => __('Only Linked Simple Products (Recommended)')], 36 | ['value' => 'both', 'label' => __('Configurable and Linked Simple Products')] 37 | ]; 38 | } 39 | return $this->options; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Country.php: -------------------------------------------------------------------------------- 1 | countryCollectionFactory = $countryCollectionFactory; 34 | } 35 | 36 | /** 37 | * @return mixed 38 | */ 39 | public function toOptionArray() 40 | { 41 | return $this->countryCollectionFactory->create()->toOptionArray('-- '); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Model/System/Config/Source/CustomerGroups.php: -------------------------------------------------------------------------------- 1 | customerGroup = $customerGroup; 34 | } 35 | 36 | /** 37 | * @return mixed 38 | */ 39 | public function toOptionArray() 40 | { 41 | $groups = $this->customerGroup->toOptionArray(); 42 | foreach ($groups as $key => $group) { 43 | if ($group['value'] == '32000') { 44 | unset($groups[$key]); 45 | } 46 | } 47 | return $groups; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Grouped/Image.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '0', 'label' => __('No')], 34 | ['value' => '1', 'label' => __('Yes')], 35 | ['value' => '2', 'label' => __('Only if Empty (Recommended)')], 36 | ['value' => '3', 'label' => __('Combine, simple images first')], 37 | ['value' => '4', 'label' => __('Combine, parent images first')] 38 | ]; 39 | } 40 | return $this->options; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Grouped/Link.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '0', 'label' => __('No')], 34 | ['value' => '1', 'label' => __('Yes')], 35 | ]; 36 | } 37 | return $this->options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Grouped/Option.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '', 'label' => __('No')], 34 | ['value' => 'parent', 'label' => __('Only Grouped Product (Recommended)')], 35 | ['value' => 'simple', 'label' => __('Only Linked Simple Products')], 36 | ['value' => 'both', 'label' => __('Grouped and Linked Simple Products')] 37 | ]; 38 | } 39 | return $this->options; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Grouped/Price.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '', 'label' => __('Minimum Price (Recommended)')], 34 | ['value' => 'max', 'label' => __('Maximum Price')], 35 | ['value' => 'total', 'label' => __('Total Price')] 36 | ]; 37 | } 38 | return $this->options; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Model/System/Config/Source/InvalidationModus.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | [ 34 | 'value' => '', 35 | 'label' => __('Observer') 36 | ], 37 | [ 38 | 'value' => 'cron', 39 | 'label' => __('Cron') 40 | ] 41 | ]; 42 | } 43 | return $this->options; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Inventory.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => 'qty', 'label' => __('QTY')], 34 | ['value' => 'min_sale_qty', 'label' => __('Minimum Sales QTY')], 35 | ['value' => 'qty_increments', 'label' => __('QTY Increments')], 36 | ['value' => 'manage_stock', 'label' => __('Manage Stock')], 37 | ['value' => 'backorders', 'label' => __('Backorder Enabled')], 38 | ]; 39 | } 40 | return $this->options; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Model/System/Config/Source/ProductCondition.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => 'new', 'label' => __('New')], 34 | ['value' => 'refurbished', 'label' => __('Refurbished')], 35 | ['value' => 'used', 'label' => __('Uses')], 36 | ]; 37 | } 38 | return $this->options; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Model/System/Config/Source/ProductTypes.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | [ 34 | 'value' => '', 35 | 'label' => __('Simple & Parent Products') 36 | ], 37 | [ 38 | 'value' => 'simple', 39 | 'label' => __('Only Simple Products') 40 | ], 41 | [ 42 | 'value' => 'parent', 43 | 'label' => __('Only Parent Products') 44 | ] 45 | ]; 46 | } 47 | return $this->options; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Model/System/Config/Source/ProductVisibility.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '1', 'label' => __('Not Visible Individually')], 34 | ['value' => '2', 'label' => __('Catalog')], 35 | ['value' => '3', 'label' => __('Search')], 36 | ['value' => '4', 'label' => __('Catalog, Search')], 37 | ]; 38 | } 39 | return $this->options; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Model/System/Config/Source/ReturnsStatus.php: -------------------------------------------------------------------------------- 1 | options) { 31 | $this->options = [ 32 | [ 33 | 'value' => 'new', 34 | 'label' => __('New') 35 | ], 36 | [ 37 | 'value' => 'accepted', 38 | 'label' => __('Accepted') 39 | ], 40 | [ 41 | 'value' => 'rejected', 42 | 'label' => __('Rejected') 43 | ], 44 | [ 45 | 'value' => 'repaired', 46 | 'label' => __('Repaired') 47 | ], 48 | [ 49 | 'value' => 'exchanged', 50 | 'label' => __('Exchanged') 51 | ], 52 | [ 53 | 'value' => 'keeps', 54 | 'label' => __('Keeps') 55 | ], 56 | [ 57 | 'value' => 'cancelled', 58 | 'label' => __('Cancelled') 59 | ], 60 | ]; 61 | } 62 | return $this->options; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Model/System/Config/Source/ShippingMethods.php: -------------------------------------------------------------------------------- 1 | 'channable_custom', 33 | 'label' => '[channable] Use Custom Logic' 34 | ]; 35 | } 36 | return $methods; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Model/System/Config/Source/SourceType.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => 'static', 'label' => 'Static Values'], 34 | ['value' => 'attribute', 'label' => 'Use Attribute'] 35 | ]; 36 | } 37 | return $this->options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Status.php: -------------------------------------------------------------------------------- 1 | options) { 36 | $this->options = [ 37 | ['value' => self::NEW, 'label' => ucfirst(self::NEW)], 38 | ['value' => self::IMPORTED, 'label' => ucfirst(self::IMPORTED)], 39 | ['value' => self::ERROR, 'label' => ucfirst(self::ERROR)], 40 | ['value' => self::FAILED, 'label' => ucfirst(self::FAILED)], 41 | ]; 42 | } 43 | return $this->options; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Model/System/Config/Source/Tax.php: -------------------------------------------------------------------------------- 1 | options) { 32 | $this->options = [ 33 | ['value' => '', 'label' => __('Default')], 34 | ['value' => 'true', 'label' => __('Force Add Tax')], 35 | ]; 36 | } 37 | return $this->options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/Total/TransactionFeeCreditmemo.php: -------------------------------------------------------------------------------- 1 | getOrder()->getTransactionFee(); 25 | $creditmemo->setTransactionFee($amount); 26 | $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $amount); 27 | $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $amount); 28 | 29 | return $this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Model/Total/TransactionFeeInvoice.php: -------------------------------------------------------------------------------- 1 | getOrder()->getTransactionFee(); 25 | $invoice->setTransactionFee($amount); 26 | $invoice->setGrandTotal($invoice->getGrandTotal() + $amount); 27 | $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $amount); 28 | 29 | return $this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Observer/Catalog/ProductSaveAfter.php: -------------------------------------------------------------------------------- 1 | itemModel = $itemModel; 43 | $this->itemHelper = $itemHelper; 44 | } 45 | 46 | /** 47 | * @param Observer $observer 48 | * 49 | * @return $this 50 | */ 51 | public function execute(Observer $observer) 52 | { 53 | if (!$this->itemHelper->invalidateByObserver()) { 54 | return $this; 55 | } 56 | 57 | try { 58 | $product = $observer->getData('product'); 59 | $this->itemModel->invalidateProduct($product->getId(), self::OBSERVER_TYPE); 60 | } catch (\Exception $e) { 61 | $this->itemHelper->addTolog(self::OBSERVER_TYPE, $e->getMessage()); 62 | } 63 | 64 | return $this; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Observer/CatalogInventory/StockItemSaveAfter.php: -------------------------------------------------------------------------------- 1 | itemModel = $itemModel; 43 | $this->itemHelper = $itemHelper; 44 | } 45 | 46 | /** 47 | * @param Observer $observer 48 | * 49 | * @return $this 50 | */ 51 | public function execute(Observer $observer) 52 | { 53 | if (!$this->itemHelper->invalidateByObserver()) { 54 | return $this; 55 | } 56 | 57 | try { 58 | $stockItem = $observer->getEvent()->getItem(); 59 | $this->itemModel->invalidateProduct($stockItem->getProductId(), self::OBSERVER_TYPE); 60 | } catch (\Exception $e) { 61 | $this->itemHelper->addTolog(self::OBSERVER_TYPE, $e->getMessage()); 62 | } 63 | 64 | return $this; 65 | } 66 | } -------------------------------------------------------------------------------- /Observer/Checkout/AllSubmitAfter.php: -------------------------------------------------------------------------------- 1 | itemModel = $itemModel; 43 | $this->itemHelper = $itemHelper; 44 | } 45 | 46 | /** 47 | * @param Observer $observer 48 | * 49 | * @return $this 50 | */ 51 | public function execute(Observer $observer) 52 | { 53 | if (!$this->itemHelper->invalidateByObserver()) { 54 | return $this; 55 | } 56 | 57 | try { 58 | /** @var \Magento\Sales\Model\Order $order */ 59 | $order = $observer->getEvent()->getOrder(); 60 | if ($order) { 61 | foreach ($order->getAllItems() as $item) { 62 | if ($item->getProductType() == 'simple') { 63 | $this->itemModel->invalidateProduct($item->getProductId(), self::OBSERVER_TYPE); 64 | } 65 | } 66 | } 67 | } catch (\Exception $e) { 68 | $this->itemHelper->addTolog(self::OBSERVER_TYPE, $e->getMessage()); 69 | } 70 | 71 | return $this; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Observer/Controller/RemoveCsp.php: -------------------------------------------------------------------------------- 1 | getEvent()->getData('response'); 29 | /** @var RequestHttp $request */ 30 | $request = $observer->getEvent()->getData('request'); 31 | if (!$response || !$request) { 32 | return; 33 | } 34 | /** @todo When php7 support is dropped replace with: 'str_starts_with($request->getFullActionName(), 'channable_')' */ 35 | if (strpos($request->getFullActionName(), 'channable_') === 0) { 36 | $response->clearHeader('content-security-policy-report-only') 37 | ->clearHeader('Content-Security-Policy-Report-Only') 38 | ->clearHeader('Content-Security-Policy'); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Observer/Sales/OrderItemCancel.php: -------------------------------------------------------------------------------- 1 | itemModel = $itemModel; 43 | $this->itemHelper = $itemHelper; 44 | } 45 | 46 | /** 47 | * @param Observer $observer 48 | * 49 | * @return $this 50 | */ 51 | public function execute(Observer $observer) 52 | { 53 | if (!$this->itemHelper->invalidateByObserver()) { 54 | return $this; 55 | } 56 | 57 | try { 58 | $item = $observer->getEvent()->getItem(); 59 | $childrenItems = $item->getChildrenItems(); 60 | if (empty($childrenItems)) { 61 | $this->itemModel->invalidateProduct($item->getProductId(), self::OBSERVER_TYPE); 62 | } 63 | } catch (\Exception $e) { 64 | $this->itemHelper->addTolog(self::OBSERVER_TYPE, $e->getMessage()); 65 | } 66 | 67 | return $this; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Observer/Sales/OrderPlaceAfter.php: -------------------------------------------------------------------------------- 1 | itemHelper = $itemHelper; 37 | } 38 | 39 | /** 40 | * @param Observer $observer 41 | * 42 | * @return $this 43 | */ 44 | public function execute(Observer $observer) 45 | { 46 | try { 47 | /** @var \Magento\Sales\Model\Order $order */ 48 | $order = $observer->getEvent()->getOrder(); 49 | if ($order->getPayment()->getMethod() == 'channable') { 50 | $order->setCanSendNewEmailFlag(false); 51 | } 52 | } catch (\Exception $e) { 53 | $this->itemHelper->addTolog(self::OBSERVER_TYPE, $e->getMessage()); 54 | } 55 | return $this; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Observer/Sales/QuoteSubmitBefore.php: -------------------------------------------------------------------------------- 1 | logRepository = $logRepository; 32 | } 33 | 34 | /** 35 | * @param Observer $observer 36 | * 37 | * @return $this 38 | */ 39 | public function execute(Observer $observer) 40 | { 41 | try { 42 | /** @var \Magento\Sales\Model\Order $order */ 43 | $order = $observer->getEvent()->getOrder(); 44 | /** @var \Magento\Quote\Model\Quote\ $quote */ 45 | $quote = $observer->getEvent()->getQuote(); 46 | if ($pickupPoint = $quote->getShippingAddress()->getExtensionAttributes()->getChannablePickupLocation()) { 47 | $order->setData('channable_pickup_location', $pickupPoint); 48 | } 49 | } catch (\Exception $e) { 50 | $this->logRepository->addErrorLog('convert quote', $e->getMessage()); 51 | } 52 | return $this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Observer/SalesRule/ValidatorProcess.php: -------------------------------------------------------------------------------- 1 | getEvent()->getQuote(); 27 | if ($quote->getPayment()->getMethod() == ChannablePaymentMethod::CODE) { 28 | /** @var DiscountData $discountData */ 29 | $discountData = $observer->getEvent()->getResult(); 30 | $discountData->setAmount(0)->setBaseAmount(0); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Observer/Xtento/InvalidateProducts.php: -------------------------------------------------------------------------------- 1 | itemHelper = $itemHelper; 43 | $this->itemModel = $itemModel; 44 | } 45 | 46 | /** 47 | * Invalidate Channable Items observer for the Xtento Stock Import module. 48 | * Fired upon the xtento_stockimport_stockupdate_after event. 49 | * 50 | * @param Observer $observer 51 | * 52 | * @return $this 53 | */ 54 | public function execute(Observer $observer) 55 | { 56 | if (!$this->itemHelper->invalidateByObserver()) { 57 | return $this; 58 | } 59 | 60 | try { 61 | foreach ($observer->getModifiedStockItems() as $productId) { 62 | $this->itemModel->invalidateProduct($productId, self::INVALIDATION_TYPE); 63 | } 64 | } catch (\Exception $e) { 65 | $this->itemHelper->addTolog(self::OBSERVER_TYPE, $e->getMessage()); 66 | } 67 | 68 | return $this; 69 | } 70 | } -------------------------------------------------------------------------------- /Plugin/AddDiscountToInvoice.php: -------------------------------------------------------------------------------- 1 | getOrder(); 26 | if ($order->getPayment()->getMethod() == 'channable') { 27 | $discountAmount = abs((float)$order->getDiscountAmount()); 28 | if ($discountAmount > 0) { 29 | $invoice->setDiscountAmount(-$discountAmount); 30 | $invoice->setBaseDiscountAmount(-$discountAmount); 31 | $invoice->setGrandTotal($invoice->getGrandTotal() - $discountAmount); 32 | $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() - $discountAmount); 33 | } 34 | } 35 | 36 | return $invoice; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Plugin/AfterCheckQty.php: -------------------------------------------------------------------------------- 1 | checkoutSession = $checkoutSession; 29 | } 30 | 31 | /** 32 | * Skip CheckQty for adding products to order. 33 | * 34 | * Out-of-stock products: depending on configuration setting 35 | * LVB Orders: these orders are shipped from external warehouse 36 | * 37 | * @param StockState $subject 38 | * @param $result 39 | * 40 | * @return mixed 41 | */ 42 | public function afterCheckQty(StockState $subject, $result) 43 | { 44 | if ($this->checkoutSession->getChannableSkipQtyCheck()) { 45 | return true; 46 | } 47 | 48 | return $result; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Plugin/AfterGetBackorders.php: -------------------------------------------------------------------------------- 1 | checkoutSession = $checkoutSession; 32 | } 33 | 34 | /** 35 | * Force allow backorders for adding products to order. 36 | * 37 | * Out-of-stock products: depending on configuration setting 38 | * LVB Orders: these orders are shipped from external warehouse 39 | * 40 | * @param $subject 41 | * @param int $result 42 | * @return int $result 43 | */ 44 | public function afterGetBackorders( 45 | $subject, 46 | $result 47 | ) { 48 | if ($this->checkoutSession->getChannableSkipQtyCheck() 49 | && interface_exists(ProductSalableResultInterface::class) 50 | ) { 51 | return 1; 52 | } 53 | 54 | return $result; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Plugin/AfterGetShippingDescription.php: -------------------------------------------------------------------------------- 1 | getData('channable_pickup_location')) { 26 | $result = 'Pickup location: ' . $channablePickupLocation; 27 | } 28 | return $result; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Plugin/AfterStockItemConfiguration.php: -------------------------------------------------------------------------------- 1 | checkoutSession = $checkoutSession; 32 | } 33 | 34 | /** 35 | * Bypass Stock Item Configuration 36 | * 37 | * Out-of-stock products: depending on configuration setting 38 | * LVB Orders: these orders are shipped from external warehouse 39 | * 40 | * @param StockItemConfiguration $subject 41 | * @param bool $result 42 | * 43 | * @return bool 44 | */ 45 | public function afterIsManageStock( 46 | StockItemConfiguration $subject, 47 | bool $result 48 | ) { 49 | if ($this->checkoutSession->getChannableSkipReservation()) { 50 | return false; 51 | } 52 | 53 | return $result; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Plugin/AfterValidateMinimumAmount.php: -------------------------------------------------------------------------------- 1 | checkoutSession = $checkoutSession; 25 | } 26 | 27 | /** 28 | * Disable Minimum Order Amount for Channable orders. 29 | * 30 | * @param Quote $subject 31 | * @param bool $result 32 | * 33 | * @return bool 34 | */ 35 | public function afterValidateMinimumAmount(Quote $subject, bool $result): bool 36 | { 37 | return (bool) $this->checkoutSession->getChannableEnabled() === true ? true : $result; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Plugin/AroundCsrfValidator.php: -------------------------------------------------------------------------------- 1 | getModuleName() == 'channable') { 24 | return; 25 | } 26 | $proceed($request, $action); 27 | } 28 | } -------------------------------------------------------------------------------- /Plugin/AroundIsAllowedRequest.php: -------------------------------------------------------------------------------- 1 | getOriginalPathInfo(), '/'); 33 | if (strpos($identifier, 'channable/') !== FALSE) { 34 | return false; 35 | } 36 | 37 | return $proceed($request, $allowEmptyModuleName); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Plugin/AroundQuantityValidator.php: -------------------------------------------------------------------------------- 1 | checkoutSession = $checkoutSession; 33 | } 34 | 35 | /** 36 | * Skip QuantityValidator for adding products to order. 37 | * 38 | * Out-of-stock products: depending on configuration setting 39 | * LVB Orders: these orders are shipped from external warehouse 40 | * 41 | * @param QuantityValidatorObserver $subject 42 | * @param \Closure $proceed 43 | * @param Observer $observer 44 | * @return mixed 45 | */ 46 | public function aroundExecute( 47 | QuantityValidatorObserver $subject, 48 | $proceed, 49 | Observer $observer 50 | ) { 51 | if ($this->checkoutSession->getChannableSkipQtyCheck()) { 52 | return false; 53 | } 54 | 55 | return $proceed($observer); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Plugin/AroundSourceDeductionService.php: -------------------------------------------------------------------------------- 1 | checkoutSession = $checkoutSession; 33 | } 34 | 35 | /** 36 | * Skip QuantityValidator for adding products to order. 37 | * 38 | * Out-of-stock products: depending on configuration setting 39 | * LVB Orders: these orders are shipped from external warehouse 40 | * 41 | * @param SourceDeductionService $subject 42 | * @param \Closure $proceed 43 | * @param SourceDeductionRequestInterface $sourceDeductionRequest 44 | * @return mixed 45 | */ 46 | public function aroundExecute( 47 | SourceDeductionService $subject, 48 | $proceed, 49 | SourceDeductionRequestInterface $sourceDeductionRequest 50 | ) { 51 | if ($this->checkoutSession->getChannableSkipReservation()) { 52 | return; 53 | } 54 | 55 | return $proceed($sourceDeductionRequest); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Service/ItemUpdate/FlushItems.php: -------------------------------------------------------------------------------- 1 | resource = $resource; 31 | } 32 | 33 | /** 34 | * @return void 35 | */ 36 | public function execute(): void 37 | { 38 | $connection = $this->resource->getConnection(); 39 | $connection->query('TRUNCATE TABLE ' . $this->resource->getTableName('channable_items')); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Service/Order/Process/SendOrderEmail.php: -------------------------------------------------------------------------------- 1 | orderSender = $orderSender; 37 | $this->orderCommentHistory = $orderCommentHistory; 38 | } 39 | 40 | /** 41 | * @param OrderInterface $order 42 | * @throws CouldNotSaveException 43 | */ 44 | public function execute(OrderInterface $order) 45 | { 46 | if (!$order->getEmailSent()) { 47 | $this->orderSender->send($order); 48 | $this->orderCommentHistory->add( 49 | $order, 50 | __('The order confirmation email was sent'), 51 | true 52 | ); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Service/Order/Shipping/GetDescription.php: -------------------------------------------------------------------------------- 1 | configProvider = $configProvider; 31 | } 32 | 33 | /** 34 | * @param OrderInterface $order 35 | * @param array $orderData 36 | * @return string|null 37 | */ 38 | public function execute(OrderInterface $order, array $orderData): ?string 39 | { 40 | if ($order->getShippingMethod(true)->getMethod() !== ChannableCarrier::CODE) { 41 | return null; 42 | } 43 | 44 | $title = str_replace( 45 | '{{channable_channel_label}}', 46 | !empty($orderData['channable_channel_label']) ? $orderData['channable_channel_label'] : 'Channable', 47 | $this->configProvider->getCarrierTitle($order->getStoreId()) 48 | ); 49 | 50 | $name = str_replace( 51 | '{{shipment_method}}', 52 | !empty($orderData['shipment_method']) ? $orderData['shipment_method'] : 'Shipping', 53 | $this->configProvider->getCarrierName($order->getStoreId()) 54 | ); 55 | 56 | return implode(' - ', [$title, $name]); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Service/Product/InventorySource.php: -------------------------------------------------------------------------------- 1 | resourceConnection = $resourceConnection; 37 | $this->moduleManager = $moduleManager; 38 | } 39 | 40 | /** 41 | * Returns inventory source (stock_id) by websiteCode 42 | * 43 | * @param string $websiteCode 44 | * 45 | * @return null|int 46 | */ 47 | public function execute(string $websiteCode): ?int 48 | { 49 | if (!$this->isMsiEnabled()) { 50 | return null; 51 | } 52 | 53 | $connection = $this->resourceConnection->getConnection(); 54 | $tableName = $this->resourceConnection->getTableName('inventory_stock_sales_channel'); 55 | 56 | if (!$connection->isTableExists($tableName)) { 57 | return null; 58 | } 59 | 60 | $select = $connection->select() 61 | ->from($tableName, ['stock_id']) 62 | ->where('code = ?', $websiteCode) 63 | ->limit(1); 64 | 65 | return (int)$connection->fetchOne($select); 66 | } 67 | 68 | /** 69 | * Check if MSI is enabled 70 | * 71 | * @return bool 72 | */ 73 | public function isMsiEnabled(): bool 74 | { 75 | return $this->moduleManager->isEnabled('Magento_Inventory'); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Service/Returns/GetReturnStatus.php: -------------------------------------------------------------------------------- 1 | resource = $resource; 36 | } 37 | 38 | /** 39 | * @param int $id 40 | * @return array 41 | */ 42 | public function execute(int $id): array 43 | { 44 | $connection = $this->resource->getConnection(); 45 | $selectReturn = $connection->select()->from( 46 | $this->resource->getTableName('channable_returns'), 47 | 'status' 48 | )->where('entity_id = ?', $id); 49 | $status = $connection->fetchOne($selectReturn); 50 | if ($status !== false) { 51 | return [ 52 | 'validated' => 'true', 53 | 'return_id' => $id, 54 | 'status' => $status 55 | ]; 56 | } 57 | return [ 58 | 'validated' => 'false', 59 | 'errors' => __(self::NO_SUCH_ENTITY_EXCEPTION, $id)->render() 60 | ]; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Service/Returns/JsonResponse.php: -------------------------------------------------------------------------------- 1 | returnsRepository = $returnsRepository; 32 | } 33 | 34 | /** 35 | * @param array $params 36 | * 37 | * @return array 38 | */ 39 | public function execute(array $params): array 40 | { 41 | $result = []; 42 | 43 | if (empty($params['id'])) { 44 | $result['status'] = 'error'; 45 | $result['msg'] = __('Id missing'); 46 | return $result; 47 | } 48 | 49 | if (empty($params['type'])) { 50 | $result['status'] = 'error'; 51 | $result['msg'] = __('Type missing'); 52 | return $result; 53 | } 54 | 55 | try { 56 | $return = $this->returnsRepository->get((int)$params['id']); 57 | } catch (Exception $e) { 58 | return [ 59 | 'status' => 'error', 60 | 'msg' => $e->getMessage() 61 | ]; 62 | } 63 | 64 | try { 65 | $return->setStatus($params['type']); 66 | $this->returnsRepository->save($return); 67 | $result['status'] = 'success'; 68 | $result['msg'] = __('Return processed, new status: %1', $params['type']); 69 | } catch (Exception $e) { 70 | $result['status'] = 'error'; 71 | $result['msg'] = $e->getMessage(); 72 | } 73 | 74 | return $result; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Service/Test/PhpExtensions.php: -------------------------------------------------------------------------------- 1 | self::TYPE, 58 | 'test' => self::TEST, 59 | 'visible' => self::VISIBLE, 60 | 61 | ]; 62 | $installedExtension = get_loaded_extensions(); 63 | $extDiff = array_diff(self::REQUIRED_PHP_MODULES, $installedExtension); 64 | if (count($extDiff) == self::EXPECTED) { 65 | $result['result_msg'] = self::SUCCESS_MSG; 66 | $result += 67 | [ 68 | 'result_code' => 'success' 69 | ]; 70 | } else { 71 | $result['result_msg'] = sprintf( 72 | self::FAILED_MSG, 73 | implode(', ', $extDiff) 74 | ); 75 | $result += 76 | [ 77 | 'result_code' => 'failed' 78 | ]; 79 | } 80 | 81 | return $result; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Service/Test/PhpVersion.php: -------------------------------------------------------------------------------- 1 | self::TYPE, 58 | 'test' => self::TEST, 59 | 'visible' => self::VISIBLE 60 | ]; 61 | if (version_compare(self::EXPECTED, PHP_VERSION) <= 0) { 62 | $result += 63 | [ 64 | 'result_msg' => sprintf(self::SUCCESS_MSG, PHP_VERSION), 65 | 'result_code' => 'success' 66 | ]; 67 | } else { 68 | $result['result_msg'] = sprintf( 69 | self::FAILED_MSG, 70 | self::EXPECTED, 71 | PHP_VERSION 72 | ); 73 | $result += 74 | [ 75 | 'result_code' => 'failed', 76 | 'support_link' => self::SUPPORT_LINK 77 | ]; 78 | } 79 | return $result; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Service/Token/Generate.php: -------------------------------------------------------------------------------- 1 | configProvider = $configProvider; 26 | } 27 | 28 | /** 29 | * @param bool $force 30 | * @return void 31 | */ 32 | public function execute(bool $force = false): void 33 | { 34 | if ($force || !$this->configProvider->getToken()) { 35 | $this->configProvider->setToken( 36 | $this->getRandomString() 37 | ); 38 | } 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | private function getRandomString(): string 45 | { 46 | $token = ''; 47 | $chars = str_split("abcdefghijklmnopqrstuvwxyz0123456789"); 48 | for ($i = 0; $i < 64; $i++) { 49 | $token .= $chars[array_rand($chars)]; 50 | } 51 | 52 | return $token; 53 | } 54 | } -------------------------------------------------------------------------------- /Setup/Patch/Data/CreateToken.php: -------------------------------------------------------------------------------- 1 | generateToken = $generateToken; 37 | $this->moduleDataSetup = $moduleDataSetup; 38 | } 39 | 40 | /** 41 | * @inheritdoc 42 | */ 43 | public static function getDependencies() 44 | { 45 | return []; 46 | } 47 | 48 | /** 49 | * @inheritdoc 50 | */ 51 | public function apply() 52 | { 53 | $this->moduleDataSetup->getConnection()->startSetup(); 54 | $this->generateToken->execute(); 55 | $this->moduleDataSetup->getConnection()->endSetup(); 56 | } 57 | 58 | /** 59 | * @inheritdoc 60 | */ 61 | public function getAliases() 62 | { 63 | return []; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Item/Actions.php: -------------------------------------------------------------------------------- 1 | getData('name'); 33 | $item[$name]['update'] = [ 34 | 'href' => $this->context->getUrl(self::ROUTE, ['item_id' => $item['item_id']]), 35 | 'label' => __('Run Update') 36 | ]; 37 | 38 | } 39 | } 40 | 41 | return $dataSource; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Order/Billing.php: -------------------------------------------------------------------------------- 1 | getData('name')]) { 30 | $item[$this->getData('name')] = $this->getFormattedBillingData($item); 31 | } 32 | } 33 | } 34 | return $dataSource; 35 | } 36 | 37 | /** 38 | * Get formatted billing data with hoover table 39 | * 40 | * @param array $item 41 | * @return string 42 | */ 43 | private function getFormattedBillingData(array $item): string 44 | { 45 | try { 46 | $billingData = $this->json->unserialize($item['billing']); 47 | } catch (Exception $e) { 48 | return '--'; 49 | } 50 | 51 | return sprintf( 52 | '%s
%s
%s
', 53 | $this->getCustomerName($billingData), 54 | $this->getCustomerName($billingData), 55 | $this->getFormattedTable($billingData) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Order/Customer.php: -------------------------------------------------------------------------------- 1 | getData('name')]) { 30 | $item[$this->getData('name')] = $this->getFormattedCustomerData($item); 31 | } 32 | } 33 | } 34 | return $dataSource; 35 | } 36 | 37 | /** 38 | * Get formatted customer data with hoover table 39 | * 40 | * @param array $item 41 | * @return string 42 | */ 43 | private function getFormattedCustomerData(array $item): string 44 | { 45 | try { 46 | $customerData = $this->json->unserialize($item['customer']); 47 | } catch (Exception $e) { 48 | return '--'; 49 | } 50 | 51 | return sprintf( 52 | '%s
%s
%s
', 53 | $this->getCustomerName($customerData), 54 | $this->getCustomerName($customerData), 55 | $this->getFormattedTable($customerData) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Order/Error.php: -------------------------------------------------------------------------------- 1 | getData('name')]) { 28 | $item[$this->getData('name')] = $this->getFormattedErrorData($item); 29 | } 30 | } 31 | } 32 | return $dataSource; 33 | } 34 | 35 | /** 36 | * Get formatted error data with hoover table 37 | * 38 | * @param array $item 39 | * @return string 40 | */ 41 | private function getFormattedErrorData(array $item): string 42 | { 43 | $message = explode(',', (string)$item['error_msg']); 44 | if (count($message) == 1) { 45 | if (strlen($item['error_msg']) < 30) { 46 | return $item['error_msg']; 47 | } else { 48 | return sprintf( 49 | '%s
%s
%s
', 50 | substr($item['error_msg'], 0, 30), 51 | substr($item['error_msg'], 0, 30), 52 | substr($item['error_msg'], 30, strlen($item['error_msg'])) 53 | ); 54 | } 55 | } 56 | $shortMessage = array_shift($message); 57 | return sprintf( 58 | '%s
%s
%s
', 59 | $shortMessage, 60 | $shortMessage, 61 | implode(',', $message) 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Order/Price.php: -------------------------------------------------------------------------------- 1 | getData('name')]) { 30 | $item[$this->getData('name')] = $this->getFormattedPriceData($item); 31 | } 32 | } 33 | } 34 | return $dataSource; 35 | } 36 | 37 | /** 38 | * Get formatted price data with hoover table 39 | * 40 | * @param array $item 41 | * @return string 42 | */ 43 | private function getFormattedPriceData(array $item): string 44 | { 45 | try { 46 | $priceData = $this->json->unserialize($item['price']); 47 | } catch (Exception $e) { 48 | return '--'; 49 | } 50 | 51 | return sprintf( 52 | '%s
%s
%s
', 53 | $this->getFormattedPrice($priceData), 54 | $this->getFormattedPrice($priceData), 55 | $this->getFormattedTable($priceData) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Order/Products.php: -------------------------------------------------------------------------------- 1 | getData('name')]) { 30 | $item[$this->getData('name')] = $this->getFormattedProductData($item); 31 | } 32 | } 33 | } 34 | return $dataSource; 35 | } 36 | 37 | /** 38 | * Get formatted product data with hoover table 39 | * 40 | * @param array $item 41 | * @return string 42 | */ 43 | private function getFormattedProductData(array $item): string 44 | { 45 | try { 46 | $productData = $this->json->unserialize($item['products']); 47 | } catch (Exception $e) { 48 | return '--'; 49 | } 50 | 51 | $products = []; 52 | foreach ($productData as $product) { 53 | $products[] = sprintf( 54 | '%s
%s
%s
', 55 | $this->getFormattedProduct($product), 56 | $this->getFormattedProduct($product), 57 | $this->getFormattedTable($product) 58 | ); 59 | } 60 | 61 | return implode('
', $products); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Order/Shipping.php: -------------------------------------------------------------------------------- 1 | getData('name')]) { 30 | $item[$this->getData('name')] = $this->getFormattedShippingData($item); 31 | } 32 | } 33 | } 34 | return $dataSource; 35 | } 36 | 37 | /** 38 | * Get formatted shipping data with hoover table 39 | * 40 | * @param array $item 41 | * @return string 42 | */ 43 | private function getFormattedShippingData(array $item): string 44 | { 45 | try { 46 | $shippingData = $this->json->unserialize($item['shipping']); 47 | } catch (Exception $e) { 48 | return '--'; 49 | } 50 | 51 | return sprintf( 52 | '%s
%s
%s
', 53 | $this->getCustomerName($shippingData), 54 | $this->getCustomerName($shippingData), 55 | $this->getFormattedTable($shippingData) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Returns/Creditmemo.php: -------------------------------------------------------------------------------- 1 | #%s'; 19 | 20 | /** 21 | * Prepare Data Source 22 | * 23 | * @param array $dataSource 24 | * 25 | * @return array 26 | */ 27 | public function prepareDataSource(array $dataSource): array 28 | { 29 | if (isset($dataSource['data']['items'])) { 30 | foreach ($dataSource['data']['items'] as & $item) { 31 | if ($item['magento_creditmemo_id']) { 32 | $orderUrl = $this->context->getUrl( 33 | 'sales/creditmemo/view/', 34 | ['creditmemo_id' => $item['magento_creditmemo_id']] 35 | ); 36 | $item['magento_creditmemo_increment_id'] = sprintf( 37 | self::ORDER_URL, 38 | $orderUrl, 39 | $item['magento_creditmemo_increment_id'] 40 | ); 41 | } 42 | } 43 | } 44 | return $dataSource; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Returns/Order.php: -------------------------------------------------------------------------------- 1 | #%s'; 19 | 20 | /** 21 | * Prepare Data Source 22 | * 23 | * @param array $dataSource 24 | * 25 | * @return array 26 | */ 27 | public function prepareDataSource(array $dataSource): array 28 | { 29 | if (isset($dataSource['data']['items'])) { 30 | foreach ($dataSource['data']['items'] as & $item) { 31 | $incrementId = !empty($item['magento_increment_id']) ? $item['magento_increment_id'] : null; 32 | $orderId = !empty($item['magento_order_id']) ? $item['magento_order_id'] : null; 33 | if ($orderId > 0) { 34 | $orderUrl = $this->context->getUrl( 35 | 'sales/order/view/', 36 | ['order_id' => $orderId] 37 | ); 38 | $item['magento_increment_id'] = sprintf( 39 | self::ORDER_URL, 40 | $orderUrl, 41 | $incrementId 42 | ); 43 | } 44 | } 45 | } 46 | return $dataSource; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Returns/Reason.php: -------------------------------------------------------------------------------- 1 | ' . $comment; 33 | } 34 | } 35 | } 36 | return $dataSource; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Ui/Component/Listing/Column/Returns/Status.php: -------------------------------------------------------------------------------- 1 | =102.0.3", 10 | "ext-json": "*", 11 | "php": ">=7.4.0" 12 | }, 13 | "autoload": { 14 | "files": [ 15 | "registration.php" 16 | ], 17 | "psr-4": { 18 | "Magmodules\\Channable\\": "" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /etc/adminhtml/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /etc/adminhtml/system.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /etc/adminhtml/system/payment.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | Magento\Config\Model\Config\Source\Yesno 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /etc/crontab.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | */5 * * * * 12 | crontab/default/jobs/channable_item_update/schedule/cron_expr 13 | 14 | 15 | 0 0 * * * 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /etc/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /etc/extension_attributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /etc/fieldset.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 |
9 | 10 | 11 | 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /etc/frontend/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /etc/frontend/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /etc/frontend/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /etc/payment.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 0 13 | 14 | 15 | -------------------------------------------------------------------------------- /etc/pdf.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | Marketplace Transaction Fee 10 | transaction_fee 11 | 7 12 | false 13 | Magento\Sales\Model\Order\Pdf\Total\DefaultTotal 14 | 500 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /etc/sales.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |
10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /view/adminhtml/layout/channable_order_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /view/adminhtml/layout/channable_returns_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_creditmemo_new.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_creditmemo_updateqty.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_creditmemo_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_invoice_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /view/adminhtml/templates/info/pdf/channable_payment.phtml: -------------------------------------------------------------------------------- 1 | 13 | escapeHtml($block->getMethod()->getTitle()); ?>{{pdf_row_separator}} 14 | 15 | getSpecificInformation()):?> 16 | $value):?> 17 | escapeHtml($label) ?>: 18 | escapeHtml(implode(' ', $block->getValueAsArray($value)));?> 19 | {{pdf_row_separator}} 20 | 21 | 22 | 23 | escapeHtml(implode('{{pdf_row_separator}}', $block->getChildPdfAsArray())); ?> 24 | -------------------------------------------------------------------------------- /view/adminhtml/templates/order/creditmemo/view/returns.phtml: -------------------------------------------------------------------------------- 1 | 10 | autoUpdateReturnsOnCreditmemo(); ?> 11 | showOnCreditmemoCreation() && $returns = $block->checkForReturns()): ?> 12 |
13 |
14 | 15 | escapeHtml(__('Available Channable Returns')) ?> 16 | 17 | 18 |

19 | escapeHtml(__($autoAccTxt)) ?> 20 |

21 | 22 |
23 |
24 | $return): ?> 25 | 26 | 32 | 33 | Auto-matched Items
34 | 35 | 40 | 41 |
42 |
43 | 44 | -------------------------------------------------------------------------------- /view/adminhtml/templates/order/table-tooltip-js.phtml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/button/selftest.phtml: -------------------------------------------------------------------------------- 1 | 14 | 15 |
17 |
18 | 19 |
20 |
21 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/button/version.phtml: -------------------------------------------------------------------------------- 1 | 14 | 15 |
17 | escapeHtml($block->getVersion()); ?> 18 | 19 |
20 | getButtonHtml() ?> 21 |
22 | 23 |
24 |
26 |
27 |
    28 |
    29 |
    30 |
    31 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/fieldset/table/itemupdates.phtml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 20 | 23 | 26 | 27 | 28 | getStoreData() as $store): ?> 29 | 30 | 33 | 36 | 39 | 42 | 43 | 44 | 45 |
    15 | escapeHtml(__('Store')) ?> 16 | 18 | escapeHtml(__('Updates')) ?> 19 | 21 | escapeHtml(__('Webhook')) ?> 22 | 24 | escapeHtml(__('Items')) ?> 25 |
    31 | escapeHtml($store['name']); ?> 32 | 34 | escapeHtml($store['enabled']); ?> 35 | 37 | escapeHtml($store['webhook']); ?> 38 | 40 | escapeHtml($store['qty']); ?> 41 |
    46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/fieldset/table/orders.phtml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 20 | 23 | 24 | 25 | getStoreData() as $store): ?> 26 | 27 | 30 | 33 | 38 | 39 | 40 | 41 |
    15 | escapeHtml(__('Store')) ?> 16 | 18 | escapeHtml(__('Webhook')) ?> 19 | 21 | escapeHtml(__('Test')) ?> 22 |
    28 | escapeHtml($store['name']); ?> 29 | 31 | 32 | 34 | 35 | escapeHtml(__('Import Test Order')) ?> 36 | 37 |
    42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/fieldset/table/returns.phtml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 20 | 23 | 24 | 25 | getStoreData() as $store): ?> 26 | 27 | 30 | 33 | 42 | 43 | 44 | 45 |
    15 | escapeHtml(__('Store')) ?> 16 | 18 | escapeHtml(__('Webhook')) ?> 19 | 21 | escapeHtml(__('Test')) ?> 22 |
    28 | escapeHtml($store['name']); ?> 29 | 31 | 32 | 34 | 35 | escapeHtml(__('Import Test Return')) ?> 36 | 37 |
    38 | 39 | escapeHtml(__('Import Test Return with new Order')) ?> 40 | 41 |
    46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /view/adminhtml/ui_component/catalogstaging_category_update_form.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 |
    10 |
    11 | 12 | 13 | Channable 14 | true 15 | 100 16 | 17 | 18 | 19 | 20 | 21 | 1 22 | boolean 23 | checkbox 24 | toggle 25 | Disable Category from export 26 | 27 | 1 28 | 0 29 | 30 | 31 | false 32 | 33 | 0 34 | 35 | 36 | 37 |
    38 |
    -------------------------------------------------------------------------------- /view/adminhtml/ui_component/category_form.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 |
    10 |
    11 | 12 | 13 | Channable 14 | true 15 | 100 16 | 17 | 18 | 19 | 20 | 21 | 1 22 | boolean 23 | checkbox 24 | toggle 25 | Disable Category from export 26 | 27 | 1 28 | 0 29 | 30 | 31 | false 32 | 33 | 0 34 | 35 | 36 | 37 |
    38 |
    -------------------------------------------------------------------------------- /view/adminhtml/web/css/source/_module.less: -------------------------------------------------------------------------------- 1 | // 2 | // Imports 3 | // --------------------------------------------- 4 | 5 | @import './variables/_colors.less'; 6 | @import './module/ui/_button.less'; 7 | @import './module/ui/_modal.less'; 8 | 9 | @import './module/_header.less'; 10 | @import './module/_version.less'; 11 | @import './module/_debug.less'; 12 | 13 | @import './extend/_additional.less'; 14 | 15 | 16 | // 17 | // Common styles 18 | // --------------------------------------------- 19 | 20 | .admin__page-nav._collapsed.channable-tab .title:before { 21 | display: none; 22 | } 23 | 24 | .admin__page-nav._collapsed.channable-tab .title, 25 | .admin__page-nav._collapsed._show.channable-tab .title { 26 | background-image: url('@{baseDir}Magmodules_Channable/images/channable-logo.png') !important; 27 | background-position: 18px center; 28 | background-repeat: no-repeat; 29 | text-indent: 50px; 30 | background-size: auto 60%; 31 | } 32 | 33 | #row_magmodules_channable_debug_error_button .value { 34 | padding-top: 8px; 35 | } 36 | -------------------------------------------------------------------------------- /view/adminhtml/web/css/source/module/_header.less: -------------------------------------------------------------------------------- 1 | // 2 | // Header 3 | // --------------------------------------------- 4 | 5 | form[action*="channable"] { 6 | .magmodules-channable-variables(); 7 | 8 | .mm-ui-header { 9 | display: flex; 10 | flex-wrap: wrap; 11 | align-items: center; 12 | justify-content: space-between; 13 | gap: 25px; 14 | margin-bottom: 25px; 15 | padding: 1.8rem 1.8rem 1.8rem 9.5rem; 16 | 17 | border: 1px solid fade(@mm-ui-color3, 25%); 18 | border-left: 4px solid @mm-ui-channable1; 19 | border-radius: 8px; 20 | background: ~'no-repeat 2rem 2.5rem / 5rem'; 21 | 22 | font-size: 1.3rem; 23 | text-align: left; 24 | } 25 | 26 | .mm-ui-header-text { 27 | display: grid; 28 | grid-gap: 4px; 29 | margin-top: 4px; 30 | 31 | strong { 32 | margin-bottom: 2px; 33 | font-size: 1.4rem; 34 | } 35 | 36 | div { 37 | max-width: 320px; 38 | } 39 | } 40 | 41 | .mm-ui-header-actions { 42 | display: flex; 43 | flex-wrap: wrap; 44 | gap: 16px; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /view/adminhtml/web/css/source/variables/_colors.less: -------------------------------------------------------------------------------- 1 | .magmodules-channable-variables() { 2 | @mm-ui-color1: #f8f8f8; 3 | @mm-ui-color2: #edeff1; 4 | @mm-ui-color3: #b4b4b4; 5 | @mm-ui-color4: #514943; 6 | @mm-ui-color5: #41362f; 7 | @mm-ui-color6: #79a12d; 8 | @mm-ui-color7: #b41f1f; 9 | @mm-ui-color8: #f9e063; 10 | 11 | @mm-ui-channable1: #109cd8; 12 | @mm-ui-channable2: #e33b8f; 13 | @mm-ui-channable3: #f9c621; 14 | @mm-ui-channable4: #1b1a3a; 15 | } 16 | -------------------------------------------------------------------------------- /view/adminhtml/web/images/channable-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magmodules/magento2-channable/fa3eb1dd9918e0595adc2078715e41a14663e09c/view/adminhtml/web/images/channable-logo.png -------------------------------------------------------------------------------- /view/adminhtml/web/js/order-table-tooltip.js: -------------------------------------------------------------------------------- 1 | define(['jquery'], function($) { 2 | 'use strict'; 3 | 4 | document.body.addEventListener('click', (e) => { 5 | let tooltip = e.target.closest('.grid-more-info'), 6 | allTooltips = Array.from(document.querySelectorAll('.grid-more-info')); 7 | 8 | allTooltips.forEach((item) => { item.classList.remove('show') }); 9 | 10 | if (tooltip) { 11 | e.preventDefault(); 12 | tooltip.classList.add('show'); 13 | } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /view/adminhtml/web/template/grid/order_import_status.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /view/frontend/templates/info/channable_payment.phtml: -------------------------------------------------------------------------------- 1 | getSpecificInformation(); 13 | $title = $escaper->escapeHtml($block->getMethod()->getTitle()); 14 | ?> 15 |
    16 |
    17 | 18 |
    19 | 20 | 21 | $value):?> 22 | 23 | 24 | 29 | 30 | 31 |
    escapeHtml($label)?> 25 | escapeHtml( 26 | implode("\n", $block->getValueAsArray($value, true)) 27 | ));?> 28 |
    32 |
    33 | 34 |
    35 | getChildHtml()?> 36 | --------------------------------------------------------------------------------