Buy Now
Sign in

Switch action with redirect action

Fredolino , November 09 at 10:47
Fredolino

Hello,

I have no dropdown box in the form.
The customer logs in with a code and is registered.
The codes are previously stored in a table and assigned to categories
for Ex.
CODE-ABC | KAT10
CODE-XYZ | KAT10
CODE-CCC | KAT10
CODE-DEF | KAT20
CODE-GHJ | KAT30

The user logs in with a code and is redirected to a specific product page in a specific product category.

In the setup area the table with the codes is loaded with "Read Data".
In the submit area I have a "switch action" before the "Save User" action
Values setup
Kat10:[10]
Kat20:[20]
Kat30:[30]
Kat50:[50]

in "Save User" with Groups ids provider: {value:[]} and with Data override:
{value:[10]}
{value:[20]}
{value:[30]}
{value:[50]}

the redirect action
Event: switch25
Redirect URL: {url:index.php}
URL Parameters:
10=/10-eur
20=/20-eur
30=/30-eur
50=/50-eur

The user is registered in Joomla but not the Groups ID stored in the table.
Therefore, it will not be redirected to its category page after login (for example, index.php/10-eur).
Enclosed a screen from the setup. I think my event actions are wrong?

Best regards
F.

Screen

Attachments
screen.jpg
screen.jpg
(75.33 KiB)
18 Downloads/Views
Fredolino

Hi,
one more question about the switch action:
Read Data returns this result in the debugger: http://andrea.sommerfugl.de/index.php


Before the action "Save User" with the action "Login" in success
do I have a "switch"
name: switch40
Data provider: {shopcode:kategorie}
Return the result as var
Values setup:
{value:[10]}
{value:[11]}
{value:[12]}
{value:[13]}

In "Save User" in Groups ids provider: {shopcode.kategorie:[fn:switch40]}
and in success from "Login" the Redirect-Action
Event: switch40
Redirect URL: {url:index.php/}
URL Parameters:
10:10-eur
11:20-eur
12:30-eur
13:50-eur

The result should be according to the category for ex.
index.php/10-eur
But it does not work.
The problem is the content in the switch and in the Save User action.

It works without a switch and when I save users:
Groups ids provider: {value:[10]}
and in Redirect URL: {url:index.php/10-eur}
or
{value:[20]} and {url:index.php/20-eur}

For a tip, I would be very grateful.

Best regards
F.

admin

Hi Fred,

If you have {value:[]} in the "Groups data provider" then the user will have no groups.

This is not a valid Chronoforms shortcode:

				{shopcode.kategorie:[fn:switch40]}
				


What is exactly not working now ?

Best regards

Max
If your main question got answered then please mark the answer using the button!

Fredolino

Hi Max :-)

I have changed the procedure now. But it does not quite work yet.
I oriented myself on the Event.Switcher demo. I think it could work with it.
I do not have a dropdown box. Maybe it is synonymous with a text box under Events?

Designer Textfield
Name: prmiencode, ID: prmiencode
with 4 Events:

On: Change
Actions: Reload
Value:prmiencode=10
Element-id: 10

On: Change
Actions: Reload
Value:prmiencode=20
Element-id: 20

On: Change
Actions: Reload
Value:prmiencode=30
Element-id: 30

On: Change
Actions: Reload
Value:prmiencode=50
Element-id: 50
-----
Im Setup-Bereich/submit den Event switcher
Data provider: {data:prmiencode}
Events-comma: 10,20,30,50

Switch 10
Event: kat_10
Redirect URL: {url:index.php/10-eur}

Switch 20
Event: kat_20
Redirect URL: {url:index.php/20-eur}

Switch 30
Event: kat_30
Redirect URL: {url:index.php/30-eur}

Switch 50
Event: kat_50
Redirect URL: {url:index.php/50-eur}

--------

Event-Kartei-Name: kat_10
Save User with Groups ids provider: {value:[1]}
Save User success
- Login-Action
--- Login success
--- Redirect-Action with: {url:index.php/10-eur}

Event-Kartei-Name: kat_20
Save User with Groups ids provider: {value:[2]}
Save User success
- Login-Action
--- Login success
--- Redirect-Action with: {url:index.php/20-eur}

.......

Best regards
Fred