Developer forum

Forum » Ecommerce - Standard features » If stements
Thomas Kjærgaard
Reply
Why doesn't this if stament work?

<!--@If(Ecom:Order.PriceWithoutFees.PricePIP<100000)-->
    HELLO
<!--@EndIf-->

I can't make it run at all..?
______

Maybe some of you know a better practice to my problem.

I'm currently developing a webshop where we want free delevery on orders where total price is 1000 DKK and above. Furthermore we have a few items where there should be a delivery fee caused by there massive size and weight.

I have currently set op a discount on orders above 1000 DKK. I have also set a delivery fee on cart above x weight.

In my shopping cart it still shows the delivery fee eventhough it should be zero.

Therefore i want to set an if statement, that if the total amount in cart is above 1000 DKK and the shipping fee equals 50 it should display a string e.g. "Free Delivery"..

How to accomplish this?

Replies

 
Thomas Kjærgaard
Reply
Got this statement working:

<!--@If(Ecom:Order.Price.PricePIP>1000)-->
    HELLO
<!--@EndIf-->

But only when <!--@DwTemplateTags--> is represented!

 
Thomas Kjærgaard
Reply
Got this working without the <!--@DwTemplateTags--> represented!

<!--@If(Ecom:Order.OrderLines.TotalPriceWithoutSymbol>1000)-->
    <strike><!--@Ecom:Order.ShippingFee.PriceFormatted--></strike>
<!--@EndIf-->

 
Merethe Nielsen
Reply

Hi
I have investigated this and we have a similar bug (bug 6808) where I have added this issue as well.

It seems like it's all order tags that are not rendered unless the same tag is present outside the statement.
A workaround is to use the Ecom:Order.PriceWithoutFees.PricePIP tag outside the statement but hidden in a DIV.

Example with workaround with hidden tag:

<div style="visibility:hidden"><!--@Ecom:Order.PriceWithoutFees.PricePIP--></div> 
<!--@If(Ecom:Order.PriceWithoutFees.PricePIP<100000)-->
     HELLO
 <!--@EndIf-->


Example with workaround with hidden DwTemplateTags:
<div style="visibility:hidden"><!--@DwTemplateTags--></div> 
<!--@If(Ecom:Order.PriceWithoutFees.PricePIP<100000)-->
     HELLO
 <!--@EndIf-->
 
Morten Bengtson
Reply
And here is a similar solution...

The undefined hack :)
<!--@If(undefined)--><!--@Ecom:Order.PriceWithoutFees.PricePIP--><!--@EndIf(undefined)-->
 
<!--@If(Ecom:Order.PriceWithoutFees.PricePIP<100000)-->
     HELLO
<!--@EndIf-->
The tag value will be rendered, but it will not be in the output because the tag "undefined" is... undefined.
That means you don't need to hide it with css.

 

You must be logged in to post in the forum