yeah, this is a bit tricky. PowerStore is not set up to Force users to register, or to force them to login before they can checkout. because of this, the discount would only be applied to users that did register and then logged in prior to checking out.
you would need to add a recordset to the confirm page:
SELECT COUNT(orders.OrderID) as OrderCount
INNER JOIN users
ON orders.OrderUserID = users.userID
WHERE users.userID = paramUserID
in the parameters section, add a new parameter as:
data Type: Numeric
default Value: -1
Runtime value: $_SESSION['UserID']
This will count the orders that have been placed for the logged in user.
Now add a set session value server behavior.
Set the trigger to if the recordset is not empty
set the name to OrderCount
for the value, click the lightning bolt and select the orderCount recordset column.
Now in eCart create the discount. set the trigger to:
If session variable exists "OrderCount"
and based on session value:
If the Session Variable "OrderCount" has a value "=" to a value of "0"
set the discount to based on cart subtotal:
cart Subtotal "Times" "0.10"
remeber, power store will not be able to force the discount to be applied.
It will only apply if:
1) they register before placing the first order
2) They login in before placing the first order
3) It is the first order.
since power store doesn't force registering or loging in, it is up to the shopper to do thiose things to get the discount.