• Resolved durrmann

    (@durrmann)


    Dear team,

    i really appreciate this plugin a lot. However i noticed an issue when setting up the plugin via WP-CLI.

    I install the plugin using with the following command:
    wp plugin install woocommerce-pdf-invoices-packing-slips --activate

    To configure it, i use the wp options command:

    wp option update wpo_wcpdf_documents_settings_packing-slip '{"enabled":1}' --format=json
    wp option update wpo_wcpdf_documents_settings_invoice '{"enabled":"1","attach_to_email_ids":{"customer_processing_order":"1"},"display_shipping_address":"when_different","display_customer_notes":"1","display_date":"order_date","display_number":"invoice_number","number_format":{"prefix":"[invoice_year]-[invoice_month]-","suffix":"","padding":"6"},"reset_number_yearly":"1","my_account_buttons":"available","invoice_number_column":"1","use_latest_settings":"1"}' --format=json
    wp option update wpo_wcpdf_settings_debug '{"guest_access":"1","enable_cleanup":"1","cleanup_days":"30"}' --format=json
    wp option update wpo_wcpdf_settings_general '{"download_display":"display","template_path":"wp-content\/plugins\/woocommerce-pdf-invoices-packing-slips\/templates\/Simple","paper_size":"a4","header_logo":"","header_logo_height":"","shop_name":{"default":"MyShop"},"shop_address":{"default":"MyInfos"},"footer":{"default":""},"extra_1":{"default":""},"extra_2":{"default":""},"extra_3":{"default":""}}' --format=json

    The settings get accepted.

    As soon as i log in as administrator to the dashboard of the fresh installation, the settings get overwritten again. They are set to the defaults! This probably happens by calling the method protected function install() in includes\class-wcpdf-install.php again.

    It would be great, if this method would only be called once immediately after activating the plugin, and not when visiting the dashboard for the first time, as this hinders automatic setups.

    Thank you for your support.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @durrmann

    Probably this is happening because you are not setting the plugin version in the database, in the options table you need to add this meta: wpo_wcpdf_version

    This is used by the plugin to know if you have already the plugin installed.

    Thread Starter durrmann

    (@durrmann)

    Thank you very much! that did the trick!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Settings get overwritten after setup with wp-cli’ is closed to new replies.