Installation:
composer require akeneo/piivo-connector:1.1.*
Enable the bundle in AppKernel.php:
new Piivo\Bundle\ConnectorBundle\PiivoConnectorBundle(),
new Pim\Bundle\ExtendedAttributeTypeBundle\PimExtendedAttributeTypeBundle(),
Routing:
Add to app/config/routing.yml:
piivo_api:
resource: "@PiivoConnectorBundle/Resources/config/routing.yml"
prefix: /api
Elasticsearch Configuration:
Update app/config/pim_parameters.yml to include:
elasticsearch_index_configuration_files:
- '%kernel.root_dir%/../vendor/akeneo/extended-attribute-type/src/Resources/config/elasticsearch/index_configuration.yml'
Clear Cache & Rebuild Indexes (if upgrading):
php bin/console cache:clear --no-warmup --env=prod
php bin/console akeneo:elasticsearch:reset-indexes --env=prod
php bin/console pim:product:index --all --env=prod
Sync a Product with PiiVO DAM: Use the API to push product images/metadata to PiiVO:
curl -X POST -H "Content-Type: application/json" \
http://your-pim/api/piivo/sync \
-d '{"productId": "PRODUCT_SKU", "piivoAssetId": "ASSET_ID"}'
Product Asset Sync:
/api/piivo/sync) with productId and piivoAssetId.PiiVOConnectorBundle services to validate and process assets.Extended Attributes:
ExtendedAttributeTypeBundle to map custom fields (e.g., piivo_asset_reference) to PiiVO DAM.{{ form_row(product.form.piivo_asset_reference) }}
Event Listeners:
ProductUpdateEvent) to auto-sync assets:
// src/Akeneo/Pim/EventListener/PiiVOListener.php
public function onProductUpdate(ProductUpdateEvent $event) {
$product = $event->getProduct();
if ($product->getPiivoAssetId()) {
$this->piivoService->sync($product);
}
}
Batch Processing:
pim:job:execute) to sync assets for multiple products:
php bin/console pim:job:execute piivo-sync-job
api_login token).monolog:
$logger->error('PiiVO sync failed', ['product' => $product->getId(), 'error' => $e->getMessage()]);
$this->get('piivo.client')->method('post')->willReturn(['success' => true]);
Deprecated Dependencies:
akeneo/extended-attribute-type).Elasticsearch Index Conflicts:
reset-indexes fails, manually delete indices in Elasticsearch:
curl -XDELETE 'http://localhost:9200/pim_product*'
--env=dev for testing before production.API Rate Limits:
use Symfony\Component\HttpClient\RetryStrategy;
$client = HttpClient::create([
'retry_strategy' => new RetryStrategy(3, 1000, true),
]);
Missing Documentation:
bin/console debug:router | grep piivo to discover endpoints.PiivoConnectorBundle/Resources/config/routing.yml for undocumented routes.Enable API Debugging:
Add to config.yml:
piivo_connector:
debug: true
Logs will appear in var/log/dev.log.
Common Issues:
routing.yml prefix (/api) and bundle enablement.var/log/prod.log for Piivo\Exception\* exceptions.piivoAssetId exists in PiiVO DAM before sync.Custom Sync Logic:
Extend PiivoSyncService:
class CustomPiiVOService extends PiivoSyncService {
protected function preSync(Product $product) {
// Add pre-processing (e.g., transform images)
}
}
Override in services.yml:
piivo.sync_service: '@custom_piivo_service'
New API Endpoints:
Create a custom controller extending PiivoBaseController:
class CustomPiiVOController extends PiivoBaseController {
public function customAction() {
// Extend existing API
}
}
Register in routing.yml:
custom_piivo:
path: /api/piivo/custom
defaults: { _controller: PiivoConnectorBundle:CustomPiiVO:custom }
Webhook Integration:
Use Akeneo’s WebhookBundle to trigger PiiVO syncs on product events:
# config/webhooks.yml
piivo_sync_webhook:
name: "PiiVO Sync"
url: "http://your-pim/api/piivo/sync"
events: ["product_update"]
How can I help you explore Laravel packages today?