• Resolved ivanpp

    (@ivanpp)


    Hello, I installed your plugin and normally I translated “Lowest price in last 30 days”, however, the problem arises when I enter e.g. it shows a lower price on the product, on the Croatian version it shows the normal price, but on the English version it shows the regular price.

    • This topic was modified 5 months, 1 week ago by ivanpp.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Marin Matosevic

    (@marinmatosevic)

    Hi,

    Could you let me know how the product is translated? Is it just the text, or are there separate product versions for Croatian and English? If there are two versions, please check the recorded prices for each language. To do this, edit the product, go to the Product Price History tab, and verify how many recorded prices are listed and if they match.

    Also, could you confirm if you’re using the free version or the Pro version of the plugin?

    Thread Starter ivanpp

    (@ivanpp)

    I am currently using the free version to test the plugin’s functionality, what is included in the free version is enough for me to test it for now. I use the WPML plugin that automatically copies content and price changes from the main language Croatian to English.

    When I click edit from the option of the English version, I don’t have the right to change the price and I see that he withdrew the change, but the lowest one in the last 30 days is withdrawn the same. I am sending a link below to a specific product.

    Croatian language: https://clone.amarie-fashion.com/proizvod/izdvojeno/i-essence/e-haljine/mini-iskra-haljina-od-cokoladno-smede-eko-koze/

    English language: https://clone.amarie-fashion.com/en/product/featured/f-essence-part-one/e-dresses/mini-iskra-dress-in-chocolate-brown-eco-leather-sophisticated-design-with-a-bold-touch/

    Try changing the languages ​​and you will notice the price difference.

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    I have reproduced the issue and can confirm that WPML does not copy price history data. Instead, it only syncs the current prices, which causes our Lowest Price to display based on the available info—the regular price.

    We will work on improving compatibility with WPML in future updates. In the meantime, I’ve created a PHP snippet that will “sync” the price history for translated products.

    You can add the following code to your child theme’s functions.php file or use a plugin like Code Snippets to apply it safely. Avoid adding it directly to your parent theme’s functions.php, as updates will overwrite it.

    add_filter('pph_lowest_price', function ($lowest_price, $product_id, $product) {

    // Check if WPML functions exist before calling them
    if (!function_exists('wpml_get_default_language')) {
    return $lowest_price;
    }

    $default_language = wpml_get_default_language();
    if (!$default_language) {
    return $lowest_price;
    }

    $original_product_id = apply_filters('wpml_object_id', $product_id, 'product', true, $default_language);

    if (
    $original_product_id &&
    $original_product_id != $product_id &&
    class_exists('\Devnet\PPH\Modules\LowestPrice\Helper') &&
    method_exists('\Devnet\PPH\Modules\LowestPrice\Helper', 'get_lowest_price')
    ) {
    // Fetch original product
    $original_product = wc_get_product($original_product_id);
    // Get the lowest price from the master product
    $lowest_price = \Devnet\PPH\Modules\LowestPrice\Helper::get_lowest_price($original_product_id, $original_product);
    }

    return $lowest_price;
    }, 10, 3);

    Let me know if you need any help applying it!

    Thread Starter ivanpp

    (@ivanpp)

    Hello Marin,

    I updated the code you sent me and now everything is working normally. I just wanted to ask about this option: Delete price history older than, can it be activated so that it automatically deletes the prices after 30 days, or do I have to do it manually when I select the previous 30 days to delete the prices for me?

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    Glad to hear everything is working now!

    Regarding the Delete price history older than option: currently, it is a manual action, meaning you need to select the timeframe (e.g., previous 30 days) and confirm the deletion. There is no automatic deletion feature at the moment.

    In most cases, deleting price history is not recommended, as it helps maintain accurate pricing records for compliance and transparency. However, it can be useful in two scenarios:

    1. After development and testing—when you’re preparing a new site to go live.
    2. On sites with frequent price changes—if older data becomes irrelevant due to frequent daily updates.
    Thread Starter ivanpp

    (@ivanpp)

    The site has new discounts every month, so 2-3 months can pass after a discount and a new one would be added, that’s why it is important for me to delete them.

    At the moment of erasing the price history, does the regular price take the place of the lowest price, while the promotional price remains the same?

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    You can delete the price history records, or alternatively, you can hide them individually inside the Price History table on the edit product page.

    The regular price will only be displayed as the lowest price if the option is enabled and there are no price history records at all. However, keep in mind that this is not in line with EU regulations. According to the law, the lowest price should be the lowest recorded price in the 30 days before the sale started.

    Thread Starter ivanpp

    (@ivanpp)

    It means I can have a type of product that has an initial price, for example. 200 eur, his promotional price is 150, and the lowest before the promotional price was e.g. 140 euros and it can cost more than 30 days, right? Because I have some products that have been sitting like that for a couple of months, I don’t know if this is the right way, because before this plugin, another plugin was used that didn’t turn out to be very good and made a mess on the page.

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    To clarify, under the EU Consumer Protection Act, the lowest price must be the lowest recorded price in the 30 days before a sale begins. This is meant to prevent misleading discounting practices.

    For example:

    • A product is regularly priced at €200.
    • On January 1st, you offer a discount to €150.
    • In the 30 days before that (December 1-31), there might have been multiple price changes or none at all. What matters is the lowest price at which the product was actually sold during that period. So if the lowest recorded selling price was €140, then €140 must be displayed as the lowest price during the sale.
    • If the product remains at €150 for more than 30 days (e.g., until March), then for any future discounts, the new lowest price will be €150 if there was no lower price in the preceding 30 days.
    Thread Starter ivanpp

    (@ivanpp)


    Everything is clear, I understood. Thank you very much for all the answers and information.

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    Great! I’m glad that I was able to help you. 🙂 If you find the plugin handy and feel like sharing your thoughts, leaving a review would be awesome. Your input is truly appreciated!

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.