<?xml version='1.0' encoding='utf-8'?>
<modification>
	<name>Advertikon stripe</name>
	<code>advertikon_stripe</code>
	<version>5.0.44</version>
	<author>Advertikon</author>
	<link>http://www.advertikon.com.ua</link>

	<file path="catalog/controller/account/account.php">
		<operation error="skip">
			<search regex="false"><![CDATA[
				$data['header'] = $this->load->controller('common/header');
			]]></search>
			<add position="after"><![CDATA[
			
			$data['adk_cards_management'] = '';
			$data['text_cards_management'] = $this->language->get( 'text_cards_management' );

			if ( class_exists( 'Advertikon\Setting' ) && class_exists( 'Advertikon\Stripe\Advertikon' ) ) {
				$data['adk_cards_management'] = \Advertikon\Setting::get( 'edit_cards', \Advertikon\Stripe\Advertikon::instance() ) ?
					( version_compare( VERSION, '2.3.0.0', '<=' ) ?
						$this->url->link( 'payment/advertikon_stripe/account_cards', '', 'SSL' ) :
						$this->url->link( 'extension/payment/advertikon_stripe/account_cards', '', 'SSL' ) ) :
					'';
			}
			
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/multimerch/account_account.php">
		<operation error="skip">
			<search regex="false"><![CDATA[
				$data['header'] = $this->load->controller('common/header');
			]]></search>
			<add position="after"><![CDATA[
			
			$data['adk_cards_management'] = '';
			$data['text_cards_management'] = $this->language->get( 'text_cards_management' );

			if ( class_exists( 'Advertikon\Setting' ) && class_exists( 'Advertikon\Stripe\Advertikon' ) ) {
				$data['adk_cards_management'] = \Advertikon\Setting::get( 'edit_cards', \Advertikon\Stripe\Advertikon::instance() ) ?
					( version_compare( VERSION, '2.3.0.0', '<=' ) ?
						$this->url->link( 'payment/advertikon_stripe/account_cards', '', 'SSL' ) :
						$this->url->link( 'extension/payment/advertikon_stripe/account_cards', '', 'SSL' ) ) :
					'';
			}
			
			]]></add>
		</operation>
	</file>

	<file path="catalog/language/*/account/account.php">
		<operation error="skip">
			<search regex="true"><![CDATA[~\$_\['text_transactions'\]\s+=\s+'Transactions';~]]></search>
			<add position="after"><![CDATA[
				
				$_['text_cards_management']  = 'My cards';
				
			]]></add>
		</operation>

		<operation error="skip">
			<search regex="true"><![CDATA[~\$_\['text_transaction'\]\s+=\s+'Your Transactions';~]]></search>
			<add position="after"><![CDATA[
				
				$_['text_cards_management']  = 'My cards';
				
			]]></add>
		</operation>

		<operation error="skip">
			<search regex="true"><![CDATA[~\$_\['text_wishlist'\]\s+=\s+'Modify your wish list';~]]></search>
			<add position="after"><![CDATA[
				
				$_['text_cards_management']  = 'My cards';
				
			]]></add>
		</operation>
	</file>

	<file path="catalog/view/theme/*/template/account/account.tpl">
		<operation error="skip">
			<search><![CDATA[<?php echo $text_wishlist; ?>]]></search>
			<add position="after"><![CDATA[
				
				<?php if( !empty( $adk_cards_management ) && !empty( $text_cards_management ) ) : ?>
				<li><a href="<?php echo $adk_cards_management; ?>"><?php echo $text_cards_management; ?></a></li>
				<?php endif; ?>
				
			]]></add>
		</operation>
	</file>

	<file path="catalog/view/theme/*/template/account/account.twig">
		<operation error="skip">
			<search><![CDATA[<li><a href="{{ wishlist }}">{{ text_wishlist }}</a></li>]]></search>
			<add position="after"><![CDATA[
				
				{% if adk_cards_management %}
				<li><a href="{{ adk_cards_management }}">{{ text_cards_management }}</a></li>
				{% endif %}
				
			]]></add>
		</operation>

		<operation error="skip">
			<search><![CDATA[<li class="edit-wishlist"><a href="{{ wishlist }}">{{ text_wishlist }}</a></li>]]></search>
			<add position="after"><![CDATA[
				{% if adk_cards_management %}
				<style>.account-list > .adk-cards > a::before { content: '\e95f' !important;font-family: icomoon !important;}</style>
				<li class="adk-cards"><a href="{{ adk_cards_management }}">{{ text_cards_management }}</a></li>
				{% endif %}
			]]></add>
		</operation>
	</file>

	<file path="catalog/view/theme/journal2/template/multimerch/account/account.tpl">
		<operation error="skip">
			<search><![CDATA[<?php echo $text_recurring; ?]]></search>
			<add position="after"><![CDATA[
				
				<?php if( !empty( $adk_cards_management ) && !empty( $text_cards_management ) ) : ?>
				<li><a href="<?php echo $adk_cards_management; ?>"><i class="fa fa-credit-card"></i><span><?php echo $text_cards_management; ?></span></a></li>
				<?php endif; ?>
				
			]]></add>
		</operation>
	</file>

	<file path="catalog/view/theme/journal2/template/multimerch/account/account.twig">
		<operation error="skip">
			<search><![CDATA[{{ text_recurring }}]]></search>
			<add position="after"><![CDATA[
				
				{% if adk_cards_management %}
				<li><a href="{{ adk_cards_management }}">{{ text_cards_management }}</a></li>
				{% endif %}
				
			]]></add>
		</operation>
	</file>

	<file path="admin/language/*/report/customer_activity.php">
		<operation error="skip">
			<search><![CDATA[$_['text_return_guest']   = '%s submitted a product return.';]]></search>
			<add position="after"><![CDATA[
				
$_['text_delete_card'] = '<a href="customer_id=%d">%s</a> deleted payment card "%s".';
$_['text_fail_delete_card'] = '<a href="customer_id=%d">%s</a> tried to delete card %s but failed with an error "%s".';
$_['text_default_card'] = '<a href="customer_id=%d">%s</a> changed default payment card from "%s" to "%s".';
$_['text_fail_default_card'] = '<a href="customer_id=%d">%s</a> tried to set default card %s but failed with an error "%s".';
				
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/product/product.php">
		<operation error="skip">
			<search><![CDATA[$data['recurrings'] = $this->model_catalog_product->getProfiles($this->request->get['product_id']);]]></search>
			<add position="after"><![CDATA[
				
				if ( version_compare( VERSION, '2.3.0.0','>=' ) ) {
					$data['pay_button'] = $this->load->controller( 'extension/payment/advertikon_stripe/pay_button', $this->request->get['product_id'] );

				} else {
					$data['pay_button'] = $this->load->controller( 'payment/advertikon_stripe/pay_button', $this->request->get['product_id'] );
				}
				
			]]></add>
		</operation>
	</file>

	<file path="catalog/view/theme/*/template/product/product.tpl">
		<operation error="skip">
			<search><![CDATA[<button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?></button>]]></search>
			<add position="before"><![CDATA[
				<?php echo isset( $pay_button ) ?  $pay_button : ''; ?>
			]]></add>
		</operation>
	</file>

	<file path="catalog/view/theme/*/template/product/product.twig">
		<operation error="skip">
			<search><![CDATA[<div class="button-group-page">]]></search>
			<add position="before"><![CDATA[
				{{ pay_button }}
			]]></add>
		</operation>

		<operation error="skip">
			<ignoreif><![CDATA[{{ pay_button }}]]></ignoreif>
			<search><![CDATA[id="button-cart"]]></search>
			<add position="before"><![CDATA[
				{{ pay_button }}
			]]></add>
		</operation>
	</file>

	<file path="system/engine/front.php">
		<operation error="error">
			<ignoreif><![CDATA[
				$adk_registry = $registry;
			]]></ignoreif>
			<search><![CDATA[
				$this->registry = $registry;
			]]></search>
			<add position="after"><![CDATA[
				global $adk_registry; $adk_registry = $registry;
			]]></add>
		</operation>
	</file>

	<file path="system/engine/router.php">
		<operation error="error">
			<ignoreif><![CDATA[
				$adk_registry = $registry;
			]]></ignoreif>
			<search><![CDATA[
				$this->registry = $registry;
			]]></search>
			<add position="after"><![CDATA[
				global $adk_registry; $adk_registry = $registry;
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/account/recurring.php">
		<operation error="skip">
			<search><![CDATA[$data['recurring'] = $this->load->controller('recurring/' . $recurring_info['payment_code']);]]></search>
			<add position="after"><![CDATA[
				if ( $recurring_info['payment_code'] == 'advertikon_stripe' ) {
					$data['recurring'] = $this->load->controller( 'payment/advertikon_stripe/recurringButtons' );
				}
			]]></add>
		</operation>

		<operation error="skip">
			<search><![CDATA[$data['recurring'] = $this->load->controller('extension/recurring/' . $recurring_info['payment_code']);]]></search>
			<add position="after"><![CDATA[
				if ( $recurring_info['payment_code'] == 'advertikon_stripe' ) {
					$data['recurring'] = $this->load->controller( 'extension/payment/advertikon_stripe/recurringButtons' );
				}
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/startup/router.php">
		<operation error="skip">
			<search><![CDATA[$route = $this->request->get['route'];]]></search>
			<add position="replace"><![CDATA[$route = urldecode( $this->request->get['route'] );]]></add>
		</operation>
	</file>

</modification>
