Announcement

Collapse
No announcement yet.

Problem with ProductPriceRaw

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

    Problem with ProductPriceRaw

    An error has suddenly appeared with using ProductPriceRaw within the Standard Component Layout. The code used has NOT been changed in any way and has worked perfectly for a very long time - since Norman Rouxel kindly wrote it for me a couple of years back. This is the code that was working but suddenly produced the following error:

    "The 'ProductPriceRaw' variable has been placed within the 'Standard Component Layout' layout but it won't work there. Click here to see the code."

    <actinic:block if="%3cactinic%3avariable%20name%3d%22ComponentDisplayLabel%22%20%2f%3e%20%21%3d%20%22%22">
    <!--<br />-->
    </actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentCheckboxShown%22%20%2f%3e">
    <input type="checkbox" name="<Actinic:Variable Name="UIWidgetName"/>" <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e">checked="checked"</actinic:block> />
    </actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsComponentHiddenFieldIncluded%22%20%2f%3e">
    <input type="hidden" name="<Actinic:Variable Name="UIWidgetName"/>" value="on" />
    </actinic:block>
    <actinic:block php="true">
    $str = "<actinic:variable name="ComponentDisplayLabel" />";
    $regs = array();
    $found = 0;
    if(ereg("Pro Maintenance Kit","$str",$regs)) {
    $str2 = "info_DR194541.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("ALKO Shredder Bag","$str",$regs)) {
    $str2 = "info_AK110270.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Lawnmower Cover","$str",$regs)) {
    $str2 = "info_EG910-2487.html";
    $found = 1;
    $str = "Lawnmower Cover";
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Lawnmower Cover","$str",$regs)) {
    $str2 = "info_EG910-2487.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Oil Can","$str",$regs)) {
    $str2 = "info_EG930-0984.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Commercial Maintenance Kit","$str",$regs)) {
    $str2 = "info_DR194591.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Safety COMBI","$str",$regs)) {
    $str2 = "info_EG910_0527.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Beaver Blade Kit","$str",$regs)) {
    $str2 = "info_DR12540.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 500);\">$str</a>";
    }
    $found = 0;
    if(ereg("80ft","$str",$regs)) {
    $str2 = "info_DR196601.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("100ft","$str",$regs)) {
    $str2 = "info_DR196591.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("120ft","$str",$regs)) {
    $str2 = "info_DR196581.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Replacement Beaver Blade","$str",$regs)) {
    $str2 = "info_DR125391.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Bulb Planter Attachment","$str",$regs)) {
    $str2 = "info_DRBULBPLANT.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 300);\">$str</a>";
    }
    $found = 0;
    if(ereg("Mower Deck","$str",$regs)) {
    $str2 = "info_DR15174.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 500);\">$str</a>";
    }
    $found = 0;
    if(ereg("Bladeless Mower","$str",$regs)) {
    $str2 = "info_DR148521.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 500);\">$str</a>";
    }
    $found = 0;
    if(ereg("Graded Blade","$str",$regs)) {
    $str2 = "info_DR15750.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 500);\">$str</a>";
    }
    $found = 0;
    if(ereg("Scout Maintenance","$str",$regs)) {
    $str2 = "info_DR194841.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Maintenance Kit for DR Pro","$str",$regs)) {
    $str2 = "info_DR194821.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Maintenance Kit for 15hp Kawaski","$str",$regs)) {
    $str2 = "info_DR194801.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Hose Kit","$str",$regs)) {
    $str2 = "info_AK120154.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Gtech CM01 Spare Battery","$str",$regs)) {
    $str2 = "info_GTBATTERYCM01.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    }
    $found = 0;
    if(ereg("Free Oil","$str",$regs)) {
    $str2 = "info_BS100005E.html";
    $str = "<b>FREE Oil</b>";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam CS Vacuum Kit","$str",$regs)) {
    $str2 = "info_AR1692210.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Scout Hour","$str",$regs)) {
    $str2 = "info_DR199451.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Oil Extractor Kit","$str",$regs)) {
    $str2 = "info_AK130088.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam 3 inch Auger Bit","$str",$regs)) {
    $str2 = "info_AR60851.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam 2 inch Auger Bit","$str",$regs)) {
    $str2 = "info_AR60850.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam 4 inch Auger Bit","$str",$regs)) {
    $str2 = "info_AR60852.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam 6 inch Auger Bit","$str",$regs)) {
    $str2 = "info_AR60853.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam 8 inch Auger Bit","$str",$regs)) {
    $str2 = "info_AR60854.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ardisam 10 inch Auger Bit","$str",$regs)) {
    $str2 = "info_AR60855.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Replacement Scythe Blade 91cm","$str",$regs)) {
    $str2 = "info_AK110281.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Replacement Scythe Blade 102cm","$str",$regs)) {
    $str2 = "info_AK110282.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("BS992051","$str",$regs)) {
    $str2 = "info_BS992051.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("BS992049","$str",$regs)) {
    $str2 = "info_BS992049.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Intek Service Kit","$str",$regs)) {
    $str2 = "info_BS992054.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Service Kit 06211","$str",$regs)) {
    $str2 = "info_HO06211-ZL8-000.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Grass Box","$str",$regs)) {
    $str2 = "info_AK112466.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("ATCO Royale 20 Seat","$str",$regs)) {
    $str2 = "info_BOF016800104.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("ATCO Royale 24 Seat","$str",$regs)) {
    $str2 = "info_BOF016800105.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("ATCO Royale 30 Seat","$str",$regs)) {
    $str2 = "info_BOF016800106.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("ATCO 14in QX 10 Blade Unit","$str",$regs)) {
    $str2 = "info_BOF016800121.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("ATCO 17in QX 10 Blade Unit","$str",$regs)) {
    $str2 = "info_BOF016800122.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("ATCO 20in QX 10 Blade Unit","$str",$regs)) {
    $str2 = "info_BOF016800123.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Additional Battery","$str",$regs)) {
    $str2 = "info_RE2405-AS02.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Electric Safety Circuit Breaker","$str",$regs)) {
    $str2 = "info_EG69307.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Garden Power Safety","$str",$regs)) {
    $str2 = "info_EG69307.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 200);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Small Chainsaw Bag","$str",$regs)) {
    $str2 = "info_MICSB_2.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Large Chainsaw Bag","$str",$regs)) {
    $str2 = "info_MICSBL.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Scythe Attachment","$str",$regs)) {
    $str2 = "info_AK110494.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Cultivator Attachment","$str",$regs)) {
    $str2 = "info_AK110495.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Sweeper Attachment","$str",$regs)) {
    $str2 = "info_AK110605.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Ridge Plough Attachment","$str",$regs)) {
    $str2 = "info_AK110472.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Snow Chains","$str",$regs)) {
    $str2 = "info_AK112183.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Snow Plough Attachment","$str",$regs)) {
    $str2 = "info_AK112465.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Metre Extension","$str",$regs)) {
    $str2 = "info_MIVA03.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }

    $found = 0;
    if(ereg("Pole Pruner Attachment","$str",$regs)) {
    $str2 = "info_MIVA02.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Brushcutter Kit","$str",$regs)) {
    $str2 = "info_MIVA01.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Hedge Trimmer Attachment","$str",$regs)) {
    $str2 = "info_MIHT05.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Spare Battery 1","$str",$regs)) {
    $str2 = "info_08836_20.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    $found = 0;
    if(ereg("Spare Battery 2","$str",$regs)) {
    $str2 = "info_08837_20.html";
    $found = 1;
    print "<a href=\"javascript:ShowPopUp('$str2', 500, 250);\">$str</a>";
    $str = 0;
    }
    </actinic:block>

    ######################################
    # This is where the ProductPriceRaw code appears
    <actinic:block php="true">
    $aspriceraw = '<actinic:variable encoding="perl" name="AssociatedProduct::ProductPriceRaw" selectable="false" />';
    if ( $aspriceraw > 0 ) formattedcurrency(1.20 * $aspriceraw, 2, '.', ',', ' + £');
    </actinic:block>

    ############################################
    <Actinic:PRICE_EXPLANATION PROD_REF="<actinic:variable Name="ProductID" />" COMPONENTID=<actinic:variable name="ComponentIndex" />><font color="#dc143c"><b>&nbsp;<actinic:variable name="ComponentRetailCustomerMessage" /></b></font></Actinic:PRICE_EXPLANATION><!--<br />-->
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%3d%3d%200%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3c%20%3cactinic%3avariable%20name%3d%22ComponentCount%22%20%2f%3e%29">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPriceShownForComponents%22%20%2f%3e%20OR%20%3cactinic%3avariable%20name%3d%22IsPermutationHidden%22%20%2f%3e">
    <actinic:variable name="ComponentAttributeList" />
    </actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPriceShownForComponents%22%20%2f%3e%20%3d%3d%20FALSE%20AND%20%3cactinic%3avariable%20name%3d%22IsPermutationHidden%22%20%2f%3e%20%3d%3d%20FALSE" >
    <actinic:variable name="AttributeList" />
    </actinic:block>
    </actinic:block>
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22NumberAttributesInPushButtonGrid%22%20%2f%3e%20%21%3d%200%29%20AND%0d%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22ComponentCount%22%20%2f%3e%29">
    <actinic:variable name="AttributeList" />
    </actinic:block>

    I would be most grateful if anyone can help to fix this problem.

    Mike de Malpas

    #2
    Code doesn't stop working for no reason. Are you sure nothings changed?

    Also it may be a startup problem. Try restarting Actinic or switching from Design to Content mode. I have seen such spurious errors when starting Actinic but they go away if you change the viewed Section.

    Also, that huge lump of PHP at the beginning if your post is very long winded and clumsy. It surely wasn't written by me. It could be about 1/5th the size.

    Try:
    Code:
    <actinic:block php="true">
    $str = '<actinic:variable name="ComponentDisplayLabel" encoding="perl" selectable="false" />';
    
    $name_links = array(
    	"Pro Maintenance Kit", "info_DR194541.html",
    	"ALKO Shredder Bag", "info_AK110270.html",
    	.
    	PUT OTHER PAIRS HERE
    	.
    	"Spare Battery 1", info_08836_20.html",
    	"Spare Battery 2", "info_08837_20.html"
    );
    
    $name_count = count($name_links);
    for ($i=0; $i < $name_count; $i += 2)
    	{
    	if ( strpos($str, $name_links[$i] !== false ) 
    		{
    		print "<a href="javascript:ShowPopUp('" . $name_links[$i+1] . "', 500, 250);\">$str</a>";
    		break;
    		}
    	}
    }
    </actinic:block>
    Instead. N.B. Untested.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      The code used has NOT been changed in any way
      if ( $aspriceraw > 0 ) formattedcurrency(1.20 * $aspriceraw, 2, '.', ',', ' + £');
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Many thanks Norman. What I should have said is that the code has not been changed except to change the VAT from 1.175 to 1.20. Indeed the code was working fine on 31 Jan 20111 when I sent a snapshot to my daughter. She added some new products and made a few other changes (NOT ever touching the site in Design View since she is not a programmer).

        So I copied the entire code inside Component Layout from the Actinic Snapshot of 31 Jan - the one where no error shows - and pasted it over the entire code of Component Layout in the snapshot of 7 Feb 2011. However, it still produces an error.

        I also compared the code in the snapshot of 31 Jan with that of 07 Feb and they are identical. They had to be because the code was NOT touched!!

        I cannot understand why the error now says that ProductPriceRaw cannot be used inside Standard Component Layout. It also says that the error is in 4 places though it takes me only to one of them!!

        Thanks for your suggestions on simplifying the code for each component. I will implement that after we have solved this problem.

        It would seem that although it says there is an error within Standard Component Layout ..... perhaps the error is in fact somewhere else in the site but it affects the code within Standard Component Layout.

        Any further thoughts please?

        Comment


          #5
          I should have said that the snapshot of 31 Jan was one I sent to my daughter when there were no errors and the snapshot of 7 Feb was the one she sent back to me - and that is when the errors appeared. They show in her version of Actinic on her computer and also show of course in my version of Actinic on my computer.

          Comment


            #6
            If the code hasn't changed, then the data that you're feeding into it might have.

            Perhaps you've changed some Components so that they don't have an Associated Product. To deal with these cases put a BlockIf for IsUsedAssociatedProduct around such code. E.g.
            Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsUsedAssociatedProduct%22%20%2f%3e" >
            	<actinic:block php="true">
            		$aspriceraw = '<actinic:variable encoding="perl" name="AssociatedProduct::ProductPriceRaw" selectable="false" />';
            		if ( $aspriceraw > 0 ) formattedcurrency(1.20 * $aspriceraw, 2, '.', ',', ' + £');
            	</actinic:block>
            </actinic:block>
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              I so wish that had worked but the error is the same. Thank you anyway - not sure what to do now!

              Comment


                #8
                It worked fine for me here when I added it to layout Standard Component Layout.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Norman - that is exactly what I did - I replaced the previous code with your new code. I am not saying that your code does not work - but it does not cure the error problem on our site.

                  What my daughter and I are now being forced to do is, over the phone, to compare, product by product, line by line, the differences between the site as it was on 31 Jan 2011 and how it was on 7 Feb 2011.

                  I would have thought that Actinic would have come up with a better way of informing people exactly the cause of an error so that it can be fixed more easily.

                  The botom line is .... the error still exists.

                  Comment


                    #10
                    Why not temporarily delete your block of code that involves this variable. Then if the error doesn't go away, you'll have to locate some other place it's been embedded.

                    You can also search the library for AssociatedProduct::ProductPriceRaw. Just right-click the top of the Layout tree in the Library.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Norman - thank you so much for your help. The problem was that my daughter had deleted an obsolete component believing that it would automatically be deleted from its parent products - which of course it wasn't.

                      We should have spotted more quickly that when Actinic signalled in Design View that it had 4 errors - it automatically indicated where the first error occurred in the Content View (to the right of the split screen) by to going to and highlighting the product where the error appeared first.

                      I guess it would help if users were told that if they delete a component and that component belongs to (let us say) 10 or 15 products, Actinic will neither delete that same component attached to those products nor issue a warning. Perhaps this is something that the developers could be alerted to since it has stopped our site working properly for 2 days.

                      Once again, many thanks for your help.

                      Mike de Malpas

                      Comment


                        #12
                        Modified code for non vat and vat products product price raw

                        Originally posted by NormanRouxel View Post
                        If the code hasn't changed, then the data that you're feeding into it might have.

                        Perhaps you've changed some Components so that they don't have an Associated Product. To deal with these cases put a BlockIf for IsUsedAssociatedProduct around such code. E.g.
                        Code:
                        "<actinic:block php="true">
                        $aspriceraw = '<actinic:variable name="ProductPriceRaw" />';
                        if ( $aspriceraw > 0 ) formattedcurrency(1.20 * $aspriceraw, 2, '.', ',', '');
                        </actinic:block>
                        
                        "
                        };
                        </script>	
                        </actinic:block>
                        Hi Norman, ive modified this a bit to try to get it to work with Google remarketing code, the product price with tax is required for one of the imputs, this code, works fine

                        Code:
                        $aspriceraw = '<actinic:variable name="ProductPriceRaw" />';
                        if ( $aspriceraw > 0 ) formattedcurrency(1.20 * $aspriceraw, 2, '.', ',', '');
                        </actinic:block>
                        
                        "
                        };
                        </script>
                        (i removed the currency symbol)

                        Some of my products are non vat, is there a variable or something that can be modified to accomadate this, as at the moment this adds vat to the price of non vat products price?

                        cheers, lee
                        http://www.novadetox.co.uk

                        Comment


                          #13
                          SD doesn't have any variable that exposes the tax rate. Hence significant hacking required.

                          This lump of code (it needs to be in one long line) will return 1 or 1.2 depending on whether a products Tax Exclusive Price matches the Tax Inclusive Price.
                          Code:
                          <actinic:block type="pricelist"><actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201"><actinic:block if="%3cactinic%3avariable%20name%3d%22TaxExclusivePrice%22%20selectable%3d%22false%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22TaxInclusivePrice%22%20selectable%3d%22false%22%20%2f%3e">1</actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22TaxExclusivePrice%22%20selectable%3d%22false%22%20%2f%3e%20%21%3d%20%3cactinic%3avariable%20name%3d%22TaxInclusivePrice%22%20selectable%3d%22false%22%20%2f%3e" >1.2</actinic:block></actinic:block></actinic:block>
                          And here is some PHP that calculates the tax rate multiplier via some maths. So it will keep working if the tax rate changes or you have some products with custom tax.

                          Note that it always returns 1 if the product price is 0 (to avoid a divide by zero).
                          Code:
                          <actinic:block type="pricelist"><actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201"><actinic:block php="true">
                          $exprice = preg_replace('/[^\d\.]/', '', '<actinic:variable name="TaxExclusivePrice" selectable="false" />');
                          $incprice = preg_replace('/[^\d\.]/', '', '<actinic:variable name="TaxInclusivePrice" selectable="false" />');
                          $taxmultiplier = $exprice > 0 ? round($incprice / $exprice, 2) : 1;
                          echo $taxmultiplier;
                          </actinic:block></actinic:block></actinic:block>
                          N.B. Only lightly tested.
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            Thanks Norman Any Idea about cart total and product in cart array?

                            [CODE]<script type="text/javascript">
                            var google_tag_params = {
                            ecomm_prodid: ["123","234"],
                            ecomm_pagetype: "basket",
                            ecomm_totalvalue: [100,50]
                            };
                            </script>

                            from

                            https://support.google.com/adwords/a...3357#place_tag

                            I read your post about something similar here

                            http://community.sellerdeck.com/showthread.php?t=53814

                            post number 2,

                            I was wondering if there is anything already in the analytics code that is pulling that data out as it displays the order ID and price in the google analytics interface for transaction data.

                            Any help greatly appreciated, I understand if its a bit to much ,
                            http://www.novadetox.co.uk

                            Comment


                              #15
                              Some Progress But How To Get In An Array With Comma Seperate And Remove Currency

                              Code:
                              var array = [];
                              $("tr.item input").each(function() {
                                  array.push({
                                      gr_row: $(this).attr('class'),
                                      gr_ref: $(this).attr('class'),
                                      gr_price: $(this).attr('class')
                                  });
                              });
                              
                              console.log(array);

                              this pulls he data out the rows in the table, but i got no idea how to fit that in with this, If I make 3 copies of the code each pulling on ebit of data will that work? how to seperate by comma?

                              <script type="text/javascript">
                              var google_tag_params = {
                              ecomm_prodid: ["123","234"],
                              ecomm_pagetype: "basket",
                              ecomm_totalvalue: [100,50]
                              };
                              </script>

                              thanks
                              http://www.novadetox.co.uk

                              Comment

                              Working...
                              X