Thread: minimum amount

Results 1 to 10 of 59

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: minimum amount

    Another difference I can see that might help manipulate the logic is that there will never be a checkoutShippingMethods fieldset or even a checkoutShippingTable at the confirmation page when I want to disable the Pay by Instalments.

    When you're paying an instalment, the product is virtual, so the shipping table is not on the page.

    The INSTALMENT prodcut is the only product on the site where this will ever happen.

  2. #2
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: minimum amount

    This is the logic that shadows out the Pay by Instlaments when the cart total is less than £100.00:

    PHP Code:
    <?php if ($order->info['total'] < 100.00) { ?>
    <div class="alertInstalmentsShadowedOut"><?php echo zen_image(DIR_WS_TEMPLATE.'images/instalments_shadowed_out.gif'); ?></div>
    <?php ?>
    <br class="clearBoth" />
    So, in summary, is there a statement I could add to this code that would also shadow it out if ($products_id == '1652') { for example?

  3. #3
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: minimum amount

    I tried this one:

    PHP Code:
    <?php if ($order->info['total'] < 100.00 or $order->info['weight'] == 0) { ?>
    as the logic and it does use the shadowed out version, but it adds it in so there are two. One's shadowed out and the other is still there as normal:


  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: minimum amount

    You can control the $this->enabled for the payment module with:
    Code:
    if (!IS_ADMIN_FLAG) {
      global $cart;
      if ($_SESSION['cart']->show_weight() > 0) {
        $this->enabled = false;
      }
    }
    I do not know the code you are using but if this were the Check/Money Order moneyorder Payment module, the code would go below the code:
    Code:
          $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: minimum amount

    Perfect!! Thank you yet again Ajeh. You are a true genius!! A legend in fact!!!

    It's coming together for me with this little mod, it's going to be really good. I just have a couple of little niggles I'm trying to iron out now. Not sure if it's your thing, but if you took a look at this thread then I bet your genius would shine through with an answer :)

    http://www.zen-cart.com/forum/showthread.php?t=176751

    I've gotten so far with it, but can't figure out the last part (an alternative checkout success page)

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: minimum amount

    Hi Ajeh, I thought I had this working, but it's actually causing a problem that I hadn't noticed until now. Let me try and explain using some logic bullet points so you can understand what's happening :)

    - all products on www.silkblooms.co.uk have a product weight assigned that's > 0 (apart from product 1652)

    - product ID 1652 has been customised as an incremental value product so that people can enter a value into their cart and checkout (thereby paying an instalment towards tehir account balance) it's weight set to 0 so I can manipulate behaviour below

    - I'm using a modified vesrsion of the accountholder mod as a way of letting people check out on a payment plan if their cart value is > 100.00 (works perfectly). If their cart is < 100.00 it does not appear if (!IS_ADMIN_FLAG && $order->info['subtotal'] < 100.00 {$this->enabled = false;} (works perfectly)

    - I'm trying to prevent the accountholder mod from appearing as an option when people only have product ID 1652 in their cart (when they're paying an instalament towards their outstanding balance, I don't want them being able to select 'Pay by Instalments' as an option). This is what's causing the problems. I thought I had this working but I hadn't noticed the problem our coding has caused, until now.

    Here is a copy of the PHP used to modify the accountholder.php file:
    PHP Code:
    // class constructor
        
    function accountholder() {
          global 
    $order;

          
    $this->code 'accountholder';
          
    $this->title MODULE_PAYMENT_ACCOUNTHOLDER_TEXT_TITLE;
          if (
    IS_ADMIN_FLAG === true && (MODULE_PAYMENT_ACCOUNTHOLDER_PAYTO == 'Just pay the rest when you can' || MODULE_PAYMENT_ACCOUNTHOLDER_PAYTO == '')) $this->title .= '<span class="alert"> </span>';
          
    $this->description MODULE_PAYMENT_ACCOUNTHOLDER_TEXT_DESCRIPTION;
          
    $this->sort_order MODULE_PAYMENT_ACCOUNTHOLDER_SORT_ORDER;
          
    $this->enabled = ((MODULE_PAYMENT_ACCOUNTHOLDER_STATUS == 'True') ? true false);
          if (!
    IS_ADMIN_FLAG) {
      global 
    $cart;
      if (
    $_SESSION['cart']->show_weight() == 0) {
        
    $this->enabled false;
      }
    }
          
          
    // bof: disable based on Order Amount
    // use $order->info['subtotal'] or $order->info['subtotal']
    if (!IS_ADMIN_FLAG && $order->info['subtotal'] < 100.00) {
    $this->enabled false;
    }

    // eof: disable based on Order Amount 
    As I say, I thought this was working and to a certain extent it is. When a product is added to the cart and it's weight is 0kg then the acountholder.php (pay by instalments) is not showing as an option at the checkout confirmation page. Great, but it's doing something to all other procuts too!!

    When I add a normal product to my cart with weight >0 it's somehoe causing the cart summart to display as 0kg (even though product weight is definitely > 0). Then when I add product ID 1652 to the cart it starts to calculate the other produc'ts weight correctly.

    I hope you can understand my problem. I've tried to be as concise as possible in the hope that you can see what's wrong and shed some of your wisdom on this for me once more?

  7. #7
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: minimum amount

    Ignore this Ajeh, turns out I had selected "Yes, Always Free Shipping" in most of my products which is why it's displaying 0kg!! Duuuuuuh!! It had nothing to do with our modifications!!

 

 

Similar Threads

  1. Minimum sale amount
    By alohacomputer in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 22 Jun 2011, 08:02 PM
  2. Minimum Purchase Amount?
    By wicks in forum Managing Customers and Orders
    Replies: 3
    Last Post: 3 Apr 2009, 06:44 PM
  3. minimum order amount
    By paolacauter in forum General Questions
    Replies: 1
    Last Post: 27 Nov 2007, 05:23 PM
  4. Minimum Order Amount
    By msdave in forum Managing Customers and Orders
    Replies: 2
    Last Post: 6 Oct 2007, 12:00 AM
  5. Minimum Order Amount V2.0
    By johnny43 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 16 Jul 2006, 06:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg