-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Rvvup paypal to minicart and cart (#47)
* Added Rvvup paypal to minicart and cart --------- Co-authored-by: Andrii Onufriichuk <[email protected]>
- Loading branch information
1 parent
64f1bdd
commit 9451f5d
Showing
9 changed files
with
367 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Rvvup\PaymentsHyvaCheckout\Block; | ||
|
||
use Magento\Checkout\Model\Session; | ||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Magento\Framework\View\Element\Template; | ||
use Magento\Quote\Api\Data\CartInterface; | ||
use Hyva\Theme\Service\CurrentTheme; | ||
|
||
class Paypal extends Template | ||
{ | ||
/** @var Session */ | ||
private $checkoutSession; | ||
|
||
/** @var CurrentTheme */ | ||
private $theme; | ||
|
||
/** | ||
* @param Session $checkoutSession | ||
* @param Template\Context $context | ||
* @param CurrentTheme $theme | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
Session $checkoutSession, | ||
Template\Context $context, | ||
CurrentTheme $theme, | ||
array $data = [] | ||
) { | ||
$this->checkoutSession = $checkoutSession; | ||
$this->theme = $theme; | ||
parent::__construct($context,$data); | ||
} | ||
|
||
/** | ||
* @return CartInterface | ||
* @throws LocalizedException | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getQuote(): CartInterface | ||
{ | ||
return $this->checkoutSession->getQuote(); | ||
} | ||
|
||
public function isHyvaThemeUsed(): bool | ||
{ | ||
return (bool)$this->theme->isHyva(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<move element="rvvup_payments.product.catalog_product_view.product.info.addtocart" | ||
destination="addtocart.shortcut.buttons" | ||
/> | ||
|
||
<referenceBlock name="rvvup_payments.product.catalog_product_view.product.info.addtocart"> | ||
<arguments> | ||
<argument name="magewire" xsi:type="object">Rvvup\PaymentsHyvaCheckout\Magewire\Product\View\Info\Addtocart</argument> | ||
</arguments> | ||
</referenceBlock> | ||
<body> | ||
<move element="rvvup_payments.product.catalog_product_view.product.info.addtocart" | ||
destination="addtocart.shortcut.buttons" | ||
/> | ||
<referenceBlock name="rvvup_payments.product.catalog_product_view.product.info.addtocart"> | ||
<arguments> | ||
<argument name="magewire" xsi:type="object">Rvvup\PaymentsHyvaCheckout\Magewire\Product\View\Info\Addtocart</argument> | ||
</arguments> | ||
</referenceBlock> | ||
</body> | ||
</page> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<page xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<body> | ||
<referenceBlock name="head.additional"> | ||
<block class="Magento\Framework\View\Element\Template" | ||
name="rvvup_payments.checkout_index_index.head.additional.assets" | ||
template="Rvvup_Payments::head/additional/assets.phtml" | ||
ifconfig="payment/rvvup/active"> | ||
<arguments> | ||
<argument name="rvvup_payments_assets_view_model" | ||
xsi:type="object">Rvvup\Payments\ViewModel\Assets</argument> | ||
</arguments> | ||
</block> | ||
</referenceBlock> | ||
<referenceBlock name="extra_actions"> | ||
<block name="rvvup-paypal-minicart-block" | ||
template="Rvvup_PaymentsHyvaCheckout::cart/paypal.phtml" | ||
class="Rvvup\PaymentsHyvaCheckout\Block\Paypal" ifconfig="payment/rvvup/active"> | ||
<arguments> | ||
<argument name="magewire" xsi:type="object"> | ||
Rvvup\PaymentsHyvaCheckout\Magewire\Product\View\Info\Addtocart | ||
</argument> | ||
<argument name="rvvup_payments_paypal_view_model" xsi:type="object"> | ||
Rvvup\Payments\ViewModel\PayPal | ||
</argument> | ||
</arguments> | ||
</block> | ||
</referenceBlock> | ||
</body> | ||
</page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0"?> | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" | ||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<body> | ||
<referenceBlock name="rvvup_payments.checkout_cart_index.methods"> | ||
<arguments> | ||
<argument name="magewire" xsi:type="object">Rvvup\PaymentsHyvaCheckout\Magewire\Checkout\Cart\Clearpay</argument> | ||
</arguments> | ||
</referenceBlock> | ||
<referenceContainer name="cart.summary"> | ||
<block name="rvvup-paypal-cart-block" after="checkout.cart.methods.bottom" | ||
template="Rvvup_PaymentsHyvaCheckout::cart/paypal.phtml" | ||
class="Rvvup\PaymentsHyvaCheckout\Block\Paypal"> | ||
<arguments> | ||
<argument name="magewire" xsi:type="object"> | ||
Rvvup\PaymentsHyvaCheckout\Magewire\Product\View\Info\Addtocart | ||
</argument> | ||
<argument name="is_cart_page" xsi:type="boolean">true</argument> | ||
<argument name="rvvup_payments_paypal_view_model" xsi:type="object"> | ||
Rvvup\Payments\ViewModel\PayPal | ||
</argument> | ||
</arguments> | ||
</block> | ||
</referenceContainer> | ||
</body> | ||
</page> |
Oops, something went wrong.