/pimcore-bundle-magento

Pimcore bundle MagentoIntegration

Primary LanguagePHP

Greenrivers MagentoIntegration Bundle

Installation

  1. Copy the contents of this module to bundles/Greenrivers/Bundle/MagentoIntegrationBundle
  2. Run php bin/console pimcore:bundle:install GreenriversMagentoIntegrationBundle

Config

Settings->Greenrivers->Magento Integration

General

Magento Url - Magento base url (ending with slash)
Magento Token - Magento integration token (Bearer auth)

Magento

Send Product to Magento after save - send product to Magento after saving DataObject in Pimcore
Send Category to Magento after save - send category to Magento after saving DataObject in Pimcore

Usage

Create product

  1. Open folder: Data Objects->Greenrivers->MagentoIntegration->Products
  2. Add Object->Greenrivers->MagentoIntegrationProduct
  3. Save & Publish product.
  4. Pimcore sends product to Magento.

Create category

  1. Open folder: Data Objects->Greenrivers->MagentoIntegration->Categories
  2. Add Object->Greenrivers->MagentoIntegrationCategory
  3. Save & Publish category.
  4. Pimcore sends category to Magento.

Endpoints

https://app.pimcore.test/pimcore-graphql-webservices/greenrivers

Authorization: apikey (GraphQL DataHub apikey)

Get products

{
    getMagentoIntegrationProductListing {
        edges {
            node {
                id
                status
                attributeSetId
                name
                sku
                price
            }
        }
    }
}

Get categories

{
    getMagentoIntegrationCategoryListing {
        edges {
            node {
                id
                isActive
                includeInMenu
                name
                parentCategoryId
            }
        }
    }
}

Errors

Errors are logged into var/log/greenrivers/magento_integration.log folder.

Testing

Run tests:

(due to problem with null container in 2nd test in SettingsControllerTest, comment one test method before test)

 vendor/bin/simple-phpunit bundles/Greenrivers/Bundle/MagentoIntegrationBundle/tests

Sources

https://pimcore.com/docs/platform/Datahub/GraphQL/#external-access

https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-token/#integration-tokens