Announcement

Collapse
No announcement yet.

Stop Products Adding Together in Cart

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

    Stop Products Adding Together in Cart

    I am selling a product in rolls, sized in lengths of anything between 5 and 80 mtrs (length chosen by the customer).

    The problem I am having is if the customer wants to order two seperate lengths of the same item the cart adds them together as one item and I therefore do not know it is two rolls of different sizes

    I have looked and looked again for an option to check or uncheck to ask the cart to treat them as two different items, and checked the forum and the knowledgebase for an answer but can't find anything.

    Can anyone point me in the right direction?

    Thanks

    #2
    I found a solution for V7 and the code is still the same for V9. See http://community.actinic.com/archive...p/t-35249.html

    Note that this will stop all identical items from being combined.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Hi Norman

      Originally posted by NormanRouxel View Post
      Note that this will stop all identical items from being combined.
      I can live with that.....I think.

      Can I check with you what I am changing as I know absolutely nothing about perl scripts

      I have copied and pasted the following from the Cart.pm .....

      sub CombineCartLines
      {
      my $Self = shift;
      my $pCartList = $Self->{_CartList}; # reference to cart list
      my $nCartIndex;
      my %Removed; # list of removed items

      for( $nCartIndex = 1; $nCartIndex <= $#$pCartList; $nCartIndex++ ) # loop over the whole list
      {
      my $pCartItem = $pCartList->[$nCartIndex];
      my @aFoundIndices = $Self->FindSimilarCartItems($pCartItem, 0, $nCartIndex - 1);
      my $nFoundIndex;
      foreach $nFoundIndex (@aFoundIndices)
      {
      $Removed{$nCartIndex} = $::TRUE; # Identical, remember to remove this one
      $pCartList->[$nFoundIndex]->{QUANTITY} += $pCartList->[$nCartIndex]->{QUANTITY}; # add quantity to the other one
      }
      }
      foreach (sort {$b <=> $a} keys(%Removed)) # Remove repeated lines (backwards!)
      {
      splice @$pCartList,$_,1;
      }
      }

      Do I take out ALL (?) the above code and enter the following instead...


      sub CombineCartLines
      {
      return; # don't combine
      }


      Many, Many thanks for your help

      Comment


        #4
        No. Just do as the prior post. Amend

        Code:
        sub CombineCartLines
        {
        to be

        Code:
        sub CombineCartLines
        {
        return; # don't combine
        Leave everything else as it is.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi Norman

          Thanks for the quick reply...very much appreciated.

          I will give it a try tomorrow.

          Thank you again for the solution, it sounds like it will do the job perfectly.

          Comment

          Working...
          X