VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: sohopros on July 31, 2023, 19:48:06 PM

Title: VM Checkout Error
Post by: sohopros on July 31, 2023, 19:48:06 PM
VirtueMart: 4.0.22 10864
PHP: 8.0 (ea-php80)
Joomla: 4.3.3

When submitting an order for payment, the customer sees this error and cannot proceed:
Error:
vmTable store insertObject
Couldn't create order

We also see this entry in the VM error logs:

2023-07-25 08:06:41 ERROR vmError: vmTable store insertObject #__virtuemart_orders Data too long for column 'order_billTax' at row 1 INSERT INTO `jos_virtuemart_orders`
(`virtuemart_order_id`,`virtuemart_user_id`,`virtuemart_vendor_id`,`order_note`,`order_number`,`order_pass`,`order_create_invoice_pass`,`invoice_locked`,`customer_number`,`order_total`,`order_salesPrice`,`order_billTaxAmount`,`order_billTax`,`order_billDiscountAmount`,`order_discountAmount`,`order_subtotal`,`order_tax`,`order_shipment`,`order_shipment_tax`,`order_payment`,`order_payment_tax`,`coupon_discount`,`order_discount`,`order_currency`,`order_status`,`user_currency_id`,`user_currency_rate`,`user_shoppergroups`,`payment_currency_id`,`payment_currency_rate`,`virtuemart_paymentmethod_id`,`virtuemart_shipmentmethod_id`,`ip_address`,`order_language`,`STsameAsBT`,`paid`,`o_hash`,`locked_by`,`created_on`,`created_by`) VALUES
('0','4848','1','','UBB503474','p_QMQrdnTj','90CK7Jui','0','BOd9b09f3','168.56964839','152.9924','34.68964839','{
    \"1\": {
        \"virtuemart_calc_id\": 1,
        \"calc_name\": \"VAT - Spain\",
        \"calc_value\": \"21.0000\",
        \"result\": 28.1148
    },
    \"4\": {
        \"virtuemart_calc_id\": 4,
        \"calc_name\": \"Product tax 5.2%\",
        \"calc_value\": 4.2975,
        \"result\": 6.57484839
    },
    \"5\": {
        \"virtuemart_calc_id\": 5,
        \"calc_name\": \"Shipping Tax 5.2%\",
        \"calc_value\": 0.0,
        \"result\": 0.0
    }
}','0','0','126.44','26.5524','7.44','1.5624','0','0','0','0','47','P','47','1','2,11','47','1','1','417','2.136.55.xx','es-ES','1','0','75185a17f1339b05371877010ccc063c','0','2023-07-25 08:06:41','4848')<pre>#0  vmError() called at [/home/[dom]/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1338]
#1  VmTable->store() called at [/home/[dom]/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:2031]
#2  VmTable->bindChecknStoreNoLang() called at [/home/[dom]/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1966]
#3  VmTable->bindChecknStore() called at [/home/[dom]/public_html/administrator/components/com_virtuemart/models/orders.php:1812]
#4  VirtueMartModelOrders->_createOrder() called at [/home/[dom]/public_html/administrator/components/com_virtuemart/models/orders.php:1644]
#5  VirtueMartModelOrders->createOrderFromCart() called at [/home/[dom]/public_html/components/com_virtuemart/helpers/cart.php:1887]
#6  VirtueMartCart->confirmedOrder() called at [/home/[dom]/public_html/components/com_virtuemart/helpers/cart.php:1597]
</pre>
=============================================
So far, it looks like changing the order_billTax field in the jos_virtuemart_orders table from varchar(400) to varchar(1000) has fixed it. Our main concern is that a later software update will over-write the change, or that this change will cause other problems.
Help? Any advice??
Title: Re: VM Checkout Error
Post by: GJC Web Design on August 02, 2023, 11:56:15 AM
It won't cause any problems

I think the hidden config switch to NOT change the DB layout on upgrades is dblayoutstrict

perhaps someone else can confirm

https://www.jooglies.com/en/tutorials/virtuemart/60-virtuemart-the-hidden-configuration
Title: Re: VM Checkout Error
Post by: sohopros on August 03, 2023, 19:57:58 PM
"It won't cause any problems ..." - thanks! Should this reported to the dev group, so a permanent change can be incorporated in a future release? (Not sure how to do that.)
Title: Re: VM Checkout Error
Post by: Milbo on August 14, 2023, 09:57:17 AM
I just worked on the same topic for a german member, so I just take your 1000 chars for 3 taxrates.