armed-smoking
 
Exclusive eBooks, Software Solutions, Quality Guaranteed
 
Web NukeBiz
Welcome to NukeBiz · Members
Bugger
 
of 6

 #19 » Orders not reporting correct quantity
 Date Open: Jan 22, 2008 at 00:55:35    Last Update: Mar 03, 2008 at 08:07:40 Bugger Off: Mar 03, 2008 at 08:07:40 
 Description: In testing my store operation, the orders reported to the database are wrong. If I ordered 2 of something that's .50, then the price and shipping set is currently adding correctly and everything in the order build side, but once confirmed, and e-mail sent, the e-mail says:

Order Number: 4
Order Date: 01/21/2008

Products Ordered
------------------------------------------------------
0 x [DSP-TAM1] Minicomics The Adventures of Marky #1 = $0.00

------------------------------------------------------
Product Total: $1.00
Shipping/Handling Charge: $0.20
Tax: $0.00

Total: $1.20

Billing Address || Payment Method: PayPal/Credit Card/eCheck
-------------------------------------

it's not passing on the correct quantity.

Then, if you click the link back to view the order, it says

Product Qty. Unit Cost Total
Minicomics: The Adventures of Marky #1 0 $2.00 $0.00
Product Total: $1.00
Shipping/Handling Charge: $0.20
Tax: $0.00

Total: $1.20
------------------------------------
so, the unit cost is being reported there as $2.00. It still has the correct order cost...but the rest is just off.

Let me know on that, I'm going to look for file corruptions, as I've had that problem with my uploads lately.
 Request: Bug
 Application: Module
 Module: storez
 Solution: Cannot reproduce the issue, and I have tried numerous permutations.

Fix provided by RickC - improperly constructed mysql query for data insert.
 Bugger From: AIPman1
 Debugger: Phoenix
 Group Access: All Visitors
 DiscussIt Forum: Storez
 DiscussIt Topic: Orders not reporting correct quantity
 Status: Done
 Priority: High
 Topic Replies:
 Phoenix
 Jan 29, 2008
 06:07:31
I need to know what the link is when this happens.
 AIPman1
 Jan 29, 2008
 13:34:51
You'd start an order at this site:

http://www.dimestoredistro.com/

there's only one product in the store so far to test, so if you add it to the cart, and view the cart, it's correct at that stage:

http://www.dimestoredistro.com/Storez/cart/op=showCart.html

Clicking Checkout, it is still correct:

http://www.dimestoredistro.com/Storez/checkout/op=Checkout_Shipping.html

it stays correct through the adding of shipping and payment addresses, and is correct at the checkout confirm stage:

http://www.dimestoredistro.com/Storez/checkout/op=Checkout_Confirmation.html

but when you click confirm order, the page that then displays....

http://www.dimestoredistro.com/Storez/checkout/op=Checkout_Order.html

has the quantity at 0 and the unit cost wrong, although the amount to pay and the shipping amount are both correct for the order.

It DOES take one copy out of the inventory record for the item.

If you click the link that is sent in the e-mail for the order:

http://www.dimestoredistro.com/Storez/orders/op=viewReceipt/orderID=7/code=e561a361bf0882c9f34fbdd19e1613df.html

it shows the zero quantity and wrong price, but the right total and shipping as well.

If you need to get into my system, ether as a superuser on the site, or into the server itself, I can do that, it's on a dedicated set up, I have full access.

I thank you for helping with this problem. As do the hundreds of publishers in my association, who LOVE the new site...
 Phoenix
 Jan 29, 2008
 13:51:00
It may not make any difference, but you don't appear to have the latest version of Storez?
 AIPman1
 Jan 29, 2008
 14:14:17
I thought I did, the folder i dowloaded was 9.1.2 - but I can re-download and replace the files if you think I should...
 AIPman1
 Jan 29, 2008
 14:57:26
I downloaded a fresh copy, and uploaded the files over the ones I had up. I'm still getting the same problem...

I'm going to turn off all blocks and other things on the site, make sure something else isn't interfering with the store....
 AIPman1
 Jan 29, 2008
 15:03:35
well, did that too, and even tried changing the theme to a default one just in case.

It still does it....
 Phoenix
 Jan 29, 2008
 15:17:53
hmm, I can see it happening on your site, but damned if I can reproduce it.

Mine works flawlessly every time Confused

Only thing that is different in your case is the multiple payment option which you seem to have edited.
 AIPman1
 Jan 29, 2008
 15:33:51
All I did there was add words to the cart display name, and the cart display info for each option I activated. I can try to turn them off and remove the words, but shouldn't we be able to add such safely? it's stored in the database... report in a minute....
 AIPman1
 Jan 29, 2008
 15:41:30
well, I turned off other options for checkout, and took the extra wording off the Paypal option, and - it still does it.

I actually think I'll leave it that way regardless, one less page in the checkout, and I can add wording on the checkout confirmation that if they do not want to pay with PayPal they can mail in the $$...

If I can get over this reporting hump, lol. It's gotta be something simple I'd think.
 Phoenix
 Jan 29, 2008
 15:41:43
no need to if that was all that was done.
 AIPman1
 Jan 29, 2008
 15:45:20
could there be a writing permission I've missed? Does having the site database shared with other sites that are using the same membership base make a difference?
 Phoenix
 Jan 29, 2008
 16:01:29
I wouldn't have thought so - I cannot reproduce it, despite testing numerous permutations, so I'll just have to leave it on hold until it can be reproduced by someone else.
 AIPman1
 Jan 29, 2008
 16:08:27
would going into the back end of my site help? is there anything I can look at to help? I'd really like to use and figure out this system as our store...
 AIPman1
 Jan 29, 2008
 16:10:30
could it be the mysql version I have?
 AIPman1
 Jan 30, 2008
 15:18:38
I'm going to post my php settings and hope that maybe you can spot something in there that my settings are not good.

I re-did the entire site, reinstalled Dragonfly, configured it to minimum stuff, all default. Only thing installed is Storez, which is configured to the best of my knowledge correctly. The fresh installs still do the same thing on the one product added.

--------------------------------------
PHP Core

Directive Local Value Master Value
allow_call_time_pass_reference Off Off
allow_url_fopen On On
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On Off
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 2047 2047
expose_php On On
extension_dir /usr/lib/php/modules /usr/lib/php/modules
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:.: .:.:
log_errors Off On
log_errors_max_len 1024 1024
magic_quotes_gpc Off Off
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value no value
max_execution_time 60 60
max_input_time 60 60
memory_limit 32M 32M
open_basedir /var/www/vhosts/dimestoredistro.com/httpdocs:/tmp no value
output_buffering 4096 4096
output_handler no value no value
post_max_size 8M 8M
precision 14 14
register_argc_argv On On
register_globals Off Off
register_long_arrays Off Off
report_memleaks On On
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from Ian@dimestoreproductions.com no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 3M 3M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.ze1_compatibility_mode Off Off
------------------------------------------------

I appreciate your taking time to look. I really think this has to be something simple, some setting not right somewhere. If there is ANY information I can give to help diagnose this, please let me know.
 AIPman1
 Feb 01, 2008
 19:56:59
I have tried installing Storez on another completely fresh domain name on the same server...and have the same problem.

I believe it is a server/software setting, and I would believe diagnosing this would help others who run into this problem in checkout, because it really is a killer, cant use the program if it's not reporting quantity and price in order records.

I hope to hear on the ideas I've expressed for solving this. I really love Dragonfly and every glitch or problem I've run into has been an easy fix of something that wasn't set right or that I did wrong. I believe this problem is no less simple, if we look at settings that work vs. mine.

If anyone reading this can take the time to help, as we all know Phoenix is a very busy person, let me know.
 RickC
 Feb 09, 2008
 02:05:42
Needs an Edit in the class.checkout.php file line #445

FROM: VALUES ('$orderID', '$usercartinfo[user_id]', '$usercartinfo[type]', '$iid', '$sid', '".Fix_Quotes($prodCode)."', '".Fix_Quotes($prodName)."', '".Fix_Quotes($prodBrand)."', '".Fix_Quotes($prodModel)."', '$prodInstant', '$itemCost', '$qty', '$qtyremain', '0')");

TO: VALUES ('$orderID', '$usercartinfo[user_id]', '$usercartinfo[type]', '$iid', '$sid', '".Fix_Quotes($prodCode)."', '".Fix_Quotes($prodName)."', '".Fix_Quotes($prodBrand)."', '".Fix_Quotes($prodModel)."', '$prodInstant', '0', '$itemCost', '$qty', '$qtyremain')");

That fixed it for me also working with Sandbox
 AIPman1
 Feb 09, 2008
 02:52:34
I will try that!!!!!!! Thank you!!!!!!!
 Phoenix
 Feb 09, 2008
 05:38:57
Thanks RickC - I can now see how that occurred when I added the instant download code Embarassed

The real issue is that I have missed upgrading a query to a more correct format - inserts should really be in the form

INSERT INTO $table (column1, column2, column3, etc)
VALUES ($value1, $value2, $value3, etc)

I'll fix that one and many others I haven't done yet so it can't happen again.
Code::
			$db->sql_query("INSERT INTO ".$prefix."_cart_orders_cartitems 
			(orderID, userID, userType, itemID, prodID, prodCode, prodName, prodBrand, prodModel, prodInstant, prodDLcount, itemCost, qty, qtyRemain) 
			VALUES ('$orderID', '$usercartinfo[user_id]', '$usercartinfo[type]', '$iid', '$sid', '".Fix_Quotes($prodCode)."', '".Fix_Quotes($prodName)."', '".Fix_Quotes($prodBrand)."', '".Fix_Quotes($prodModel)."', '$prodInstant', '0', '$itemCost', '$qty', '$qtyremain')");
145 buggers listed, 107 buggered off, 29 declined, 8 on hold.