Skip to content

Commit

Permalink
feature: dtd migration step
Browse files Browse the repository at this point in the history
  • Loading branch information
Ante Laca committed Mar 25, 2024
1 parent 3e48195 commit d7e671c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/FormMigration/Steps/DoubleTheDonation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Give\FormMigration\Steps;

use Give\FormMigration\Contracts\FormMigrationStep;
use Give\Framework\Blocks\BlockModel;

/**
* @unreleased
*/
class DoubleTheDonation extends FormMigrationStep
{

/**
* @unreleased
*/
public function process()
{
if ($this->formV2->getDoubleTheDonationStatus() !== 'enabled') {
return;
}

$block = BlockModel::make([
'name' => 'givewp/dtd',
'attributes' => [
'label' => $this->formV2->getDoubleTheDonationLabel(),
'company' => [
'company_id' => '',
'company_name' => '',
'entered_text' => '',
],
],
]);

$this->fieldBlocks->insertAfter('givewp/donation-amount', $block);
}
}

0 comments on commit d7e671c

Please sign in to comment.