wpovernight / woocommerce-pdf-invoices-packing-slips

Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.
https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/
Other
99 stars 46 forks source link

Translatable shop logo #754

Closed BrunoPavlinic98 closed 5 months ago

BrunoPavlinic98 commented 6 months ago

After this PR is closed, we also need to close https://github.com/wpovernight/woocommerce-pdf-ips-pro/pull/387 which will close the ticket https://github.com/wpovernight/woocommerce-pdf-ips-pro/issues/375

BrunoPavlinic98 commented 6 months ago

Maybe we could replace this with jquery-blockui?

@alexmigf I agree! I did not know about this block UI plugin, looks good!

alexmigf commented 6 months ago

I'm getting this error in the media_upload() function after saving logos for 2 languages with this branch and then get back to the main branch:

PHP Warning: Array to string conversion

BrunoPavlinic98 commented 6 months ago

I'm getting this error in the media_upload() function after saving logos for 2 languages with this branch and then get back to the main branch:

PHP Warning: Array to string conversion

@alexmigf Can you please share more detailed error reproduction steps? I have tried the following with no errors:

  1. Saved logos for all available languages on 375 branch.
  2. Switched to main branch.
  3. Reloaded the settings page - /wp-admin/admin.php?page=wpo_wcpdf_options_page
  4. Saved the settings again.
  5. Loaded some invoice.
alexmigf commented 6 months ago

I'm still getting the error, steps to reproduce:

  1. Free PDF plugin on this branch
  2. Pro on this branch: https://github.com/wpovernight/woocommerce-pdf-ips-pro/pull/387
  3. Enable WPML
  4. Upload 2 or more logos to different languages
  5. Disable WPML
  6. Switch free PDF branch to main
  7. Switch Pro extension to main

Error trace:

Screenshot from 2024-04-02 16-40-35

Note: you might need to add a version compatibility check in the Pro extension, because the changes you made in the media_upload() function aren't present in the older versions of the free plugin (current stable version and below).

BrunoPavlinic98 commented 6 months ago

I'm still getting the error, steps to reproduce:

  1. Free PDF plugin on this branch
  2. Pro on this branch: Translatable shop logo woocommerce-pdf-ips-pro#387
  3. Enable WPML
  4. Upload 2 or more logos to different languages
  5. Disable WPML
  6. Switch free PDF branch to main
  7. Switch Pro extension to main

Error trace:

Screenshot from 2024-04-02 16-40-35

Note: you might need to add a version compatibility check in the Pro extension, because the changes you made in the media_upload() function aren't present in the older versions of the free plugin (current stable version and below).

I have added a dependency check in the PRO plugin.

BrunoPavlinic98 commented 6 months ago

@alexmigf @MohamadNateqi I think I managed to solve the issues you had. Please let me know what you think.

BrunoPavlinic98 commented 5 months ago

Great work!

Thank you for the great review!