Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 186
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 186
Total: 186

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

0 Members and 1 Guest are viewing this topic.

Offline KKOG

  • 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

  • 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: 16452
    • 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

  • 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: 16452
    • 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

  • 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
5394 Views
Last post November 29, 2006, 10:00:34 pm
by Hawk
12 Replies
13953 Views
Last post September 19, 2007, 09:38:23 pm
by SMFHacks
17 Replies
16295 Views
Last post February 15, 2012, 12:48:53 pm
by majorwood
3 Replies
4112 Views
Last post January 28, 2013, 03:12:40 pm
by SMFHacks
2 Replies
3303 Views
Last post October 23, 2017, 04:59:47 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal