Announcement

Collapse
No announcement yet.

Parse error

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

    Parse error

    On our website I have written in some php code to display the web saving of 'our price' against the 'rrp' in the disccounts section. This all works fine on every item when viewed offline in Actinic and also in the site html files, but when actinic writes the files to the web I get the following message appear randomly on some of the items with this php code...

    RRP Parse error: parse error in main on line 1
    Our Price £208.99

    Web Saving Parse error: parse error in main on line 1


    An example of this being on... http://www.thesleepshop.co.uk/acatal...-Mattress.html

    Although on this one it's fine... http://www.thesleepshop.co.uk/acatal...-Mattress.html


    It's completely random and if I refresh the website it will fix some, but then leave others not displaying correctly. I've tried numerous things but to no avail, including...

    Compact and repair database in Access
    Generate website and refresh website
    Generate scripts and refresh website
    Clear all site html and refresh website

    If I right-click on the page in the content tree and publish the current page it will then display fine. But as all the products are SPP this would take a very long time to sort out.

    Can anyone else shed any light on what might be causing this?

    Thanks.

    #2
    Your PHP is probably the culprit. However unless you let us see it, it's unlikely anyone can help.

    Post within [ code ] and [ /code] tags (type them with no spaces within the brackets) to keep formatting / indenting intact.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Code:
      <div align="left" style="font-size:12px; font-weight:bold; color:#FF0000;">
      <div style="color:#003399">Get a <strong style="color:#FF0000">FREE</strong> Silentnight pillow with this product </div>
      <br>
      <img src="http://www.thesleepshop.co.uk/acatalog/dp_promo-sn.jpg">
      <div style="color:#003399">RRP 
        <actinic:block php="true">echo "£" . number_format((1 * [rrp]), 2);</actinic:block></div>
      <div style="font-size:16px">Our Price  
        <actinic:block php="true">echo "£" . number_format((1 * [ProductPriceRaw]), 2);</actinic:block></div><br/>
      Web Saving <actinic:block php="true">echo "£" . number_format((1 * [rrp]) - (1 * [ProductPriceRaw]), 2);</actinic:block></div>

      Comment


        #4
        Is this code that you're embedding into the Product Description?

        And have all the <actinic:variable name="....." /> bits disappeared?
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          This code is placed in the discounts and surcharges settings, in the presentation tab for items eligible for that offer.

          Have I written it wrong?

          Thanks

          Comment


            #6
            Pasting swaths of code into text fields is not the best way to do this. Especially if they'll produce negative discounts should you change the RRP or Product Price in the future and the product becomes more expensive than its RRP.

            Consider putting this into the bottom of layout Standard Discount Layout:
            Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%20%3e%20%3cactinic%3avariable%20name%3d%22ProductPriceRaw%22%20%2f%3e">
            	RRP 
            	<actinic:block php="true">echo "£" . number_format(<actinic:variable name="RRP" selectable="false" />, 2);</actinic:block>
            	Our Price  
            	<actinic:block php="true">echo "£" . number_format(<actinic:variable name="ProductPriceRaw" selectable="false" />, 2);</actinic:block>
            	<br/>
            	Web Saving 
            	<actinic:block php="true">echo "£" . number_format(<actinic:variable name="RRP" selectable="false" /> - <actinic:variable name="ProductPriceRaw" selectable="false" />, 2);</actinic:block>
            </actinic:block>
            I'm assuming that RRP is a Numeric variable, its default value is 0 and that you don't allow empty values.

            Note the BlockIf around this bit of code that makes sure nothing displays if the RRP is zero, or less than the Product Price.

            For clarity I've removed your inline style. It might be better to use classnames instead.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X