-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mapper to fit response with needed schema and add a way to extend it #49
Conversation
Hi @cewald @afirlejczyk , I didn’t have time to work more on the sorry mapper. Why did this PR ask to be closed ? I’ve been working with bridge for 1 year and it’s the mapper without the @cewald update. I make a new setup with But if we could give a little summary of what has been done and what is wrong :) Thanks |
This was about to have a way to extend the types of mapped fields without extending the module. Like if you have custom mappings for specific fields because your system is e.g. hooked to a merchandise management system which depends on specific field-types. In our case it was the postcode and second address field where the leading zero code was stripped away. In the |
This is a further extension of #25.
It's about the automatic the JSON mapping using
JSON_NUMERIC_CHECK
which causes some type errors, for example for leading zeros in numeric strings (which should stay strings) – like in some german postcodes or telephone numbers with a leading zero.I added a way to extend the mappings of @mtarld using the
config.xml
like inDivanteLtd/magento1-vsbridge-indexer
. So now you can add a custom mapper for your type by adding a module with the following config xml node:The classes for the mapper extensions declared above must extend the
Divante_VueStorefrontBridge_Helper_Mapper_Abstract
class and should contain your custom mappings and options for your custom attributes.For example: the following code in combination with the configs above will filter out the attributes
firstname
andlastname
from the addresses response object.This way the mapping is more flexible and can be extended without overwriting classes.