Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Prices for different countries
Prices for different countries
Prices for different countries
Hi!
I have some problems to understand how to work with metamod with small number of movements)
I have site with 2 languages - Ru and En
I allso should have near 2-3 price modes for different countruies.
Allso some of prices are avaliable only after registration.
So I have near 6 modules/artcles with prices published in different module positions, different access levels per 1 language.
Site works now, but I need to set up low prices for some countries
So - the best practise for me would be to dubble all this modules/articles (with their access levels and module positions) for needed country with right prices and make them to be published with help of meta mod for right country.
Can I do this and how?
Thanks a lot!
Re: Prices for different countries
As I understand, I need to create 6*4=24 metamod modules for this situation:
6 for Ru language from Ru-speaking countries
6 for En language from Ru-speaking countries
6 for Ru language from En-speaking countries
and
6 for En language from En-speaking countries
And to connect my each module with appropriate metamod module using CSS suffixes from my modules. That's to long and hard.
So, can I create just 2 metamod modules that will be as filters that will allow content to show in En speaking and in Ru?
I mean that all settings will be from current modules (positions, access levels and css suffixes), and publish/unpublish (or show or not) - from metamod?
Re: Prices for different countries
Hi Igor,
The answer to this depends a bit on how many different module positions you are using. You should only need - at most - one MetaMod per module position. And if you use MetaMod Pro, a MetaMod in one position can control modules in *other* positions, so then you might be able to do it all with 1 MetaMod overall.
So let's look at the "Pro" solution using 1 MetaMod module. This uses MetaMod Pro's ability to switch modules OFF in any module position. This should then work as you stated:
"all settings will be from current modules (positions, access levels and css suffixes), and publish/unpublish (or show or not) - from metamod"
As I said, with MetaMod Pro you can switch modules OFF. i.e. you start with all the modules published and set to the respective access levels etc.
Let's say that you have a series of modules with ids 101-120. For each combination of country (I assume GeoIP?) and language you need to turn most of these off, leaving the "correct" ones turned on.
For ease of use I'll structure it so that in each case you specify the modules you want to leave ON, and the system will calculate which ones need to be turned off.
The PHP in the MetaMod would work like this:
$all_mods = array(101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 118, 119, 120);
$on = array();
if ($language_code == 'ru') {
switch ($fromCountryId) {
case 'ru': $on = array(101,102,103,104,105,106);
break;
case 'en': $on = array(107,108,109,120,111,112);
break;
}
}
if ($language_code == 'en') {
switch ($fromCountryId) {
case 'ru': $on = array(113, 114, 115, 116);
break;
case 'en': $on = array(117, 118, 119, 120);
break;
}
}
// now turn off any that aren't in the $on array
$offs = array_diff($all_mods, $on);
foreach ($offs as $off) {
$changes->mod($off)->disable();
}
// done!
Re: Prices for different countries
Thanks a lot! But if I will use a free version?
I thought a little for time I had before your reply. So I have 2 variants of prices - 1 -for the World, 2 - for the former CIS (Ukraine, Belarussia, Russia and others).
So I made this rule for 1 module that will display on Ru language:
if ( $fromCountryId == "UA") return 985;
if ( $fromCountryId == "RU") return 985;
if ( $fromCountryId == "KZ") return 985;
if ( $fromCountryId == "BY") return 985;
if ( $fromCountryId == "TM") return 985;
if ( $fromCountryId == "UZ") return 985;
if ( $fromCountryId == "KG") return 985;
if ( $fromCountryId == "TJ") return 985;
return 820;
And this - for En:
if ( $fromCountryId == "UA") return XXX;
if ( $fromCountryId == "RU") return XXX;
if ( $fromCountryId == "KZ") return XXX;
if ( $fromCountryId == "BY") return XXX;
if ( $fromCountryId == "TM") return XXX;
if ( $fromCountryId == "UZ") return XXX;
if ( $fromCountryId == "KG") return XXX;
if ( $fromCountryId == "TJ") return XXX;
return YYY;
Am I right? And all this I should replay on all 6 modules? (they have different positions)
Allso can you advice how to make code simpler? May be this way?
if ( $fromCountryId == " UA, RU, KZ, BY, TM, UZ, KG, TJ") return 985; ? (I try - it does not work)
Sorry for may be stupid question, but still)
Re: Prices for different countries
Hi,
You could do it this way:
if ( $fromCountryId == "UA"
or $fromCountryId == "RU"
or $fromCountryId == "KZ"
or $fromCountryId == "BY"
or $fromCountryId == "TM"
or $fromCountryId == "UZ"
or $fromCountryId == "KG"
or $fromCountryId == "TJ"
) return 985;
There are other ways but that one's easiest to understand.
Yes, if you are using the non-Pro version and you need to control modules in different positions, then you'll need a MetaMod with a variation of this code in each of those positions.
Best regards,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Prices for different countries
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8028
- Newest User:
- musial8334
- Members Online:
- 0
- Guests Online:
- 238
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked