Announcement

Collapse
No announcement yet.

Add to Cart Button Code Error

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

    Add to Cart Button Code Error

    This is my first post on here and I'm not a usual forum user, so this thread is probs in the wrong place.

    I'm having trouble with the cart button on all my pages of this website, http:djzone.co.uk. The button is not there and when I come to upload I get this message "The selector 'AddToCartButton' is recursively used".

    Code:
    <span id="RemoveIfOutOfStock_<actinic:variable name="AddToCartButton" />" class="ActinicRTS" >
    <actinic:block if="%3cactinic%3avariable%20name%3d%22CartButtonVisibleToAllCustomers%22%20%2f%3e" >
    <!-- This code is used when the cart button is visible to all customers -->
    <input type="submit" value="<Actinic:Variable Name="CartButtonText"/>" name="_<Actinic:Variable Name="ProductID"/>" />
    </actinic:block> 
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22EnabledForCustomerGroupID%22%20%2f%3e%20%21%3d%20%22%22">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e">
    <!-- This code is used when the cart button is visible to retail customers, but not all other customer groups -->
    <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="AddToCartButton" />">
       <input type="submit" value="<Actinic:Variable Name="CartButtonText"/>" name="_<Actinic:Variable Name="ProductID"/>" />
    </Actinic:ShowForPriceSchedule>
    </actinic:block>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e%20%3d%3d%20FALSE" >
    <!-- This code is used when the cart button needs to hidden from retail customers -->
    <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="AddToCartButton" />" HTML="<input type='submit' value='<Actinic:Variable Name="CartButtonText"/>' name='_<Actinic:Variable Name="ProductID"/>' />"></Actinic:ShowForPriceSchedule>
    </actinic:block>
    </actinic:block>
    </span>
    Please help me with this and just to warn you, I'm a novice at Actinic. So no complicated jargon. Thanks,
    Steve
    Online Sales Manager for DJZone.co.uk

    #2
    Welcome, Steve.

    Someone's messed up and replaced some Actinic variables with the AddToCartButton selector inside the Add To Cart Button layout. Hence the recursion.

    For example, you have:
    Code:
    <span id="RemoveIfOutOfStock_<actinic:variable name="AddToCartButton" />" class="ActinicRTS" >
    And it should be:
    Code:
    <span id="RemoveIfOutOfStock_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" >
    Go to Design / Library / Layouts and locate the Add To Cart Button layout you've messed up. Right-click its entry and choose Revert To Factory Settings.

    Repeat for any other layouts you may have damaged.

    P.S. We're volunteers here and it comes over as bad form if you expect us to write long winded posts because you're not willing to read up on the necessary jargon.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      I have done as you have said and now it's come up with a new code error - "The 'ProductReference' variable has been placed within the 'add to cart button' layout, but it wont work there... :s

      P.S. Sorry for sounding patronising, I've only just been using Actinic for about a week, the Online manager before me had set up the webpage and has left me with a load of errors.
      Steve
      Online Sales Manager for DJZone.co.uk

      Comment


        #4
        That may be a spurious message. Try Compacting Databases and restarting Actinic.

        If that doesn't fix it; perhaps you've got the Add to Cart Button layout in the wrong place within the parent structure.


        Here's the standard Add To Cart Button layout from a Silver theme site like yours:
        Code:
        <span id="RemoveIfOutOfStock_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" >
        <actinic:block if="%3cactinic%3avariable%20name%3d%22CartButtonVisibleToAllCustomers%22%20%2f%3e" >
        <!-- This code is used when the cart button is visible to all customers -->
        <span class="button-wrapper cart-button-wrapper"><input value="<Actinic:Variable Name="CartButtonText"/>" name="_<Actinic:Variable Name="ProductID"/>" type="submit" class="button cart-button" /></span>
        </actinic:block> 
        
        <actinic:block if="%3cactinic%3avariable%20name%3d%22EnabledForCustomerGroupID%22%20%2f%3e%20%21%3d%20%22%22">
        <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e">
        <!-- This code is used when the cart button is visible to retail customers, but not all other customer groups -->
        <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="EnabledForCustomerGroupID" />">
        <span class="button-wrapper cart-button-wrapper"><input value="<Actinic:Variable Name="CartButtonText"/>" name="_<Actinic:Variable Name="ProductID"/>" type="submit" class="button cart-button" /></span>
        </Actinic:ShowForPriceSchedule>
        </actinic:block>
        
        <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceIsEnabled%22%20%2f%3e%20%3d%3d%20FALSE" >
        <!-- This code is used when the cart button needs to hidden from retail customers -->
        <Actinic:ShowForPriceSchedule Schedules="<actinic:variable name="EnabledForCustomerGroupID" />" HTML="<span class='button-wrapper cart-button-wrapper'><input value='<Actinic:Variable Name="CartButtonText"/>' name='_<Actinic:Variable Name="ProductID"/>' type='submit' class='button cart-button' /></span>"></Actinic:ShowForPriceSchedule>
        </actinic:block>
        </actinic:block>
        </span>
        ProductReference variable happily working there.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          I have tied this and I have got no further with the issue. Actinic keeps crashing and closing by it's self now whenever I first open it up.

          My boss had decided to take out Actinic Cover and get a live engineer to fix this because as I said, I'm a novice at Actinic and I can't get my head round half of it...

          Thank you very much for your help
          Steve
          Online Sales Manager for DJZone.co.uk

          Comment

          Working...
          X