Hello JoomShaper Support,
I wanted to follow up on my earlier discussion about the custom EasyStore shipping-plugin documentation.
In an earlier support request, I had already reported that the online documentation appeared to be out of date. Another team member kindly confirmed this and told me that the development team was working on a new version. He subsequently provided the manual.pdf from your developer, with the comment:
“Our documentation will be updated soon etc.”
I have now worked through the process far enough to get my custom GoSweetSpot shipping plugin successfully working with EasyStore and returning live NZ Couriers shipping rates.
Having gone through the exercise in detail, I wanted to pass back one particularly important finding that I think would be worth including in the revised documentation.
Case sensitivity can be masked by MAMP/macOS
I developed and tested the plugin locally using MAMP on a Mac. This initially made the plugin appear to be correctly named and structured even when there were inconsistencies in the capitalisation of the plugin name.
The reason is that the normal macOS filesystem is case-insensitive. In practical terms, a development environment such as MAMP can therefore mask errors involving names such as:
GoSweetSpot
versus:
gosweetspot
When the plugin was deployed to the Linux-based hosted environment, those differences became significant because the filesystem is case-sensitive.
This was particularly confusing for a relatively inexperienced Joomla plugin developer, because the plugin could appear to be working locally while failing after deployment.
I therefore think the revised documentation should explicitly warn MAMP/macOS developers about this distinction. Something as simple as:
“If developing on macOS/MAMP, be aware that the local case-insensitive filesystem may hide filename and directory case errors which will cause problems when the plugin is deployed to a case-sensitive Linux server.”
would potentially save a lot of debugging time.
Specific casing issues encountered
During troubleshooting I found that the plugin directory, XML filename and relevant plugin element references needed consistent lowercase naming. For example:
plugins/easystoreshipping/gosweetspot/gosweetspot.xml
and:
PluginHelper::getPlugin('easystoreshipping', 'gosweetspot')
At the same time, the PHP namespace/class names retain their normal PHP namespace capitalisation, for example:
Comfoot\Plugin\EasyStoreShipping\GoSweetSpot
Making this distinction explicit would be very helpful.
The provider.php example
The provider.php supplied in the PDF was particularly useful. It differs from the version currently shown in the online documentation, and it also differs in some respects from the downloadable sampleshipping.zip.
The significant point for my implementation was that the plugin configuration is obtained using the lowercase plugin element name and the resulting plugin class is then instantiated separately.
In my case, the working pattern includes:
PluginHelper::getPlugin('easystoreshipping', 'gosweetspot')
followed by instantiation of my GoSweetSpot class.
I initially had a mixture of GoSweetSpot and gosweetspot in different places, which contributed to a considerable amount of confusion while tracing Joomla's plugin-loading process.
The end result
After working through the Joomla plugin-loading process — including PluginHelper::importPlugin(), bootPlugin(), the provider and the event subscriber — I was eventually able to confirm that:
- the plugin is loaded correctly;
- the provider creates the correct plugin class;
onEasyStoreGetShippingMethods() is being called;
- the plugin can make the GoSweetSpot rates request; and
- live NZ Couriers rates are successfully returned to EasyStore.
So the integration is now working.
I wanted to send this follow-up because the case-sensitivity issue is something I would never have anticipated as a developer working in MAMP/macOS. I suspect other developers following the documentation could easily encounter exactly the same problem without realising that their local environment is concealing it.
Thanks again for providing the developer PDF and for passing my earlier findings on to your development team. I hope this additional information is useful when the documentation and sample plugin are revised.
Regards,
Bruce