Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rehan Zahid 31 posts 52 karma points
    Nov 12, 2012 @ 23:01
    Rehan Zahid
    0

    Error loading MacroEngine script

    Hi there,

    I have a very annoying issue...

    My code below here shows specific product with related property

     

     

     

     

    @using umbraco.MacroEngines
    @using umbraco.cms.businesslogic.media
    @using uComponents.Core
    @using uComponents.Core.uQueryExtensions
    @using System;
    @using System.Xml.XPath;
    @using System.Linq;
    @using System.Xml.Linq;
    @using System.Linq.Expressions;
    @using TeaCommerce.Razor;
    @using TeaCommerce.Data;
    @inherits umbraco.MacroEngines.DynamicNodeContext;

      <head>
        <link href="../css/ecommerce.css" rel="Stylesheet" type="text/css" />
    </head>
     
    @{
    @foreach 
    (var page in @Model.AncestorOrSelf().Descendants("Product"))
    {
         
         var tilbud @page.GetProperty("ugensTilbud").Value;
         var mediaId @page.GetProperty("productImage").Value;
         var currentCurrency TeaCommerce.GetCurrentCurrency();
         var price TeaCommerce.FormatPrice(decimal.Parse(@page.productPriceDKK));

         <span itemprop="price" style="font-size:16px; color:#fff">@price</span>

    }

     

    }

    But the this is it gives me this errror"Error loading MacroEngine script"

    but if i dont use TeaCommerce.FormatPrice and just use @page.productPriceDKK it shows the correct value... I have tried everything but seems not to work... It also gives med an error on decimal.Parse(@page.productPriceDKK.ToString()) or decimal.Parse(@page.productPriceDKK)

    What i am doing wrong, i have almost tried everything but cannot get it work...

  • Rune Grønkjær 1372 posts 3103 karma points
    Nov 13, 2012 @ 08:18
    Rune Grønkjær
    0

    Hi Rehan,

    I believe the FormatPrice method takes a string as parameter instead of a decimal. Try running the page with ?umbDebugShowTrace=true, then you should see the error in red somewhere in the debug log on the page.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft