Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    34
    Plugin Contributions
    0

    Code issue - Shipping module not working

    I am working on a shipping module that is postcode based and also has a maximum number of deliveries available in that time slot.

    The plan is to have Monday through Staurday available and as we deliver to different areas on different days the postcode takes care of what days are available. The other issue is that we want to be able to limit the number of orders that can be placed on a Monday for example. We don't want 500 deliveries to do on Monday and 10 on Thursday in the same area when we could limit the deliveries to 300 then the remaining customers would select the Thursday for their delivery. Complicated I know but I am really close to nutting it out. My issue at this stage is with comparing the MODULE_SHIPPING_MONDAYAM_MAXCOUNT (which is set in the admin panel) with the number of exsisting orders.
    My plan was to use count(shipping_module_code) in an SQL statement like this:

    $check_query = $db->Execute("select count(shipping_module_code) from " . TABLE_ORDERS . " where orders_status = 1 and shipping_module_code = 'mondayam'");
    $count = $check['count(shipping_module_code)'];
    if ($count > (int)MODULE_SHIPPING_MONDAYAM_MAXCOUNT) {
    $check_count = false;
    }
    if ($count <= (int)MODULE_SHIPPING_MONDAYAM_MAXCOUNT) {
    $check_count = true;
    }


    I'm sure that it is close I am probably doing something stupid here are I am somewhat new to PHP and MySQL.

    I have attached the file so if there is anyone that can run their eyes over it and see where I am going wrong. I get no error messages it just doesn't stop offering the delivery option when more that the maxcount has been exceeded.

    Any help greatly appreciated

    Siege
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2005
    Posts
    34
    Plugin Contributions
    0

    Idea or Suggestion Re: Code issue - Shipping module not working

    It's all good - I got it sorted out

    I will post the code on the tread talking about local delivery by postcode.


    Siege

 

 

Similar Threads

  1. USPS Shipping Module not working
    By lavs in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 7 Nov 2010, 04:22 PM
  2. Shipping module not working
    By Nanettedp in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 12 Nov 2007, 09:05 PM
  3. UPS shipping module not working
    By sunwoochong in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 20 Jul 2006, 06:21 PM
  4. Own Shipping Module not working
    By Stasis_15 in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 3 Jul 2006, 08:59 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