Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 167
Total: 167

Author Topic: Transaction ID on Packing Slip Incorrect  (Read 3424 times)

0 Members and 1 Guest are viewing this topic.

Offline KKOG

  • Community Suite Customer
  • Member
  • ******
  • Posts: 47
    • View Profile
Transaction ID on Packing Slip Incorrect
« on: November 30, 2017, 11:01:53 pm »
Hi,

We currently have a problem that the transaction id on the packing slip is different to the actual transaction id.

All the other information on the packing slip is correct.

This difference may have been caused by activities undertaken during the initial setup and testing.

How is the transaction id sourced for the packing slip?  There appears to be a database query at line 9900 of store2.php.  Is this the query, if so how is the transaction id being returned incorrectly?

Thanking you in anticipation of your help

Greg Ralph
KKOG Forum Admin

Offline KKOG

  • Community Suite Customer
  • Member
  • ******
  • Posts: 47
    • View Profile
Re: Transaction ID on Packing Slip Incorrect
« Reply #1 on: December 01, 2017, 12:34:16 am »
I see the transaction id is printed at the following

9870      echo $txt['store_trans_txn_id'] . ': ' . $transRow['id_trans'];

with id_trans defined in a query at line 9806.

The rest of the detail in the packing slip is defined using a query based on the store_basketid in line 9883

Somehow there seems to be a mismatch in the data retrieved

Regards
Greg Ralph
KKOG Forum Admin

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Transaction ID on Packing Slip Incorrect
« Reply #2 on: December 01, 2017, 10:29:32 pm »
Made change for next update hotfix/change

Open Sources/Store2.php
Line 9803
Find
Code: [Select]
$context['store_basketid'] = $id;

$dbresult = $smcFunc['db_query']('', "
SELECT 
is_subscription, is_custompaypal, custom, cart_items,
totalprice, totalshipping, totaltax, currency, date, id_trans,
weight_unit, weight_total, notes, is_shipped, completed
FROM {db_prefix}store_basket   
WHERE ID_BASKET = " . $context['store_basketid'] . " LIMIT 1" );
$basketRow = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);

$dbresult = $smcFunc['db_query']('', "
SELECT id_trans, txn_id
FROM ({db_prefix}store_transactions)
WHERE ID_BASKET = " . $context['store_basketid']. " LIMIT 1");
$transRow = $smcFunc['db_fetch_assoc']($dbresult);

Change to
Code: [Select]
$context['store_basketid'] = $id;

$dbresult = $smcFunc['db_query']('', "
SELECT 
is_subscription, is_custompaypal, custom, cart_items,
totalprice, totalshipping, totaltax, currency, date, id_trans,
weight_unit, weight_total, notes, is_shipped, completed
FROM {db_prefix}store_basket   
WHERE ID_BASKET = " . $context['store_basketid'] . " LIMIT 1" );
$basketRow = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);

$dbresult = $smcFunc['db_query']('', "
SELECT id_trans, txn_id
FROM ({db_prefix}store_transactions)
WHERE ID_BASKET = " . $context['store_basketid']. " LIMIT 1");
$transRow = $smcFunc['db_fetch_assoc']($dbresult);

if (!empty($transRow['txn_id']))
$transRow['id_trans'] = $transRow['txn_id'];

Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline KKOG

  • Community Suite Customer
  • Member
  • ******
  • Posts: 47
    • View Profile
Re: Transaction ID on Packing Slip Incorrect
« Reply #3 on: December 02, 2017, 12:29:31 am »
Hi,

I made the code change but the Transaction ID on the packing slip was not correct.

Attached is an image of the transaction showing the transaction id, an image of the packing slip transaction id prior to the code change and an image of the packing slip transaction id after the code change

Cheers
Greg Ralph
KKOG Forum Admin

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Transaction ID on Packing Slip Incorrect
« Reply #4 on: December 02, 2017, 01:52:17 pm »
You want to show the order number from the basket id?
If so then use the following instead
Code: [Select]
$context['store_basketid'] = $id;

$dbresult = $smcFunc['db_query']('', "
SELECT 
is_subscription, is_custompaypal, custom, cart_items,
totalprice, totalshipping, totaltax, currency, date, id_trans,
weight_unit, weight_total, notes, is_shipped, completed
FROM {db_prefix}store_basket   
WHERE ID_BASKET = " . $context['store_basketid'] . " LIMIT 1" );
$basketRow = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);

$dbresult = $smcFunc['db_query']('', "
SELECT id_trans, txn_id
FROM ({db_prefix}store_transactions)
WHERE ID_BASKET = " . $context['store_basketid']. " LIMIT 1");
$transRow = $smcFunc['db_fetch_assoc']($dbresult);


$transRow['id_trans'] = $id;
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline KKOG

  • Community Suite Customer
  • Member
  • ******
  • Posts: 47
    • View Profile
Re: Transaction ID on Packing Slip Incorrect
« Reply #5 on: December 02, 2017, 06:28:54 pm »
Thank you, the latest code achieves what I was seeking.  Sorry for not explaining more clearly what I was trying to achieve. 

I have also changed the text in Store.English.php to read Order Number on the packing slip as the Order Number is referenced in the personal message sent to the customer when the product is shipped.  The changes were made because both the customer and the store administrator were looking to the Order Number as the reference for the transaction.

Thank you again for your help

Greg Ralph
KKOG Forum Admin

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
5360 Views
Last post November 29, 2006, 10:00:34 pm
by Hawk
12 Replies
13919 Views
Last post September 19, 2007, 09:38:23 pm
by SMFHacks
17 Replies
16223 Views
Last post February 15, 2012, 12:48:53 pm
by majorwood
3 Replies
4088 Views
Last post January 28, 2013, 03:12:40 pm
by SMFHacks
2 Replies
3287 Views
Last post October 23, 2017, 04:59:47 pm
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal