Get the book

Go Back   Zen Cart Support > Code Matters > Bug Reports

Bug Reports If you have a bug to report, post it here. Please clearly explain what version you are using, and the exact error message. Please ALSO explain why you believe it's a bug, and post a solution if you have one.

Reply
 
Thread Tools Display Modes
Old 3rd March 2010, 09:00 PM   #1
swguy
Totally Zenned
 
swguy's Avatar
 
Join Date: Feb 2006
Location: Tampa Bay, Florida
Posts: 3,159
Default [Done v1.3.9a] Addition to last Linkpoint Patch

The Linkpoint patch provided here:

http://www.zen-cart.com/forum/showpo...0&postcount=22

was still not working for a client of mine when a gift certificate was used. The error message was, "subtotal does not match the amount being charged."

The associated LinkPoint error number is SGS-002301.

Fix and additional notes provided below.
__________________
Scott C Wilson That Software Guy - The Duke of Discounting.
Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.
Please note that the forum is free, but PMs and emails are treated as quote requests.

Last edited by swguy; 3rd March 2010 at 11:08 PM. Reason: more details
swguy is offline   Reply With Quote
Old 3rd March 2010, 10:27 PM   #2
swguy
Totally Zenned
 
swguy's Avatar
 
Join Date: Feb 2006
Location: Tampa Bay, Florida
Posts: 3,159
Default Re: Addition to last Linkpoint Patch

The situation is caused by the use of a GV, but the issue is that because of the gv, the shipping is greater than the total, so even excluding the subtotal doesn't fix the problem. I will post a patch asap.
__________________
Scott C Wilson That Software Guy - The Duke of Discounting.
Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.
Please note that the forum is free, but PMs and emails are treated as quote requests.

Last edited by swguy; 3rd March 2010 at 11:07 PM.
swguy is offline   Reply With Quote
Old 3rd March 2010, 11:01 PM   #3
swguy
Totally Zenned
 
swguy's Avatar
 
Join Date: Feb 2006
Location: Tampa Bay, Florida
Posts: 3,159
Default Re: Addition to last Linkpoint Patch

It's a small extension to the new logic to hide the subtotal when there are discounts.

Code:
    // if discounts apply, do not send subtotal, otherwise validation error occurs
    if ($credits_applied_so_skip_subtotal) {
      // Look for an anomaly in the total
      $tot = 0;  
      if (isset($myorder["shipping"])) $tot += (float)$myorder["shipping"];
      if (isset($myorder["tax"])) $tot += (float)$myorder["tax"];
      if (isset($myorder["subtotal"])) $tot += (float)$myorder["subtotal"];
      if ($tot > (float)$myorder["chargetotal"]) { 
          unset($myorder["shipping"]);
          unset($myorder["tax"]);
      }   
      unset($myorder["subtotal"]);
    }
__________________
Scott C Wilson That Software Guy - The Duke of Discounting.
Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.
Please note that the forum is free, but PMs and emails are treated as quote requests.
swguy is offline   Reply With Quote
Old 4th March 2010, 09:27 AM   #4
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 44,246
Default Re: Addition to last Linkpoint Patch

Are you suggesting to add that whole block of code? or to modify an existing block somewhere?
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!
DrByte is offline   Reply With Quote
Old 4th March 2010, 11:16 AM   #5
swguy
Totally Zenned
 
swguy's Avatar
 
Join Date: Feb 2006
Location: Tampa Bay, Florida
Posts: 3,159
Default Re: Addition to last Linkpoint Patch

Yes - add this block to includes/modules/payment/linkpoint_api.php in place of the existing l. 393-395. Lline numbers from the patch file in
http://www.zen-cart.com/forum/showth...490#post563490

Code:
    if ($credits_applied_so_skip_subtotal) {
      unset($myorder["subtotal"]);
    }
__________________
Scott C Wilson That Software Guy - The Duke of Discounting.
Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.
Please note that the forum is free, but PMs and emails are treated as quote requests.
swguy is offline   Reply With Quote
Old 4th March 2010, 11:18 AM   #6
swguy
Totally Zenned
 
swguy's Avatar
 
Join Date: Feb 2006
Location: Tampa Bay, Florida
Posts: 3,159
Default Re: Addition to last Linkpoint Patch

To duplicate this problem, use enough GV to cover your products so the shipping cost is greater than the total. This will trigger it.
__________________
Scott C Wilson That Software Guy - The Duke of Discounting.
Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.
Please note that the forum is free, but PMs and emails are treated as quote requests.
swguy is offline   Reply With Quote
Old 5th March 2010, 01:20 AM   #7
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 44,246
Default Re: Addition to last Linkpoint Patch

k - that should work fine for 138.

v1.3.9 and newer will be using a different method of preparing subtotal data, which avoids the need to re-do the math as you've done.
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!
DrByte is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get of New PATCH Available: v1.3.8a - patch: [1] :: Important Security Patch hcd888 General Questions 15 2nd October 2009 11:45 AM
Linkpoint vs Coupon in total. Linkpoint denies darkswan Built-in Shipping and Payment Modules 1 4th August 2009 07:03 PM
1064 Error after Update Patch and Db patch to latest... colin99 Upgrading from 1.2 to 1.3.x 2 31st August 2006 04:43 PM


All times are GMT +1. The time now is 09:16 AM.

Learn tips, tricks & secrets for your Zen Cart™
Sign up for our FREE Newsletter

Powered by vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content and Graphics Copyright (c) 2006, 2007, 2008, 2009, 2010 Zen Ventures, LLC - all rights reserved
Get Zen Cart E-Commerce Shopping Cart at SourceForge.net. Fast, secure and Free Open Source software downloads