Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12041
Latest: pablosanz
New This Month: 7
New This Week: 2
New Today: 0
Stats
Total Posts: 38405
Total Topics: 6768
Most Online Today: 55
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 38
Total: 38

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

0 Members and 1 Guest are viewing this topic.

Offline KKOG

  • SMF Store Customer
  • Newbie
  • *****
  • Posts: 24
    • 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

  • SMF Store Customer
  • Newbie
  • *****
  • Posts: 24
    • 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: 14249
    • 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! Also contests/promotions for verified sites.

Offline KKOG

  • SMF Store Customer
  • Newbie
  • *****
  • Posts: 24
    • 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: 14249
    • 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! Also contests/promotions for verified sites.

Offline KKOG

  • SMF Store Customer
  • Newbie
  • *****
  • Posts: 24
    • 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
3798 Views
Last post November 29, 2006, 10:00:34 pm
by Hawk
12 Replies
10910 Views
Last post September 19, 2007, 09:38:23 pm
by SMFHacks
17 Replies
10854 Views
Last post February 15, 2012, 12:48:53 pm
by majorwood
3 Replies
2038 Views
Last post January 28, 2013, 03:12:40 pm
by SMFHacks
2 Replies
353 Views
Last post October 23, 2017, 04:59:47 pm
by SMFHacks

+- Recent Topics

upload 2 or more pictures at the same time by SMFHacks
December 12, 2017, 05:33:53 pm

gallery and switch to https for old or new images by SMFHacks
December 10, 2017, 08:08:42 pm

Bulk upload issue on Gallery Pro after upgrade to 7.2 by SMFHacks
December 10, 2017, 05:57:47 pm

Pretty URLs - SMF Gallery Lite by SMFHacks
December 09, 2017, 10:41:07 am

Adding a receipt number to Purchase Email by KKOG
December 08, 2017, 12:39:47 am

Tip: Image Proxy For SMF 1.1.x by SMFHacks
December 07, 2017, 10:43:41 am

[Mod]Recent Forum Topics Extended by monott001
December 07, 2017, 06:16:15 am

Random Image in TinyPortal Block Broken after SMF update by Boomslanger
December 04, 2017, 09:41:20 pm

Long time since upping my Gallery License by SMFHacks
December 04, 2017, 07:20:10 pm

SMF Classifieds by SMFHacks
December 04, 2017, 06:46:02 pm

Powered by EzPortal