You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the OFFLINE Mall in a multisite setup and it works to the largest extent.
The only, very important detail I can't find an answer for is to allow the payment gateway settings to be different across different sites. Normally we'd use $translatable for this, in the Model.
PaymentGatewaySettings::extend(function($model) {
// Implement the TranslatableModel behavior if not already implemented
if (!$model->isClassExtendedWith('RainLab.Translate.Behaviors.TranslatableModel')) {
$model->implement[] = 'RainLab.Translate.Behaviors.TranslatableModel';
}
// Add fields to be translatable
$model->addDynamicProperty('translatable', [
'live_api_key',
'test_api_key',
]);
});
I feel like I might be close... Can anyone point me in the right direction please?
The text was updated successfully, but these errors were encountered:
as far as I can tell so far, your code can't work this way. The PaymentGatewaySettings model is a simple October SettingsModel, which stores the corresponding data as json inside the core system_settings.value column using "offline_mall_settings" as key. However, $translatable works only column-based and does not support JSON-indexes, even if the SettingsModel "unpacks" the value and allows direct access.
If you're using OC 3.5 (or 3.6, dunno when multisite was introduced) you could theoretically use the new MultiSite trait / feature as described here. But I guess, this requires some changes on the core Mall files and so far I have not been able to integrate it functionally.
I guess, this needs some more attention to get it working (and ensure, that no breaking changes are introduced).
Thanks for taking the time to look into this. Looks like I was a little too eager. I don't have the time to investigate this further.
So I'm gonna try to solve this another way. I'll create payment settings fields for each multisite, by prefixing them with each site code.
So the settings of all the sites would be visible regardless of which context the backend is in.
I would apply the correct settings based on the order that is placed (I have previously extended the order fields to include the context of the site where the order was placed).
Hi,
I'm using the OFFLINE Mall in a multisite setup and it works to the largest extent.
The only, very important detail I can't find an answer for is to allow the payment gateway settings to be different across different sites. Normally we'd use
$translatable
for this, in the Model.My working Payment solution uses the basics of the example implementation here:
https://offline-gmbh.github.io/oc-mall-plugin/development/core/payment-providers.html
I thought to do something like this, but it doesn't work:
In my classes file:
In my Plugin.php boot method:
I feel like I might be close... Can anyone point me in the right direction please?
The text was updated successfully, but these errors were encountered: