VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Roderic on April 13, 2022, 22:32:31 PM

Title: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: Roderic on April 13, 2022, 22:32:31 PM
Good evening,

I've installed version 3.8.9.10622 on a J3.10 test site and after all seemed to work well, I also installed it on a live site.
There I noticed the following problem:

1. An order is placed and there is a proper value in created_on in xxx_virtuemart_orders.
2. Customer pays the order with for example PayPal (VM Paypal plugin)
3. After the successful payment the client returns to the site and the date in created_on is now 00:00:00

This does not happen with Pay.nl plugin and VM PayPal plugin. I've also tested this with "VM Payment - Standard" and there it works fine.

Edit:

In xxx_virtuemart_order_histories -> created_on looks fine. Except I see there that there are no messages from the payment plugin
Title: Re: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: GJC Web Design on April 14, 2022, 11:46:10 AM
Hi Roderic,

unless your using this for testing I wouldn't yet use this on a production site .. Max will release VM4 shortly and this should be production ready on J3, used with caution on J4

they are already up to 10631 with constant fixes .. think creation date has been fixed from memory
Title: Re: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: Roderic on April 14, 2022, 14:56:10 PM
Hi John,

I was still running 3.8.9 10473 and have checked and tested newer versions occasionally on test sites.  Since all seemed to work well, I decided to update in the hope it would fix some other issues. Also hoping the new admin template would be workable but it isn't yet.

One of the problems I'm having, is that the availability in sublayouts/snippets.php is not correct for products without child products and the Stock handle is set to "Do not Display Product, if children are also out of stock."

For example this product: https://www.woest-sport.nl/en/electronics/bike-computers/garmin-edge-830-detail

It says OutOfStock in the Rich Snippet although there is still 24 available. This product has no children.

A product with children however, works as expected:

https://www.woest-sport.nl/en/shoes/running/competition/hoka-mach-4-men-running-shoes-1-detail



I also send you an e-mail with a few questions about 3 weeks ago, unfortunately no reply.

Cheers
Title: Re: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: Roderic on April 15, 2022, 13:14:30 PM
The following revision fixed it:

http://dev.virtuemart.net/projects/virtuemart/repository/revisions/10628


So as far as I know, updating hasn't introduced any other issues.
Title: Re: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: Milbo on April 17, 2022, 20:19:42 PM
Quote from: Roderic on April 14, 2022, 14:56:10 PM
is that the availability in sublayouts/snippets.php is not correct for products without child products and the Stock handle is set to "Do not Display Product, if children are also out of stock."

For example this product: https://www.woest-sport.nl/en/electronics/bike-computers/garmin-edge-830-detail

It says OutOfStock in the Rich Snippet although there is still 24 available. This product has no children.

A product with children however, works as expected:

https://www.woest-sport.nl/en/shoes/running/competition/hoka-mach-4-men-running-shoes-1-detail

Do you have still this problem? I think you can just use the last vmtable file. should be compatible to the rest.
Title: Re: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: Roderic on April 19, 2022, 10:23:59 AM
Quote from: Milbo on April 17, 2022, 20:19:42 PM
Do you have still this problem? I think you can just use the last vmtable file. should be compatible to the rest.

This problem has been there all the time, not since updating. It is also not fixed by using the latest vmtables. However, I changed the snippets.php file in a few places.
Also, the code in the snippet only looks at product_in_stock and doesn't take product_ordered into account. Also changed that.

Here is what I came up with:

//GJC look for parent & for child stock
//$stockog = 'InStock';
$stockhandle = VmConfig::get ('stockhandle', 'none');
$finalstk = $product->product_in_stock - $product->product_ordered;
if ($stockhandle == 'none') {
$stockog = 'InStock';
} elseif ($stockhandle == 'disableit_children' and $product->product_parent_id == 0) {
$prodmodel = VmModel::getModel ('product');
$children = $prodmodel->getProductChilds($product->virtuemart_product_id);
$finalstk = $product->product_in_stock - $product->product_ordered;
foreach($children as $child){
$finalstk += $child->product_in_stock - $child->product_ordered;
}
} else {
$finalstk = $product->product_in_stock - $product->product_ordered;
}
if ($finalstk != 0) {
$stockog = 'InStock';
}
if ($finalstk == 0) {
$stockog = 'OutOfStock';
}
Title: Re: Order creation date is set to 00:00:00 after succesfull order (3.8.9.10622)
Post by: pinochico on April 19, 2022, 13:51:40 PM
Perfect, thanks

I add to our plugin for rich snippets for VM and Phoca cart too.