|
Posted by Oli Filth on 09/15/05 19:05
Mark said the following on 15/09/2005 16:55:
> Can someone please help me with the below script? I think it's nearly
> correct but there's just something not quite right which won't let it
> run.
>
Why don't you just turn error reporting on, and it will tell you about
syntax errors.
You are missing the closing scope bracket "}" for each nested switch
statement.
>
> Mark
>
> ________________________________________________________________
>
> switch (article_get_field('style')) {
> case 'Short':
> switch (article_get_field('size')) {
> case 'M':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11M');
> break;
> case 'L':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11L');
> break;
> case 'XL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11XL');
> break;
> case 'XXL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11XXL');
> break;
}
> break;
> case 'Medium':
> switch (article_get_field('size')) {
> case 'M':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10M');
> break;
> case 'L':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10L');
> break;
> case 'XL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10XL');
> break;
> case 'XXL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10XXL');
> break;
}
> break;
> case 'Long':
> switch (article_get_field('size')) {
> case 'M':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1M');
> break;
> case 'L':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1L');
> break;
> case 'XL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1XL');
> break;
> case 'XXL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1XXL');
> break;
}
> break;
> }
>
--
Oli
Navigation:
[Reply to this message]
|