Help me make a url based on price

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 11 años
Hi, I am offering financing to my customers on equipment over a certain price. I am putting this code:

<br /><br />
<div class="lease">
<iframe name="Lease" id="Lease" style="height: 60px; width: 116px;" frameborder="0" src = "https://leasingcompany.com/marketing/lease.cfm?&[email protected](@Model.Price,@"[^0-9\.]", "")"></iframe>
    </div>

Right below

          @if (Model.DynamicPriceUpdate && !Model.HidePrices)
            {
                @Html.Raw(Regex.Replace(Model.PriceWithDiscount, pattern, replacement))
            }
            else
            {
                @Html.Raw(Model.PriceWithDiscount)
            }
        </span>
            }

in

_ProductVariantPrice.cshtml

Now I just need it to display only for items over $1,000. It's silly to have it display for items that cost $30. I'm guessing some sort of if statement.

Thanks!
Hace 11 años
Edited. Read first post
Hace 11 años

    @{
        //do you need PriceValue or PriceWithDiscountValue ?
        
        var leaseUrl = "https://www.leasecompany.com/lease.cfm";
        if ( @Model.PriceValue > 1000 )
        {
            leaseUrl += "?Cost=" + Model.PriceValue;
        }
            
    }

    <iframe name="Lease" id="Lease" style="height: 60px; width: 116px;" frameborder="0" src = "@leaseUrl"></iframe>
Hace 11 años
Made it

    @{

        var leaseUrl = "https://www.leasecompany.com/lease.cfm";
        if ( @Model.PriceValue > 1000 )
        {
            leaseUrl += "?Cost=" + Model.PriceValue;

    <iframe name="Lease" id="Lease" style="height: 60px; width: 116px;" frameborder="0" src = "@leaseUrl"></iframe>
        }
            
    }

And it worked! Thank you so much!!!!!!!!!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.