Skip to content

Troubleshooting

  1. Go to WPify → WPify Woo
  2. Verify that the Prices log module is enabled
  3. Save changes

The module only records price changes. If the price is the same as the last recorded entry, a new entry will not be created.

Check:

// Last entry has the same price as the current one
$last = $repository->get_last_by_product_id( $product_id );
if (
$last->regular_price === $product->get_regular_price()
&& $last->sale_price === $product->get_sale_price()
) {
// New entry will not be created
}

History is recorded when the product is saved. If you change the price directly in the database or via API without triggering woocommerce_update_product, the entry will not be created.

The module starts recording prices only after activation. Data from before activation does not exist.

Solution:

  • For existing products, edit and save the price to create the first entry
  • Or wait for a natural price change

If the product has no historical records from the last 30 days, the current price of the product will be displayed.

$price = $repository->find_lowest_price( $id ) ?: 0;
if ( ! $price ) {
// Fallback to current price
$price = wc_get_product( $id )->get_price();
}

A new product does not have any entries yet. Entries will be created after the first price change.

For variable products, entries are saved for each variation separately. The tab displays tables for each variation.

When the module is activated, a database table is automatically created. If the table is missing:

  1. Deactivate the module
  2. Reactivate the module
  3. Check whether WordPress has permissions to create the table

Check the WordPress error log:

wp-content/debug.log
// In the product admin or debug plugin
$repository = wpify_woo_container()->get(
\WpifyWoo\Modules\PricesLog\PricesLogRepository::class
);
$logs = $repository->find_by_product_id( $product_id );
echo '<pre>';
print_r( $logs );
echo '</pre>';
$prices_log = wpify_woo_container()->get(
\WpifyWoo\Modules\PricesLog\PricesLogModule::class
);
$lowest = $prices_log->get_lowest_price( $product_id );
echo 'Lowest price: ' . wc_price( $lowest );

For products with frequent price changes, the table may grow. The module does not include automatic cleanup of old entries.

Manual cleanup (optional):

-- Delete entries older than 90 days
DELETE FROM wp_wpify_woo_prices_log
WHERE created_at < DATE_SUB(NOW(), INTERVAL 90 DAY);