Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: America/Bahia (GMT-03:00)

This topic contains 3 replies, has 2 voices.

Last updated by Marcos Vinicios Barreto 2 years, 4 months ago.

Assisted by: Marcos Vinicios Barreto.

Author Posts
November 22, 2021 at 5:11 am #10040803

Dao Chau

I am trying to set the schedule sales with date from and to for custom prices for multi currencies.

I expected to see sale prices as the schedule dates reached.

Instead, I got only the sale price for main currency, there is no sale prices display for secondary currencies setup.

More information about steps to re-produce the issue:

- Setup multi-currencies in Woocommerce Multilingual as usual.
- In a product, set schedule sale date (schedule from date need to be set in the future) and set the custom price for secondary currency, choose Same as default currency for Schedule option.
- Wait for the schedule from date reached, Woocommerce will remove the From Date setting automatically in function `wc_scheduled_sales`.
- Sale price for secondary currency won't display as expected.

As I found in "wp-content/plugins/woocommerce-multilingual/inc/currencies/class-wcml-custom-prices.php", function is_on_sale_date_range is missing the code to check schedule sale date without the from or the to date set, so the custom sale price won't display. Could you check if it's the issue from Woocommerce Multilingual?

private function is_on_sale_date_range($product_meta, $currency){
		
		if(
			isset($product_meta['_sale_price_dates_from_' . $currency]) &&
			isset($product_meta['_sale_price_dates_to_' . $currency]) &&
			$product_meta['_sale_price_dates_from_' . $currency][0] &&
			$product_meta['_sale_price_dates_to_' . $currency][0]
		){
			
			if(
				current_time('timestamp') > $product_meta['_sale_price_dates_from_' . $currency][0] &&
				current_time('timestamp') < $product_meta['_sale_price_dates_to_' . $currency][0]
			){
				return true;
			}
		}elseif(
			isset($product_meta['_sale_price_dates_from']) &&
			isset($product_meta['_sale_price_dates_to']) &&
			current_time('timestamp') > $product_meta['_sale_price_dates_from'][0] &&
			current_time('timestamp') < $product_meta['_sale_price_dates_to'][0]
		){
			return true;
		}
		
		return false;
	}
Screenshot-1637557811.png
November 23, 2021 at 6:29 pm #10054765

Marcos Vinicios Barreto

Hello,

Thank you for contacting our support service. In order to involve our second level support and developers team in this discussion, we would appreciate if the issue replication could be made in a clean sandbox install, according these steps:

  • Install the theme/plugin in a clean installation and reproduce the problem in this new installation. So we can isolate it and do some testing without the interference of server settings or other plugins
  • After this, I will check the problem in this new installation and look for a quick solution
    If I can not find a solution, I will forward the problem to our second level/devevelopers team.

I created a test website with a clean WordPress install. You can access it through this link:
hidden link - Through this link you will be automatically logged in.

Please upload the (theme/plugin) to this test install, setup it the same way as in your website (using the same options) and create some dummy content to reproduce the issue. Please note that we only need the (theme/plugin) and the related functionality, you don't need to setup a entire website or clone your existing site. The fewer plugins the better.

After that, please send us clear steps on how to see/reproduce the issue on this test install. We will run some tests.

Please, let me know when you are ready, thank you for your collaboration, have a nice day.

November 24, 2021 at 2:36 am #10056377

Dao Chau

I installed storefront theme and created a test product. It's almost the fresh installation.

You can see the issue:
- When I choose USD, the sale price is displayed correctly.
- When I change currency into VND, the sale price doesn't displayed.

It only happens when I set the Schedule sale without the From date, when I updated Schedule sale with both From and To date, it works correctly.

Please check the issue, thanks.

Screenshot-1637721355.png
November 25, 2021 at 5:27 pm #10070183

Marcos Vinicios Barreto

Hello,

Thank you for the clear details regarding this issue. I confirmed it from the provided sanbox install and forwarded it to our second level support team for a more detailed investigation and a possible escalation to our developers. I will keep you posted as soon as I have some details regarding the investigation process.

Thank you for your continued patience and understanding, have a nice day.