Announcement

Collapse
No announcement yet.

Parse error: parse error in main on line 2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Parse error: parse error in main on line 2

    Hi Guys

    I am getting the following error Parse error: parse error in main on line 2 on the following

    <actinic:block php="true">
    $rrp = <actinic:variable formatting="font(Color|000000)" name="RRP" selectable="false" />;
    $rawprice = <actinic:variable formatting="font(Color|ff0000)" name="ProductPriceRaw" selectable="false" />;
    // only display is we have an RRP and there's a saving to show
    if ( ($rrp != 0) && ($rrp > $rawprice) )
    {
    $amountsaved = ($rrp - $rawprice);
    $savepercent = ((($rrp - $rawprice) / $rrp) * 100);
    echo "<span style=\"color:red; font-weight:bold\">RRP £", number_format($rrp,2), " - you save £", number_format($amountsaved,2);
    echo " (", number_format($savepercent,2), "%)";
    }
    </actinic:block>
    <br/>


    Any help would be greatly appreciated

    regards Steve
    Steven Morgan
    Cosmetics4u
    http://www.cosmetics4uonline.co.uk

    #2
    Remove the extraneous formatting="......" stuff.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Sorry Norman has gone right over my head can you elaborate
      Steven Morgan
      Cosmetics4u
      http://www.cosmetics4uonline.co.uk

      Comment


        #4
        Change this:
        Code:
        <actinic:block php="true">
        $rrp = <actinic:variable formatting="font(Color|000000)" name="RRP" selectable="false" />;
        $rawprice = <actinic:variable formatting="font(Color|ff0000)" name="ProductPriceRaw" selectable="false" />;
        ......
        To this:
        Code:
        <actinic:block php="true">
        $rrp = <actinic:variable name="RRP" selectable="false" />;
        $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
        ......

        Comment


          #5
          Hello,

          I have had a go at adding the code in and changing it to this (below) as suggested but I still get the Parse error: parse error in main on line 2

          <actinic:block php="true">
          $rrp = <actinic:variable name="RRP" selectable="false" />;
          $rawprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
          // only display is we have an RRP and there's a saving to show
          if ( ($rrp != 0) && ($rrp > $rawprice) )
          {
          $amountsaved = ($rrp - $rawprice);
          $savepercent = ((($rrp - $rawprice) / $rrp) * 100);
          echo "RRP £", number_format($rrp,2), " - you save £", number_format($amountsaved,2);
          echo " (", number_format($savepercent,2), "%)";
          }
          </actinic:block>
          <br/>


          Does anyone know what I have done wrong?

          Thanks
          Angi
          christopherpiperwines.co.uk
          skatewarehouse.co.uk
          progrow.co.uk
          cheeksandcherries.co.uk

          Comment


            #6
            Are you permanently getting that error or intermittent, seem to recall you get an intermittent error sometime with this for some reason. Are you on section links or product layouts? does an upload or a revisit address the issue?

            Comment


              #7
              Oh I added to the product line, I have not uploaded it yet and I seem to get the error all the time locally.
              christopherpiperwines.co.uk
              skatewarehouse.co.uk
              progrow.co.uk
              cheeksandcherries.co.uk

              Comment


                #8
                Angi,

                Thjat code works fine for me. However it requires you to have created a Product level variable called RRP.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  I've had the same problem recently but can't remember what fixed it in the end.

                  I think the problem I had was with the RRP variable having no value set. Try setting 0 as the default or making sure there's a value for all the products.

                  Mike
                  -----------------------------------------

                  First Tackle - Fly Fishing and Game Angling

                  -----------------------------------------

                  Comment


                    #10
                    There's definitely some sort of intermittent issue with it, i've had it myself. Got to be linked to the inbuilt php engine i guess. ProductPriceRaw is the issue as i recall and also how actinic itself creates the normal price.

                    Comment


                      #11
                      Thanks guys.

                      I have all the variables set up and the value is set to 0.

                      However I just tried adding a value in the individual product settings and it removed the error.
                      christopherpiperwines.co.uk
                      skatewarehouse.co.uk
                      progrow.co.uk
                      cheeksandcherries.co.uk

                      Comment

                      Working...
                      X