Skip to content

Commit

Permalink
Merge pull request #7 from CompagnonAgency/fj-update
Browse files Browse the repository at this point in the history
feat: added price guarantee + inventory report
  • Loading branch information
FalkoJoseph authored Apr 12, 2024
2 parents 81682c0 + b925c78 commit 4872f61
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
40 changes: 40 additions & 0 deletions modules/fields/class-price.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,46 @@ public static function retrieve()
'name' => 'custom_price',
'type' => 'text',
],
[
'key' => 'price_inventory_report_cost',
'label' => 'Price inventory report cost',
'name' => 'price_inventory_report_cost',
'type' => 'group',
'sub_fields' => [
[
'key' => 'amount',
'label' => 'Amount',
'name' => 'amount',
'type' => 'number',
],
[
'key' => 'currency',
'label' => 'Currency',
'name' => 'currency',
'type' => 'text',
],
],
],
[
'key' => 'price_guarantee',
'label' => 'Price guarantee',
'name' => 'price_guarantee',
'type' => 'group',
'sub_fields' => [
[
'key' => 'amount',
'label' => 'Amount',
'name' => 'amount',
'type' => 'number',
],
[
'key' => 'currency',
'label' => 'Currency',
'name' => 'currency',
'type' => 'text',
],
],
],
],
];
}
Expand Down
14 changes: 14 additions & 0 deletions modules/update/class-price-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,19 @@ public static function update($estate, $post_id)
update_field('price', [
'custom_price' => $estate['custom_price'],
], $post_id);

update_field('price', [
'price_inventory_report_cost' => [
'amount' => $estate['price_inventory_report_cost']['amount'],
'currency' => $estate['price_inventory_report_cost']['currency'],
],
], $post_id);

update_field('price', [
'price_guarantee' => [
'amount' => $estate['price_guarantee']['amount'],
'currency' => $estate['price_guarantee']['currency'],
],
], $post_id);
}
}
4 changes: 2 additions & 2 deletions wp-sweepbright.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author: Compagnon Agency
* Author URI: https://compagnon.agency/
* Text Domain: wp-sweepbright
* Version: 2.11.0
* Version: 2.12.0
*/

// If this file is called directly, abort.
Expand All @@ -23,7 +23,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define('WP_SWEEPBRIGHT_VERSION', '2.11.0');
define('WP_SWEEPBRIGHT_VERSION', '2.12.0');

/**
* The code that runs during plugin activation.
Expand Down

0 comments on commit 4872f61

Please sign in to comment.