Announcement

Collapse
No announcement yet.

Additional Text In Cart

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

    Additional Text In Cart

    Hi,

    In Business Plus V16, I would like to add an additional piece of text to my cart and checkout and Norman at Drillpine was kind enough to get me most of the way there. My problem is that my product descriptions come from Sage via Link and are limited to 60 characters. That's enough to describe the variation of the product and the part number, but not enough to fully describe what the product actually is.

    So, currently I get something like :

    123.45678.999 • 130mm • Polished Brass

    Where what I really need is

    123.45678.999 • 130mm • Polished Brass Face Fixing Pull Handle

    So, in ActinicOrder.pm it was suggested I add this line :

    $sProductLineHTML .= $$pProduct{CUSTOMVARS}{Parent_Name};

    (where Parent_Name is the new variable I have created and populated in each product)

    Immediately before this line :

    $ProdTable = ProductLineHTML($$pProduct{'REFERENCE'}, $sProdLink, $sQuantityText, $sProductLineHTML, $sDuplicateLinkLineHTML, $$pProduct{'DUPLICATES'}, $sThumbnail, $bIncludeButtons);

    This works for the first item added to the cart, but each subsequent item consists of it's own variation followed by the previous cart product's additional text and then it's own additional text, something like :

    (1st cart item, all good) 123.45678.999 • 130mm • Polished Brass Face Fixing Pull Handle
    (2nd cart item, not good) 987.65432.111 • 600mm • Satin Chrome Face Fixing Pull HandleBolt Fixing Pull Handle

    I believe this may be caused by the .= in the first line of code, which appends rather than replaces the subsequent text, but if I remove the . all I get is the Parent_Name text and not the variation.

    If any one has any ideas, please keep it simple as I am a lot more stupid than perhaps this post suggests.

    Thanks,
    Steve

    #2
    I have to admit the code looks like it should work to me.

    The append is right as you want to add the additional text from the customvar to the existing product html text.

    It also looks as if the code is looking up the Parent_Name text each time rather than storing it as a variable so I can't see how the previous text is being retained.

    Presumably the multiple bits of text appear consistently with different products which shows it's not a problem with the data in the hash table?

    The only thing I can really see that looks incorrect is that I think you should really have single quotes around your hash lookup values. i.e.

    Code:
    $sProductLineHTML .= $$pProduct{'CUSTOMVARS'}{'Parent_Name'};
    I don't know if that will make any difference or not.
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      Try removing the line:
      Code:
      $sProductLineHTML .= $$pProduct{CUSTOMVARS}{Parent_Name};
      And replace:
      Code:
      $ProdTable = ProductLineHTML($$pProduct{'REFERENCE'}, $sProdLink, $sQuantityText, $sProductLineHTML, $sDuplicateLinkLineHTML, $$pProduct{'DUPLICATES'}, $sThumbnail, $bIncludeButtons);
      With:
      Code:
      $ProdTable = ProductLineHTML($$pProduct{'REFERENCE'}, $sProdLink, $sQuantityText, $sProductLineHTML . $$pProduct{'CUSTOMVARS'}{'Parent_Name'}, $sDuplicateLinkLineHTML, $$pProduct{'DUPLICATES'}, $sThumbnail, $bIncludeButtons);
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Hello Gents,

        Many thanks for your input.

        I have tried adding the ' s (thanks you Mike) and replacing the text as suggested (thank you Norman) but the result is exactly the same as before with the duplicated text.

        I wonder if the position of the append dot is important in any way? I have tried moving it and the other variables around but no matter what order I put them in I get the same thing.

        I don't know if it's relevant, but I even deleted the {'CUSTOMVARS'} part of the expression, and it still gave the same result?

        A real head scratcher.

        Comment


          #5
          Deleting the customvars bit isn't a sign of a problem.

          When you use a hash table you're accessing data buckets that have a name. As the 'Parent_Name' bucket is unique you don't really need to specify the 'customvars' bit.

          I'm still confused by the text duplication though. It needs a bit more thought.

          Mike
          -----------------------------------------

          First Tackle - Fly Fishing and Game Angling

          -----------------------------------------

          Comment


            #6
            Hi again,

            I have found the issue and it is working famously now!!

            Norman's last suggestion worked perfectly, but I had left in the = sign when moving the command, although I would swear I cut and paste it from this forum??

            So, the solution is to create a new product text variable (in this case called Parent_Name) and to amend the relevant line of code in ActinicOrder.pm to read :

            $ProdTable = ProductLineHTML($$pProduct{'REFERENCE'}, $sProdLink, $sQuantityText, $sProductLineHTML . $$pProduct{CUSTOMVARS}{Parent_Name}, $sDuplicateLinkLineHTML, $$pProduct{'DUPLICATES'}, $sThumbnail, $bIncludeButtons);

            Thank you both for your input, but special thanks to Norman and rest assured I will be implementing a few of your add-ons once I get the site reorganised.

            Cheers,
            Steve

            Comment


              #7
              Good to know it's working. Do you need a space inserted between the product name and parent name?
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Thanks but It has already inserted a space. It's exactly what I wanted and negates a whole plethora of problems I was encountering when having to use components instead of just plain products. (see image attached, if the forum will allow)

                Cheers,
                Steve
                Attached Files

                Comment

                Working...
                X