i have shipping community model has camel cased class/file witch override.
the original file/class located under app/code/community/pedroteixeira/correios/model/carrier/correiosmethod.php , override method of file, or whole class under app/code/local/esmart/correiosimprovements/model/carrier/correiosmethod.php.
in original module config file, can see it's model declaration in config.xml follows:
<global> ... <models> <pedroteixeira_correios> <class>pedroteixeira_correios_model</class> </pedroteixeira_correios> </models> ... <sales> <shipping> <carriers> <pedroteixeira_correios> <class>pedroteixeira_correios_model_carrier_correiosmethod</class> </pedroteixeira_correios> </carriers> </shipping> </sales> </global>
at my module config.xml i've declared override way:
<global> <models> <esmart_correiosimprovements> <class>esmart_correiosimprovements_model</class> </esmart_correiosimprovements> <pedroteixeira_correios> <rewrite> <carrier_correiosmethod>esmart_correiosimprovements_model_carrier_correiosmethod</carrier_correiosmethod> </rewrite> </pedroteixeira_correios> </models> </global>
usually model file isn't camel cased, guess it's easier. or missing here?
any appreciated.
the class group (<pedroteixeira_correios>
) use in rewrite syntax depends on class group declaration in module's config.
the class id (<carrier_correiosmethod>
) use in rewrite syntax depends entirely on how class invoked in code. example, following instantiate original class instance on case-sensitive filesystems:
pedroteixeira_correios/carrier_correiosmethod
pedroteixeira_correios/carrier_correiosmethod
pedroteixeira_correios/carrier_correiosmethod
pedroteixeira_correios/carrier_correiosmethod
on case-insensitive filesystems, combination of casing class id part yield model instance. extension vendor followed consistent pattern when specifying class in code/markup, can specify multiple xpaths using list above handle permutations.
Comments
Post a Comment