Astra_Woocommerce::woocommerce_product_single_payments()

Single Product Payments.


Description


Return

(void)


Source

File: inc/compatibility/woocommerce/class-astra-woocommerce.php

		public function woocommerce_product_single_payments() {
			$section_title    = astra_get_option( 'single-product-payment-text' );
			$if_color_version = astra_get_option( 'single-product-payment-icon-color' );
			$visa_icon        = Astra_Builder_UI_Controller::fetch_svg_icon( 'visa', false );
			$visa_gray        = Astra_Builder_UI_Controller::fetch_svg_icon( 'visa_gray', false );
			$mastercard_icon  = Astra_Builder_UI_Controller::fetch_svg_icon( 'mastercard', false );
			$mastercard_gray  = Astra_Builder_UI_Controller::fetch_svg_icon( 'mastercard_gray', false );
			$amex_icon        = Astra_Builder_UI_Controller::fetch_svg_icon( 'amex', false );
			$amex_gray        = Astra_Builder_UI_Controller::fetch_svg_icon( 'amex_gray', false );
			$discover_icon    = Astra_Builder_UI_Controller::fetch_svg_icon( 'discover', false );
			$discover_gray    = Astra_Builder_UI_Controller::fetch_svg_icon( 'discover_gray', false );
			$paypal_icon      = Astra_Builder_UI_Controller::fetch_svg_icon( 'paypal', false );
			$paypal_gray      = Astra_Builder_UI_Controller::fetch_svg_icon( 'paypal_gray', false );
			$applepay_icon    = Astra_Builder_UI_Controller::fetch_svg_icon( 'applepay', false );
			$applepay_gray    = Astra_Builder_UI_Controller::fetch_svg_icon( 'applepay_gray', false );

			if ( 'inherit_text_color' === $if_color_version ) {
				$visa_icon       = $visa_gray;
				$mastercard_icon = $mastercard_gray;
				$amex_icon       = $amex_gray;
				$discover_icon   = $discover_gray;
				$paypal_icon     = $paypal_gray;
				$applepay_icon   = $applepay_gray;
			}

			ob_start();
			?>
			<?php $if_color_version = 'inherit_text_color' === $if_color_version ? 'ast-text-color-version' : 'ast-inherit-color-version'; ?>
			<fieldset class="ast-single-product-payments <?php echo esc_attr( $if_color_version ); ?>">
				<legend><?php echo esc_html( $section_title ); ?></legend>
				<ul>
					<?php if ( astra_get_option( 'single-product-payment-visa' ) ) { ?>
						<li class="ast-payment-visa">
							<?php echo $visa_icon;  // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
						</li>
					<?php } ?>
					<?php if ( astra_get_option( 'single-product-payment-mastercard' ) ) { ?>
						<li class="ast-payment-mastercard">
							<?php echo $mastercard_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
						</li>
					<?php } ?>
					<?php if ( astra_get_option( 'single-product-payment-amex' ) ) { ?>
						<li class="ast-payment-amex">
							<?php echo $amex_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
						</li>
					<?php } ?>
					<?php if ( astra_get_option( 'single-product-payment-discover' ) ) { ?>
						<li class="ast-payment-discover">
							<?php echo $discover_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
						</li>
					<?php } ?>
					<?php if ( astra_get_option( 'single-product-payment-paypal' ) ) { ?>
						<li class="ast-payment-paypal">
							<?php echo $paypal_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
						</li>
					<?php } ?>
					<?php if ( astra_get_option( 'single-product-payment-apple-pay' ) ) { ?>
						<li class="ast-payment-apple-pay">
							<?php echo $applepay_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
						</li>
					<?php } ?>
				</ul>
			</fieldset>

			<?php
			echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		}

Changelog

Changelog
Version Description
3.9.2 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.