Originally posted by Bruce - PhosphorMedia
View Post
Announcement
Collapse
No announcement yet.
problem with if else statement syntax error, unexpected ELSE
Collapse
X
-
well, at least your not typing <mvassign name="g.foo" value="{ l.something.something}"/> and wondering why it doesn't work.
Leave a comment:
-
yes they were from pasting... Here is my tired brain fart... I didn't close the assign statements... that slash is so important!
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Read(l.settings:in vsetstore)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Load(l.settings:re cord:id, l.settings:invsetprod)" />
<mvt:if expr="l.settings:invsetprod:low_lvl_d EQ '1'">
<mvt:assign name="l.settings:record:invadjusted" value="l.settings:record:inventory - l.settings:invsetstore:low_level" />
<mvt:else>
<mvt:assign name="l.settings:record:invadjusted" value="l.settings:record:inventory - l.settings:invsetprod:low_level" />
</mvt:if>
Leave a comment:
-
Are the spaces that show up due to pasting the code? I see a couple of them (l.settings:in vsetstore) (l.settings:re cord:id, l.settings:invsetprod)
- 1 like
Leave a comment:
-
The forum sometimes messes up code displays. I'm seeing a couple of spaces in the middle of variable names (such as "l.settings:re cord:id") but you probably didn't type those.
mvt:assign tags have to have a slash before the closing angle bracket; looks like you left those out.
- 1 like
Leave a comment:
-
problem with if else statement syntax error, unexpected ELSE
Does anyone see anything wrong with my if else statement. My store keeps telling me syntax error, unexpected ELSE
but it isn't unexpected... I need it!
I'm reducing a products inventory by either the store default low stock amount or by the products low stock amount if it not default.
I have values for the variable I am testing. I tried using just 1 and '1', I checked that I have single and double quotes and not smart quotes.
I"m stumped. (and tired). Can one of you miva gurus help me out with the syntax of my if - else?
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Read(l.settings:in vsetstore)" />
<mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Load(l.settings:re cord:id, l.settings:invsetprod)" />
<mvt:if expr="l.settings:invsetprod:low_lvl_d EQ '1'">
<mvt:assign name="l.settings:record:invadjusted" value="l.settings:record:inventory - l.settings:invsetstore:low_level" >
<mvt:else>
<mvt:assign name="l.settings:record:invadjusted" value="l.settings:record:inventory - l.settings:invsetprod:low_level" >
</mvt:if>
Tags: None
Leave a comment: