Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadNateqi committed Oct 9, 2024
1 parent 7cdbbe5 commit acf5af8
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
54 changes: 54 additions & 0 deletions includes/Documents/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,60 @@ public function get_ubl_settings_fields( $option_name ) {
return apply_filters( "wpo_wcpdf_{$this->type}_ubl_settings_fields", $settings_fields, $option_name, $this );
}

/**
* Get the settings categories.
*
* @return array
*/
public function get_settings_categories(): array {
$settings_categories = array(
'general' => array(
'title' => __( 'General', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'enabled',
'attach_to_email_ids',
'disable_for_statuses',
'number_format',
'my_account_buttons',
),
),
'document_display' => array(
'title' => __( 'Document details', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'display_email',
'display_phone',
'display_customer_notes',
'display_shipping_address',
'display_date',
'display_number',
'next_invoice_number', // this should follow 'display_number'
'due_date'
)
),
'admin_display' => array(
'title' => __( 'Admin', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'invoice_number_column',
'invoice_date_column',
'invoice_number_search',
),
),
'advanced' => array(
'title' => __( 'Advanced', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'next_invoice_number',
'reset_number_yearly',
'mark_printed',
'unmark_printed',
'disable_free',
'use_latest_settings',
)
)
);

return apply_filters( "wpo_wcpdf_{$this->type}_settings_categories", $settings_categories, $this );
}

}

endif; // class_exists
28 changes: 28 additions & 0 deletions includes/Documents/PackingSlip.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,34 @@ public function init_settings() {

}

/**
* Get the settings categories.
*
* @return array
*/
public function get_settings_categories(): array {
$settings_categories = array(
'general' => array(
'title' => __( 'General', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'enabled',
'attach_to_email_ids',
),
),
'document_display' => array(
'title' => __( 'Document details', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'display_billing_address',
'display_email',
'display_phone',
'display_customer_notes',
)
),
);

return apply_filters( "wpo_wcpdf_{$this->type}_settings_categories", $settings_categories, $this );
}

}

endif; // class_exists

0 comments on commit acf5af8

Please sign in to comment.