openprovider / Openprovider-WHMCS-domains

Openprovider WHMCS Domain Module
43 stars 31 forks source link

[BUG] Wrong prices when sync with WHMCS #267

Closed Remarkable-Guille closed 1 year ago

Remarkable-Guille commented 1 year ago

Describe the bug Wrong price when syncing prices with the WHMCS native method

To Reproduce Steps to reproduce the behavior:

  1. Go to "Domain Pricing."
  2. Click on "Click here to Sync Now."
  3. Select OpenProvider
  4. Set "Margin Type to Percentage or Fixed Amount."
  5. Set "Profit Margin to 0"
  6. Set Round to Next to "No Rounding"
  7. Select a tld. example ".com"
  8. Click on "Import x TLD"
  9. Check .com prices again

Expected behavior .com price should be $9.15, not $8.57

Server info:

Additional context

sapillai commented 1 year ago

@Remarkable-Guille

It appears that you are seeing cached prices. The module fetches TLD prices using the DownloadTldPrices.php script. In order to get latest prices, you will need to run the DownloadTldPrices.php script.

image

If you want to regularly cache the price changes, you will need to configure a cron job to run the DownloadTldPrices.php script. I would suggest scheduling the cron to run at off-peak hours since it is a memory intensive task.

Please refer to https://github.com/openprovider/Openprovider-WHMCS-domains/blob/master/docs/TLD_Pricing_sync_Utility.md for instructions.