Skip to content

Commit

Permalink
fix: missing jquery file within address book
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Jul 10, 2023
1 parent 9804a47 commit d9d5d4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Checkout/Component/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
abstract class AddressBook extends Address implements i18nEntityProvider
{
private static $jquery_file = 'https://code.jquery.com/jquery-3.7.0.min.js';
/**
* The composite field tag to use
*
Expand All @@ -34,9 +35,12 @@ public function getFormFields(Order $order)
$fields = parent::getFormFields($order);

if ($existingaddressfields = $this->getExistingAddressFields()) {
Requirements::javascript('silverstripe/admin:thirdparty/jquery/jquery.js');
if ($jquery = $this->config()->get('jquery_file')) {
Requirements::javascript($jquery);
}

Requirements::javascript('silvershop/core:client/dist/javascript/CheckoutPage.js');

// add the fields for a new address after the dropdown field
$existingaddressfields->merge($fields);
// group under a composite field (invisible by default) so we
Expand Down
2 changes: 2 additions & 0 deletions src/Checkout/Component/CheckoutComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use SilverShop\Model\Order;
use SilverShop\ShopTools;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\ValidationException;
Expand All @@ -22,6 +23,7 @@
abstract class CheckoutComponent
{
use Injectable;
use Configurable;

protected $requiredfields = [];

Expand Down

0 comments on commit d9d5d4b

Please sign in to comment.