Thread: minimum amount

Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 59
  1. #41
    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?

  2. #42
    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!!

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

    Default Re: minimum amount

    Thanks for the update that you have this fixed now ...
    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!

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

    Default Re: minimum amount

    Quote Originally Posted by limelites View Post
    Getting something, here's the code I inserted in the tpl_checkout_split.php file, just about the PAYPAL fieldset:

    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" />
    Definitely working, I just need to style it in CSS now, so it appears in the correct position.

    Thank you Ajeh!! I knoew you'd have the right tricks up your sleeve for this one. You underestimate yourself :)

    Hi Ajeh,

    Are you still watching this thread? Not sure if you remember this but if you are watching it then maybe you can figure out what might have caused this so tstop working? It was working a few days ago but now it's not and I can't think why as it's still coded into the tpl_checkout_split.php file like this:

    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 ?>

    Can't figure out why it would have just stopped working. It's as though a different file is generating the checkout page now?! Weird!

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

    Default Re: minimum amount

    Put this code about the IF:
    Code:
    <?php echo 'ORDER TOTAL: ' . $order->info['total'] . ($order->info['total'] < 100 ? 'YES' : ' NO') . '<br>';?>
    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!

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

    Default Re: minimum amount

    Quote Originally Posted by Ajeh View Post
    Put this code about the IF:
    Code:
    <?php echo 'ORDER TOTAL: ' . $order->info['total'] . ($order->info['total'] < 100 ? 'YES' : ' NO') . '<br>';?>
    I don't even understand what that did but it certainly did the trick! I just changed it to:

    PHP Code:
    <?php if ($order->info['total'] < 100.00 'YES' ' NO') { ?>
    <div class="alertInstalmentsShadowedOut"><?php echo zen_image(DIR_WS_TEMPLATE 'images/instalments_shadowed_out.gif'); ?></div>
    <?php ?>
    Thank you Ajeh, this forum would be an altogether different place without your genius!

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

    Default Re: minimum amount

    Sorry you are not using that right:
    Code:
    <?php echo 'ORDER TOTAL: ' . $order->info['total'] . ($order->info['total'] < 100 ? 'YES' : ' NO') . '<br>';?>
     <?php if ($order->info['total'] < 100.00) { ?>
    
                                        <div class="alertInstalmentsShadowedOut"><?php echo zen_image(DIR_WS_TEMPLATE . 'images/instalments_shadowed_out.gif'); ?></div>
    
                                            <?php } ?>
    The point is to echo the content of $order->info['total'] where you are using that for you current IF ...
    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!

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

    Default Re: minimum amount

    Quote Originally Posted by Ajeh View Post
    Sorry you are not using that right:
    Code:
    <?php echo 'ORDER TOTAL: ' . $order->info['total'] . ($order->info['total'] < 100 ? 'YES' : ' NO') . '<br>';?>
     <?php if ($order->info['total'] < 100.00) { ?>
    
                                        <div class="alertInstalmentsShadowedOut"><?php echo zen_image(DIR_WS_TEMPLATE . 'images/instalments_shadowed_out.gif'); ?></div>
    
                                            <?php } ?>
    The point is to echo the content of $order->info['total'] where you are using that for you current IF ...
    It was working a few days ago though, with just this:

    PHP Code:
      <?php if ($order->info['total'] < 100.00) { ?>
    Nothing had changed so couldn't understand why it just stopped working and now requires this:

    PHP Code:
     <?php if ($order->info['total'] < 100.00 'YES' ' NO') { ?>

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

    Default Re: minimum amount

    If does NOT require that ...

    That extra code is just to see if where you are testing the amount that it is actually an amount that can be used in your IF ...

    Example, if $order->info['total'] was not defined or was set to something odd like 0, when it should be 125.75 where you are using it, then that would help you know it is set correctly for your needs ...
    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!

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

    Default Re: minimum amount

    Quote Originally Posted by Ajeh View Post
    If does NOT require that ...

    That extra code is just to see if where you are testing the amount that it is actually an amount that can be used in your IF ...

    Example, if $order->info['total'] was not defined or was set to something odd like 0, when it should be 125.75 where you are using it, then that would help you know it is set correctly for your needs ...
    That's what I thought. It's quite weird because up until a few days ago, it was working perfectly well with:
    PHP Code:
    <?php if ($order->info['total'] < 100.00) { ?>
    The shadowed out image was being displayed as it should, whenever the total vallue of the cart contents was <100. Then, for no reason it stopped working.

    As soon as I changed it to this:
    PHP Code:
      <?php if ($order->info['total'] < 100.00 'YES' ' NO') { ?>
    It started to work.

    I've re-tested just now with the exact same cart contents in each test, logged in as the same person each time. As soon as I remove the ? 'YES' : ' NO' part, it stops displaying the image. So, in this case it seems it's required? Just can't figure out why. At least it's working though, which is good.

 

 
Page 5 of 6 FirstFirst ... 3456 LastLast

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