Skip to content

Commit

Permalink
Removed useless views
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Jan 9, 2025
1 parent 7f0e5b0 commit a133991
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 219 deletions.
81 changes: 0 additions & 81 deletions ps_checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,62 +446,6 @@ public function hookActionCartUpdateQuantityBefore()
}
}

/**
* Add payment option at the checkout in the front office (prestashop 1.6)
*/
public function hookDisplayPayment()
{
if (false === Validate::isLoadedObject($this->context->cart)
|| false === $this->checkCurrency($this->context->cart)
|| false === $this->merchantIsValid()
) {
return '';
}

/** @var \PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider $fundingSourceProvider */
$fundingSourceProvider = $this->getService(\PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceProvider::class);
$paymentOptions = [];

foreach ($fundingSourceProvider->getAll() as $fundingSource) {
$paymentOptions[$fundingSource->name] = $fundingSource->label;
}

/** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */
$shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class);

/** @var \PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository $psCheckoutCartRepository */
$psCheckoutCartRepository = $this->getService(\PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository::class);

/** @var PsCheckoutCart|false $psCheckoutCart */
$psCheckoutCart = $psCheckoutCartRepository->findOneByCartId((int) $this->context->cart->id);

/** @var \PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration $configurationPayPal */
$configurationPayPal = $this->getService(\PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class);

$isExpressCheckout = false !== $psCheckoutCart && $psCheckoutCart->isExpressCheckout && $psCheckoutCart->isOrderAvailable();

$this->context->smarty->assign([
'cancelTranslatedText' => $this->l('Choose another payment method'),
'isExpressCheckout' => $isExpressCheckout,
'modulePath' => $this->getPathUri(),
'paymentOptions' => $paymentOptions,
'isHostedFieldsAvailable' => $configurationPayPal->isHostedFieldsEnabled() && in_array($configurationPayPal->getCardHostedFieldsStatus(), ['SUBSCRIBED', 'LIMITED'], true),
'spinnerPath' => $this->getPathUri() . 'views/img/tail-spin.svg',
'loaderTranslatedText' => $this->l('Please wait, loading additional payment methods.'),
'paypalLogoPath' => $this->getPathUri() . 'views/img/paypal_express.png',
'translatedText' => strtr(
$this->l('You have selected your [PAYPAL_ACCOUNT] PayPal account to proceed to the payment.'),
[
'[PAYPAL_ACCOUNT]' => $this->context->cookie->__get('paypalEmail') ? $this->context->cookie->__get('paypalEmail') : '',
]
),
'shoppingCartWarningPath' => $this->getPathUri() . 'views/img/shopping-cart-warning.svg',
'warningTranslatedText' => $this->l('Warning'),
]);

return $this->display(__FILE__, 'views/templates/hook/displayPayment.tpl');
}

/**
* Add payment option at the checkout in the front office (prestashop 1.7)
*
Expand Down Expand Up @@ -1309,31 +1253,6 @@ public function hookActionObjectShopAddAfter(array $params)
}
}

/**
* This hook called on BO Order view page before 1.7.7
*
* @param array{cookie: Cookie, cart: Cart, altern: int, id_order: int} $params
*
* @return string
*/
public function hookDisplayAdminOrderLeft(array $params)
{
$order = new Order((int) $params['id_order']);

if ($order->module !== $this->name) {
return '';
}

$this->context->smarty->assign([
'moduleLogoUri' => $this->getPathUri() . 'logo.png',
'moduleName' => $this->displayName,
'orderPrestaShopId' => $order->id,
'orderPayPalBaseUrl' => $this->context->link->getAdminLink('AdminAjaxPrestashopCheckout'),
]);

return $this->display(__FILE__, 'views/templates/hook/displayAdminOrderLeft.tpl');
}

/**
* This hook called on BO Order view page after 1.7.7
*
Expand Down
34 changes: 0 additions & 34 deletions views/templates/hook/displayAdminOrderLeft.tpl

This file was deleted.

104 changes: 0 additions & 104 deletions views/templates/hook/displayPayment.tpl

This file was deleted.

0 comments on commit a133991

Please sign in to comment.