Announcement

Collapse
No announcement yet.

Error using AssociatedProduct:: ProductPriceRaw within a Component

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

    Error using AssociatedProduct:: ProductPriceRaw within a Component

    I am trying to display the price of a optional "add-on" component but I am getting a coding error warning about using the AssociatedProduct:: ProductPriceRaw variable in the Standard Component Layout when I upload.

    What's strange is that the error is only reported the first time Sellerdeck error checking runs after being launched (either through a manual check or an upload) and when you click on the error description to take you to the code the error warning disappears. Further error checking either manual or through uploads fail to find the error, but if I close Sellerdeck and re-open, the error will again be found on the first code check.

    The code works correctly online and with both the inbuilt and offline previews.

    I have tried a few ways of using the code and I always get the same error. Below are 2 examples

    I apologise in advance if I have made a silly mistake but it would be great if anyone could point me in the right direct

    Many thank
    Toby


    Example 1 (Note the variable "CurrentVatRate" is set globally as 1.2)

    Code:
    <actinic:block php="true">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsUsedAssociatedProduct%22%20%2f%3e">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22HideComponentFullPrice%22%20%2f%3e%20%21%3d%20True">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22AssociatedProduct%3a%3aProductPriceRaw%22%20%2f%3e%20%20%3e0%2e01">
    
    $rawprice = <actinic:variable name="AssociatedProduct::ProductPriceRaw" selectable="false" encoding="perl" />;
    $grossprice = round(($rawprice * <actinic:variable name="CurrentVatRate" selectable="false" encoding="perl" />),2);
    echo " (+ £$grossprice)";
    
    </actinic:block>
    </actinic:block>
    </actinic:block>
    </actinic:block>


    Example 2

    Code:
    <actinic:block php="true">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsUsedAssociatedProduct%22%20%2f%3e">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22HideComponentFullPrice%22%20%2f%3e%20%21%3d%20True">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22AssociatedProduct%3a%3aProductPriceRaw%22%20%2f%3e%20%20%3e0%2e01">
    
    echo'(+
    <actinic:block PHP='true' SELECTABLE='false'>formattedcurrency(round((<actinic:variable name="AssociatedProduct::ProductPriceRaw" selectable="false" encoding="perl" /> * <actinic:variable name="CurrentVatRate" selectable="false" encoding="perl" />), <actinic:variable name="CurrencyDigits" selectable="false" encoding="perl" />)*<actinic:variable name="ComponentQuantity" selectable="false" encoding="perl" />, <actinic:variable name="CurrencyDigits" selectable="false" encoding="perl" />, '<actinic:variable name="MoneyDecimalSeparator" selectable="false" encoding="perl" />', '<actinic:variable name="MoneyThousandSeparator" selectable="false" encoding="perl" />', '<actinic:variable name="DefaultCurrency" selectable="false" encoding="perl" />');</actinic:block>
    )';
    
    </actinic:block>
    </actinic:block>
    </actinic:block>
    </actinic:block>

    Toby@happyharris.co.uk

    #2
    Just another thought, if the above can not be resolved, is there anyway to mark a section of code so that it is ignored by the coding error checking process

    Toby@happyharris.co.uk

    Comment


      #3
      Example 1: Try putting the PHP block around the PHP code, rather than around the whole thing:
      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsUsedAssociatedProduct%22%20%2f%3e">
          <actinic:block if="%3cactinic%3avariable%20name%3d%22HideComponentFullPrice%22%20%2f%3e%20%21%3d%20True">
              <actinic:block if="%3cactinic%3avariable%20name%3d%22AssociatedProduct%3a%3aProductPriceRaw%22%20%2f%3e%20%20%3e0%2e01">
                  <actinic:block php="true">
                      $rawprice = <actinic:variable name="AssociatedProduct::ProductPriceRaw" selectable="false" encoding="perl" />;
                      $grossprice = round(($rawprice * <actinic:variable name="CurrentVatRate" selectable="false" encoding="perl" />),2);
                      echo " (+ £$grossprice)";
                  </actinic:block>
              </actinic:block>
          </actinic:block>
      </actinic:block>
      Example 2: Has nested PHP blocks. Remove inner one and try altering as above.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment

      Working...
      X