Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lowest historical price not calculated properly #10

Open
maciej-laskowski opened this issue Aug 2, 2023 · 1 comment
Open

Lowest historical price not calculated properly #10

maciej-laskowski opened this issue Aug 2, 2023 · 1 comment
Assignees

Comments

@maciej-laskowski
Copy link

Hi, small bug report extracted from one of my production stores and reproduced locally.

Steps to reproduce:

  1. Plugin version 2.3.9, plugin is set to display lowest price from last 30 days. Clock set to 02.08.2023 or later.

  2. Clear meatdata for test product (replace X with test product id)

SELECT * FROM wp_postmeta WHERE post_id = X AND meta_key LIKE '%iwo%'

  1. Import meatdata sample for test product (replace X with test product id)

INSERT INTO wp_postmeta (meta_id, post_id, meta_key, meta_value) VALUES
(4785319, X, '_iwo_price_lowest', 'a:3:{s:5:"price";s:4:"1936";s:9:"timestamp";i:1675908204;s:4:"type";s:9:"autosaved";}'),
(4827751, X, '_iwo_price_lowest', 'a:4:{s:5:"price";s:4:"2200";s:9:"timestamp";i:1678204781;s:13:"price_regular";s:4:"2200";s:10:"price_sale";s:0:"";}'),
(4827752, X, '_iwo_last_price_drop_timestamp', '1679567887'),
(4829297, X, '_iwo_price_lowest', 'a:2:{s:5:"price";s:4:"1936";s:9:"timestamp";i:1678324509;}'),
(4833070, X, '_iwo_price_lowest', 'a:4:{s:5:"price";s:4:"2200";s:9:"timestamp";i:1678377930;s:13:"price_regular";s:4:"2200";s:10:"price_sale";s:0:"";}'),
(4835450, X, '_iwo_price_lowest', 'a:2:{s:5:"price";s:4:"1936";s:9:"timestamp";i:1678496983;}'),
(4853549, X, '_iwo_price_lowest', 'a:4:{s:5:"price";s:4:"2200";s:9:"timestamp";i:1679567887;s:13:"price_regular";s:4:"2200";s:10:"price_sale";s:0:"";}');

Expected behaviour

Plugin calculates lowest price to 2200

Current behaviour:

Plugin calculates lowest price to 1936
Commenting out line
https://github.com/iworks/omnibus/blob/main/includes/iworks/omnibus/class-iworks-omnibus-integration.php#L243C4-L243C4 fixes the problem

@iworks iworks self-assigned this Nov 28, 2023
@iworks
Copy link
Owner

iworks commented Nov 28, 2023

@maciej-laskowski hi - is this issue still a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants