Skip to content

Commit

Permalink
Bugfix: Some options were not being saved (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldavigdis authored Aug 6, 2024
1 parent 0931b2e commit 75baccd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class NineteenEightyWoo {
make_credit_invoice: Boolean( formData.get( 'make_credit_invoice' ) ),
domestic_customer_ledger_code: formData.get( 'domestic_customer_ledger_code' ),
international_customer_ledger_code: formData.get( 'international_customer_ledger_code' ),
use_attribute_description: Boolean( formData.get( 'use_attribute_description' ) ),
use_attribute_value_description: Boolean( formData.get( 'use_attribute_value_description' ) ),
product_convertion_to_variation_enabled: Boolean( formData.get( 'product_conversion' ) ),
fetch_products: true
}
Expand Down
4 changes: 2 additions & 2 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ public static function get_use_attribute_description(): bool {
public static function set_use_attribute_description( bool $value ): bool {
return update_option(
'1984_woo_dk_use_attribute_description',
(bool) $value
(int) $value
);
}

Expand Down Expand Up @@ -776,7 +776,7 @@ public static function set_use_attribute_value_description(
): bool {
return update_option(
'1984_woo_dk_use_attribute_value_description',
(bool) $value
(int) $value
);
}

Expand Down
4 changes: 2 additions & 2 deletions views/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class="regular-text api-key-input"
<td>
<input
id="use_attribute_description_label_field"
name="use_attribute_description_label"
name="use_attribute_description"
type="checkbox"
<?php echo esc_attr( Config::get_use_attribute_description() ? 'checked' : '' ); ?>
/>
Expand All @@ -208,7 +208,7 @@ class="regular-text api-key-input"
<td>
<input
id="use_attribute_description_value_field"
name="use_attribute_description_value"
name="use_attribute_value_description"
type="checkbox"
<?php echo esc_attr( Config::get_use_attribute_value_description() ? 'checked' : '' ); ?>
/>
Expand Down

0 comments on commit 75baccd

Please sign in to comment.