Hi Team I have added a GUI module in merchant port...
# help
a
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 ?
g
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
a
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 ?
g
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
Copy code
$aclEntityMetadataCollectionTransfer->addAclEntityMetadata(
            'Orm\Zed\Customer\Persistence\SpyCustomer',
            (new AclEntityMetadataTransfer())
                ->setEntityName('Orm\Zed\Customer\Persistence\SpyCustomer')
                
                ->setDefaultGlobalOperationMask(
                    AclEntityConstants::OPERATION_MASK_READ,
                ),
        );
a
Thanks Mate. It worked . Also needed to add Customer in Allow list in expandAclEntityMetadataConfigWithAllowList method