What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi Team,
I have added a GUI module in merchant portal, and want to display customer list for the same . I am using Customer Facade for the same, but unable to get the customer list . Is there anything else that needs to be done ?
I'm not sure if this is your case but you need to expand the permissions to be able to access other objects from the Merchant Portal
you can check here vendor/spryker/acl-merchant-portal/src/Spryker/Zed/AclMerchantPortal/Business/Expander/AclEntity/AclEntityMetadataConfigExpander.php
I have created a dataprovider using customerQuery and customerCollection , but the collection is returning empty sets
This is the repository code
$customerQuery = $this->buildCustomerTableBaseQuery(
$customerTableCriteriaTransfer
);
//print_r($productOfferQuery);
$propelPager = $customerQuery->paginate(
$customerTableCriteriaTransfer->requirePage()->getPage(),
$customerTableCriteriaTransfer->requirePageSize()->getPageSize(),
);
However
$propelPager->getResults()->getData()
return empty
protected function buildCustomerTableBaseQuery(
CustomerTableCriteriaTransfer $customerTableCriteriaTransfer
): SpyCustomerQuery {
$customerQuery = $this->getFactory()->getCustomerPropelQuery();
$customerQuery
->addAsColumn(CustomerTransfer::CUSTOMER_REFERENCE, SpyCustomerTableMap::COL_CUSTOMER_REFERENCE)
->addAsColumn(CustomerTransfer::FIRST_NAME , SpyCustomerTableMap::COL_FIRST_NAME)
->addAsColumn(CustomerTransfer::LAST_NAME , SpyCustomerTableMap::COL_LAST_NAME)
->addAsColumn(CustomerTransfer::EMAIL , SpyCustomerTableMap::COL_EMAIL)
->select([
customerTransfer::CUSTOMER_REFERENCE,
CustomerTransfer::FIRST_NAME,
CustomerTransfer::LAST_NAME,
CustomerTransfer::EMAIL
]);
return $customerQuery;
}
Anything we can get on this issue ?
your code looks ok, so it's probably what I referenced in my previous message, when you don't have the ACL permissions configured for an object in the merchant portal, the query will just return an empty result, as a test you can just include the customer object to the file in the vendor folder, something like this
$aclEntityMetadataCollectionTransfer->addAclEntityMetadata( 'Orm\Zed\Customer\Persistence\SpyCustomer', (new AclEntityMetadataTransfer()) ->setEntityName('Orm\Zed\Customer\Persistence\SpyCustomer') ->setDefaultGlobalOperationMask( AclEntityConstants::OPERATION_MASK_READ, ), );
Thanks Mate. It worked . Also needed to add Customer in Allow list in expandAclEntityMetadataConfigWithAllowList method