Skip to content

Commit

Permalink
enhance: dacimal value for subscription pack
Browse files Browse the repository at this point in the history
  • Loading branch information
sapayth committed Sep 18, 2024
1 parent 2d97a71 commit e9c610b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/js/components/subscriptions/SectionInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const processInput = (event) => {
};
const processNumber = (event) => {
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight'];
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight', '.'];
if (!allowedKeys.includes(event.key) && isNaN(Number(event.key))) {
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/subscriptions.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/Api/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public function create_or_update_item( $request ) {
$post_content = ! empty( $subscription['post_content'] ) ? sanitize_textarea_field(
$subscription['post_content']
) : '';
$billing_amount = ! empty( $subscription['meta_value']['_billing_amount'] ) ? (int) $subscription['meta_value']['_billing_amount'] : 0;
$billing_amount = ! empty( $subscription['meta_value']['_billing_amount'] ) ? floatval( $subscription['meta_value']['_billing_amount'] ) : 0;
$expiration_number = ! empty( $subscription['meta_value']['_expiration_number'] ) ? (int) $subscription['meta_value']['_expiration_number'] : 0;
$expiration_period = ! empty( $subscription['meta_value']['_expiration_period'] ) ? sanitize_text_field(
$subscription['meta_value']['_expiration_period']
Expand Down

0 comments on commit e9c610b

Please sign in to comment.