From f621a2e05a7ab8de53cc4ea6218e332a6a7f424d Mon Sep 17 00:00:00 2001 From: Oliverio Date: Wed, 11 Mar 2020 04:21:56 -0300 Subject: [PATCH] #13 Document option were added to system 2 --- Plugin/CidConfiguration.php | 19 +++++++++++-------- view/frontend/layout/checkout_index_index.xml | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Plugin/CidConfiguration.php b/Plugin/CidConfiguration.php index fbcaf2e..32b0f9b 100644 --- a/Plugin/CidConfiguration.php +++ b/Plugin/CidConfiguration.php @@ -37,9 +37,6 @@ public function afterProcess( LayoutProcessor $processor, array $jsLayout ) { - $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/oliverio.log'); - $logger = new \Zend\Log\Logger(); - $logger->addWriter($writer); if (!$this->helper->isShippingEnabled()) { $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] @@ -51,20 +48,26 @@ public function afterProcess( ['payment']['children']['cid-billing-form']['config']['componentDisabled'] = true; } - $currentOptions = $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] + $currentShippingOptions = $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] ['shippingAddress']['children']['cid-shipping-form']['children']['cid-shipping-form-container']['children']['cid-shipping-form-fieldset']['children']['shipping_cid_type']['options']; foreach ($this->helper->getShippingDocumentTypes() as $k => $v) { - $currentOptions[] = ['value' => $k, 'label' => $v]; + $currentShippingOptions[] = ['value' => $k, 'label' => $v]; } $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] - ['shippingAddress']['children']['cid-shipping-form']['children']['cid-shipping-form-container']['children']['cid-shipping-form-fieldset']['children']['shipping_cid_type']['options'] = $currentOptions; + ['shippingAddress']['children']['cid-shipping-form']['children']['cid-shipping-form-container']['children']['cid-shipping-form-fieldset']['children']['shipping_cid_type']['options'] = $currentShippingOptions; + + $currentBillingOptions = $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] + ['payment']['children']['cid-billing-form']['children']['cid-billing-form-container']['children']['cid-billing-form-fieldset']['children']['billing_cid_type']['options']; + + foreach ($this->helper->getBillingDocumentTypes() as $k => $v) { + $currentBillingOptions[] = ['value' => $k, 'label' => $v]; + } $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] - ['payment']['children']['cid-billing-form']['children']['cid-billing-form-container']['children']['cid-billing-form-fieldset']['children']['billing_cid_type']['options'] = $currentOptions; + ['payment']['children']['cid-billing-form']['children']['cid-billing-form-container']['children']['cid-billing-form-fieldset']['children']['billing_cid_type']['options'] = $currentBillingOptions; - $logger->info(print_r($currentOptions, true)); return $jsLayout; } } diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index d1744da..f862b8a 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -138,6 +138,7 @@ Please select value + checkoutProvider cidBillingForm.billing_cid_type