Announcement

Collapse
No announcement yet.

List product ids/refs in shopping basket

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

    List product ids/refs in shopping basket

    Client has engaged a marketing company who require a number of bits of code to be added to the site.
    Whilst I have generated a list of product ids appearing in the product list, I am unable to make a list of product ids in the basket, as these layouts are xmltemplate and I do not know how to manipulate them.

    Is there any php or script that can generate a list of the ids of the products in the basket?

    Incidentally, to create a list of product references in a product page, copy and rename a product layout, strip everything out except the product reference variable.
    Copy and rename a product list layout, remove the references to fragments, replace the product layout with the new product reference layout you just made.
    In the orange table bit at the top, strip out everything in the start of list and end of list boxes, in the edit rows and boxes make the middle row dynamic and have a comma as the 'after' symbol. (or whatever code you want.)

    Thank you
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    If you switch product references on within settings > business settings > options, the product reference will show both on product layout and in the cart without you needing to do anything. It's a standard feature on the software.

    Comment


      #3
      Thanks Lee
      I need a separate list of product references for items in the basket that can be incorporated into this expression:
      Code:
      <script type="text/javascript">
      (function(){ var x = document.createElement('script'); x.async = true;
      x.src = "//creativecdn.com/tags?type=script&id=pr_{HASH}_basketstatus_{ID},{ID},{ID}";
      document.getElementsByTagName('head')[0].appendChild(x); }());
      </script>
      Where {ID} are the product references. Any ideas?

      The list I have already generated (above) for the product list goes in this expression:
      Code:
      <script type="text/javascript">
      (function(){ var x = document.createElement('script'); x.async = true;
      x.src = "//creativecdn.com/tags?type=script&id=pr_{HASH}_listing_{ID},{ID},{ID}";
      document.getElementsByTagName('head')[0].appendChild(x); }());
      </script>
      Where {ID},{ID},{ID} is replaced with <actinic:variable name="Tabular ProductList" value="Product List ProdRef" />
      Jonathan Chappell
      Website Designer
      SellerDeck Website Designer
      Actinic to SellerDeck upgrades
      Graphicz Limited - www.graphicz.co.uk

      Comment


        #4
        Locate the TD cell that contains the Product Reference in the cart table. Add a classname to it.

        Amend your JS to locate all TD with this classname (jQuery will simplify this) and build ID list from these cells contents.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks Norman. Another learning curve for me!
          Jonathan Chappell
          Website Designer
          SellerDeck Website Designer
          Actinic to SellerDeck upgrades
          Graphicz Limited - www.graphicz.co.uk

          Comment


            #6
            jQuery way assuming TD cells have class="refcell" then:
            Code:
            var reflist = '';
            $( "td.refcell" ).each( function(){reflist += '{' + $(this).text() + '},';} ); // concatenate {ID},
            reflist = reflist.slice(0, -1);	// chop off trailing comma
            NB untested.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              That's very kind of you Norman. I will try it tomorrow and report back.
              Jonathan Chappell
              Website Designer
              SellerDeck Website Designer
              Actinic to SellerDeck upgrades
              Graphicz Limited - www.graphicz.co.uk

              Comment

              Working...
              X