Page 73 of 85 FirstFirst ... 2363717273747583 ... LastLast
Results 721 to 730 of 849
  1. #721
    Join Date
    Aug 2013
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Thank you

  2. #722
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Hi,

    I am using the Swipe HQ payment module, I also have quantity discounts installed. For some reason on the order confirmation e-mail the discount gets taken of the total twice - it doesn't do this anywhere else, just on the confirmation e-mail and only when using the swipeHQ payment module.

    Below is the code I believe to be responsible for sending the order confirmation e-mail from the swipehq module:

    //send emails
    if (!empty($_REQUEST['user_data'])) {
    $order_id = $_REQUEST['user_data'];
    if (!empty($_SESSION['swipehq_order_' . $order_id])) {
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    require_once('includes/languages/english/checkout_process.php');

    require_once(DIR_WS_CLASSES . 'order.php');
    require_once(DIR_WS_CLASSES . 'payment.php');
    $payment_class = new payment($_SESSION['payment']);
    $order = unserialize($_SESSION['swipehq_order_' . $order_id]);

    require_once(DIR_WS_CLASSES . 'order_total.php');
    $order_total_modules = new order_total;
    $order_totals = $order_total_modules->process();
    $order->send_order_email($order_id, 2);

    $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL');
    }

    }

    For some reason this is causing zencart to take the discount of the total twice (but only on the order confirmation e-mail).

    Below is an example of what the confirmation e-mail looks like:

    Sub-Total: $135.60
    Fastways Courier
    (Delivery to 2110 - Please allow 2-3 working days for delivery once payment has been confirmed1 box(es) 1.16kg(s)): $4.50
    Quantity Discount: -$6.78
    GST: $16.52
    Total: $126.54 (This should be $133.32, but instead of the correct discount of 6.78 being applied, 13.56 is being taken of the total)

    I have e-mailed SwipeHQ re this, but they say it is due to the mods I have installed and can't help.

    I believe it is the code below that is causing the problem, but can't figure out what I could change to get the confirmation e-mail sent with the correct total.

    require_once(DIR_WS_CLASSES . 'order_total.php');
    $order_total_modules = new order_total;
    $order_totals = $order_total_modules->process();

    Any help would be very appreciated.

    Thanks,

    Mike.

  3. #723
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Quantity Discounts for 1.3

    You're going to have to do some debugging. Start printing out the variables after the line that says $order = unserialize($_SESSION['swipehq_order_' . $order_id]);
    and see where things are going awry.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #724
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Hi,

    Sorry, I am not very good at PHP - I tried using print_r and echo to print the variables, but it is just causing the site to crash. How do I go about printing variables?

    (I have also check Zencarts error log but there is nothing coming up in there).

    Thanks,

    Mike.

  5. #725
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Hi again,

    Just found this post: http://www.zen-cart.com/showthread.p...tudy-variables, I will give some of the suggestions here a go and report back. Thanks for pointing me in the right direction Scott.

    Regards,

    Mike

  6. #726
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Hi again,

    Below is the contents of the order_total array being used for the confirmation e-mail.

    order_total Object
    (
    [modules] => Array
    (
    [0] => ot_subtotal.php
    [1] => ot_shipping.php
    [2] => ot_quantity_discount.php
    [3] => ot_tax.php
    [4] => ot_total.php
    )

    )
    </pre><br><br> <pre>Array
    (
    [0] => Array
    (
    [code] => ot_subtotal
    [title] => Sub-Total:
    [text] => $135.60
    [value] => 135.6
    [sort_order] => 100
    )

    [1] => Array
    (
    [code] => ot_shipping
    [title] => Fastways Courier (Delivery to <b>2110</b> - Please allow 2-3 working days for delivery once payment has been confirmed<br>1&nbsp;box(es) 1.16kg(s)):
    [text] => $4.50
    [value] => 4.49995
    [sort_order] => 200
    )

    [2] => Array
    (
    [code] => ot_quantity_discount
    [title] => Quantity Discount:
    [text] => -$6.78
    [value] => 6.78
    [sort_order] => 295
    )

    [3] => Array
    (
    [code] => ot_tax
    [title] => GST:
    [text] => $16.52
    [value] => 16.51695
    [sort_order] => 300
    )

    [4] => Array
    (
    [code] => ot_total
    [title] => Total:
    [text] => $126.54
    [value] => 126.53995
    [sort_order] => 999
    )

    All information is correct with the exception of the total. I can only assume that the swipehq code is somehow telling the order_total module to take the discount of the total twice - although I can't figure out where or how. Any ideas?

    Thanks,

    Mike

  7. #727
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Quantity Discounts for 1.3

    Quote Originally Posted by mikecnz View Post
    I have e-mailed SwipeHQ re this, but they say it is due to the mods I have installed and can't help.
    I'll bet you the same thing happens if you use the (built in) Group Discounting module, btw.

    Try this: Instead of creating a new $order_total_modules, unserialize it the way you unserialize the order (you would of course have to serialize it when you serialize the order too).
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #728
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Hi Scott,

    You were correct in your assumption. I have been talking with SwipeHQ about your suggestion, but have been stonewalled. I tried to work it out myself but couldn't get it to work (mostly because it was trial and error and I really don’t know what I am doing).

    The other thought I had was would it be possible to pull the information from the database (like the admin invoice does)? I've look at the tables but can't find where the quantity discount is recorded.

    Thanks,

    Mike.

  9. #729
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Quantity Discounts for 1.3

    It's in the order totals table. Sorry they're not cooperating - did you tell them the same problem will exist with built-in Group Discounts?
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #730
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    54
    Plugin Contributions
    0

    Default Re: Quantity Discounts for 1.3

    Thanks, I obviously didn't look far enough through the orders to find one that qualified for a discount (silly me)

    Yes, I mentioned to them that the issue wasn't just with the mod, I think they are just to busy to care at the moment.
    Could I perhaps try something likes this:

    $order_totals = $db->Execute("select , text, from " . TABLE_ORDER_TOTALS . "
    where orders_id = '" . (int)$oID . "'");

    Although now that I have written that it doesn't look like it would work.

    Regards,

    Mike.

 

 
Page 73 of 85 FirstFirst ... 2363717273747583 ... LastLast

Similar Threads

  1. v153 quantity discounts for attributes
    By delia in forum General Questions
    Replies: 1
    Last Post: 14 Oct 2014, 02:34 PM
  2. v150 Quantity Discounts for shipping 1.5
    By jpmill in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 7 Apr 2013, 05:28 PM
  3. v150 Quantity Discounts for 1.5?
    By mobishelf in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 21 Feb 2012, 12:40 AM
  4. Hide quantity discounts for general customers, show for groups only?
    By swamyg1 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 16 Nov 2009, 09:22 PM
  5. Quantity Discounts for Sets?
    By mwlahn in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 30 Mar 2008, 07:39 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR