Announcement

Collapse
No announcement yet.

Minimum Order Value based on Price Band

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

    Minimum Order Value based on Price Band

    Hi,

    I'd like to be able to set up minimum order values on a per-customer-group basis.

    Eg.

    Retail - No minimum
    Trade1 - £150 Minimum
    Trade2 - £300 Minimum

    As far as i can see, the only option for setting a minimum order value is on the whole site for all groups, or a maximum order value on a per-buyer basis - Is there something I've missed or a hack i can make to ActinicOrder.pm to check the buyers price schedule using GetBuyerAndAccount() in CheckBuyerLimit() rather than GetBuyer() and then comparing $Account->{PriceSchedule} against some hard-coded Schedules for the minimum... Which looks completely possible... so will $Account->{PriceSchedule} return the number for the price schedule in the 'Price Schedules' table related to the buyer in ActinicCatalog.mdb

    I hope this all makes sense because i've been trying to work things out as I go along
    Matt
    Actinic User since v.3

    Custom Actinic Site Specialist:
    <a href="http://www.glowsticksdirect.co.uk/">GlowSticksDirect.co.uk</a>
    <a href="http://www.digishopdirect.co.uk/">DigiShopDirect.co.uk</a>
    <a href="http://www.calibreshopping.co.uk/">CalibreShopping.co.uk</a>

    #2
    Well, I think i'm nearly there... Can you please confirm what format the number for $nLowerBound should be - Is it

    $nLowerBound = 150.00;
    _or_
    $nLowerBound = 15000;

    For a £150.00 minimum order value in the CheckBuyerLimit() sub, or something completely different?
    Matt
    Actinic User since v.3

    Custom Actinic Site Specialist:
    <a href="http://www.glowsticksdirect.co.uk/">GlowSticksDirect.co.uk</a>
    <a href="http://www.digishopdirect.co.uk/">DigiShopDirect.co.uk</a>
    <a href="http://www.calibreshopping.co.uk/">CalibreShopping.co.uk</a>

    Comment


      #3
      Hi Pneumatus,

      It should be 15000
      Bruce King
      SellerDeck

      Comment


        #4
        Thanks Bruce,

        Can you confirm that from this code:
        Code:
        ($Status, $sMessage, $pAccount) = ACTINIC::GetCustomerAccount($$pBuyer{AccountID}, ACTINIC::GetPath());
        $pAccount->{PriceSchedule} contains the nID field from the 'Price Schedules' table in ActinicCatalog.mdb
        Matt
        Actinic User since v.3

        Custom Actinic Site Specialist:
        <a href="http://www.glowsticksdirect.co.uk/">GlowSticksDirect.co.uk</a>
        <a href="http://www.digishopdirect.co.uk/">DigiShopDirect.co.uk</a>
        <a href="http://www.calibreshopping.co.uk/">CalibreShopping.co.uk</a>

        Comment


          #5
          If you need the schedule ID it is better to use ActinicOrder::GetScheduleID which is already tested and covers all the cases.

          Probably the best bet if you set up a hash like
          Code:
          $::BuyerLimits =
            {
            $ActinicOrder::RETAILID => 0,
            1 => 15000,
            2 => 300
            }
          Then change the line

          Code:
          my $nLowerBound = $$::g_pSetupBlob{'MIN_ORDER_VALUE'};
          in CheckBuyerLimit to
          Code:
          my $nLowerBound = $::BuyerLimits{GetScheduleID()};
          Something like this should work IMO. But please note it was written directly to the forum (IOW I haven't tested it) therefore some finetunning may be required.

          I hope this helps.

          Cheers
          Zoltan
          Actinic Software
          www.actinic.co.uk

          Comment


            #6
            Thanks a lot Zoltan,

            Didn't notice GetScheduleID() - looks like it will do the job nicely. The only change I think the above code needs is passing the Digest to the sub rather than passing with no params i.e.
            Code:
            my $nLowerBound = $::BuyerLimits{GetScheduleID($sDigest)};
            Else it will always return $ActinicOrder::RETAILID.

            Thanks again
            Matt
            Actinic User since v.3

            Custom Actinic Site Specialist:
            <a href="http://www.glowsticksdirect.co.uk/">GlowSticksDirect.co.uk</a>
            <a href="http://www.digishopdirect.co.uk/">DigiShopDirect.co.uk</a>
            <a href="http://www.calibreshopping.co.uk/">CalibreShopping.co.uk</a>

            Comment


              #7
              Yes, you are right, the digest is needed there. I'm always missing the obvious even if I should know that according to the function header .
              Zoltan
              Actinic Software
              www.actinic.co.uk

              Comment

              Working...
              X