View file store/templates/store/includes/lightbox.html

File size: 32.16Kb
<?php
update_store_image_view($context['post_data']['id']);
?>
<div class="light__box" data-post-id="<?php echo($context['post_data']['id']) ?>">
	<div class="lightbox-ol"></div>
	<?php if( !isset( $context['post_data']['standalone'] ) ){ ?>
		<div class="pp_light_close" onclick="$('.light__box').remove();$('body').removeClass('scroll_stop');window.history.pushState('', '', site_url( 'store' ) );">
			<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"></path><path fill="currentColor" d="M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"></path></svg>
		</div>
	<?php } ?>
	<div class="lightbox-outer">
		<div class="lightbox-inner">
			<div class="post-data">
				<div class="posts-media-renderer" style="position: relative;">
					<div id="post-data-cr" class="carousel slide carousel-fade" data-ride="carousel" data-interval="false">
						<div class="carousel-inner">
							<div class="item active">
								<img src="<?php echo(media($context['post_data']['small_file'])) ?>" alt="Image" class="img-res" />
							</div>
						</div>
					</div>
				</div>
				<div class="heading">
					<div class="avatar">
						<img src="<?php echo(media($context['post_data']['avatar'])) ?>" class="img-circle">
					</div>
					<div class="uname">
						<h6><a href="<?php echo(un2url($context['post_data']['username'])) ?>"  data-ajax="ajax_loading.php?app=profile&apph=profile&uname=<?php echo($context['post_data']['username']) ?>"><?php echo($context['post_data']['username']) ?></a>
							<?php if ($context['post_data']['is_verified'] > 0) { ?>
							<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#00BCD4" class="verified-color feather feather-check-circle"><path d="M23,12L20.56,9.22L20.9,5.54L17.29,4.72L15.4,1.54L12,3L8.6,1.54L6.71,4.72L3.1,5.53L3.44,9.21L1,12L3.44,14.78L3.1,18.47L6.71,19.29L8.6,22.47L12,21L15.4,22.46L17.29,19.28L20.9,18.46L20.56,14.78L23,12M10,17L6,13L7.41,11.59L10,14.17L16.59,7.58L18,9L10,17Z"></path></svg>
							<?php } ?>
						</h6>
						<time><?php echo(time2str($context['post_data']['created_date'])) ?></time>
					</div>
					<?php if( !isset( $context['post_data']['standalone'] ) ){ ?>
						<div class="pp_light_close" onclick="$('.light__box').remove();$('body').removeClass('scroll_stop');window.history.pushState('', '', site_url( 'store' ) );">
							<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg>
						</div>
					<?php } ?>
				</div>
				<div class="posts-votes">
					<div class="posts-votes-inner">
						<div class="pp_store_pic_details">
							<h3><?php echo $context['post_data']['title'];?></h3>
							
							<div>
								<?php
									$license_options = $context['post_data']["license_options"];
									if(!empty($license_options)){
										$_license_options = unserialize( $context['post_data']["license_options"] );
										$i = 0;
										foreach($_license_options as $key => $value){
								?>
									<label class="pp_store_license_select">
										<input name="license_price" type="radio" value="" checked>
										<span class="lnce_name">
											<span class="duration"><?php echo ucfirst(str_replace('_',' ',$key)); ?></span>
											<?php
												if($context['post_data']["user_id"] !== $context["user"]["user_id"]){
												if( !is_store_item_purchased($context['post_data']['id'], $key) ){
											?>
												<a onclick="Pxp_GetStorePaymentMethods('store','<?php echo $value;?>','<?php echo $context["post_data"]["title"];?>','<?php echo $context["post_data"]["id"];?>','<?php echo $key;?>',this);">{{LANG buy}}</a>
											<?php }else{ ?>
												<a href="<?php echo(pxp_link('download.php?id='.$context['post_data']['id'].'&hash='.$context['csrf_token'])); ?><?php //echo media($context['post_data']['full_file']);?>" target="_blank">{{LANG download}}</a>
											<?php } } ?>
											<span class="price"><?php echo $context['currency_symbol'].$value; ?></span>
										</span>
									</label>
								<?php } ?>
								<?php } ?>
							</div>
							
							<table class="table">
								<tbody>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z" /></svg> {{LANG category}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['category_name']; ?></td>
									</tr>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21,15H23V17H21V15M21,11H23V13H21V11M23,19H21V21C22,21 23,20 23,19M13,3H15V5H13V3M21,7H23V9H21V7M21,3V5H23C23,4 22,3 21,3M1,7H3V9H1V7M17,3H19V5H17V3M17,19H19V21H17V19M3,3C2,3 1,4 1,5H3V3M9,3H11V5H9V3M5,3H7V5H5V3M1,11V19A2,2 0 0,0 3,21H15V11H1M3,19L5.5,15.79L7.29,17.94L9.79,14.72L13,19H3Z" /></svg> {{LANG resolution}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['dimensions']; ?></td>
									</tr>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,14.29L6.5,19H17.46L14.75,15.46L12.78,17.8L10,14.29M5,21V7H18.96V21H5M12,2.4L14.61,5.03H9.37L12,2.4M5,5.03C4.5,5.03 4,5.22 3.61,5.61C3.2,6 3,6.46 3,7V21C3,21.5 3.2,22 3.61,22.39C4,22.8 4.5,23 5,23H18.96C19.5,23 19.96,22.8 20.37,22.39C20.77,22 21,21.5 21,21V7C21,6.46 20.77,6 20.37,5.61C19.96,5.22 19.5,5.03 18.96,5.03H16L12,1L7.96,5.03H5Z" /></svg> {{LANG image_type}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['ext']; ?></td>
									</tr>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" /></svg> {{LANG views}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['views']; ?></td>
									</tr>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" /></svg> {{LANG downloads}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['downloads']; ?></td>
									</tr>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M11 8C11 10.21 9.21 12 7 12C4.79 12 3 10.21 3 8C3 5.79 4.79 4 7 4C9.21 4 11 5.79 11 8M11 14.72V20H0V18C0 15.79 3.13 14 7 14C8.5 14 9.87 14.27 11 14.72M24 20H13V3H24V20M16 11.5C16 10.12 17.12 9 18.5 9C19.88 9 21 10.12 21 11.5C21 12.88 19.88 14 18.5 14C17.12 14 16 12.88 16 11.5M22 7C20.9 7 20 6.11 20 5H17C17 6.11 16.11 7 15 7V16C16.11 16 17 16.9 17 18H20C20 16.9 20.9 16 22 16V7Z" /></svg> {{LANG sells}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['sells']; ?></td>
									</tr>
									<tr>
										<td class="pp_store_pic_details_name"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z" /></svg> {{LANG tags}}</td>
										<td class="pp_store_pic_details_detail"><?php echo $context['post_data']['tags']; ?></td>
									</tr>
								</tbody>
							</table>
						</div>
						
						<?php if($context['post_data']["user_id"] == $context["user"]["user_id"]){ ?>
							<div>
								<a href="{{CONFIG site_url}}/store/{{ME username}}/update?post_id=<?php echo $context['post_data']['id'];?>" class="btn btn-info btn_links paypal_btn" data-ajax="ajax_loading.php?app=store&amp;apph=store&amp;user=<?php echo $context["user"]["username"];?>&amp;page=update&amp;post_id=<?php echo $context['post_data']['id'];?>">{{LANG edit_post}}</a>
								<button type="button" onclick="Px_delete_story('<?php echo $context['post_data']['id']; ?>');" class="btn btn-info btn_links paypal_btn">{{LANG delete}}</button>
							</div>
						<?php } ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="confirm--modal go_pro--modal" style="display: none !important;">
	<div class="confirm--modal--inner">
		<div class="confirm--modal--body">
			<h5>{{LANG choose_method}}</h5>
			<div class="payment_methods_modal">
			</div>
		</div>
		<div class="confirm--modal--footer">
			<button class="btn btn-default" data-confirm--modal-dismiss>{{LANG cancel}}</button>
		</div>
	</div>
</div>

<div class="confirm--modal bank_payment--modal" style="display: none !important;">
	<div class="confirm--modal--inner">
		<div class="confirm--modal--body dt_bank_trans_modal">
			<h5>{{LANG bank_transfer}}</h5>
			<div class="bank_alert"></div>
			<?php echo $config['bank_description'];?>
			<br>
			<br>
			<?php if (!empty($config['bank_transfer_note'])) { ?>
			<div class="dt_user_profile">
				<ul class="dt_prof_vrfy">
					<li><?php echo $config['bank_transfer_note'];?></li>
				</ul>
			</div>
			<?php } ?>
			<div class="fak_image">
				<div id="fake_img_holder"></div>
				<div class="upload_fk_image" onclick="document.getElementById('upload-image').click(); return false">
					<div class="upload_fk_image_content">
						<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><path fill="currentColor" d="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z" /></svg> {{LANG upload_file}}
					</div>
				</div>
			</div>
		</div>
		<div class="confirm--modal--footer">
			<button class="btn btn-default" data-confirm--modal-dismiss>{{LANG cancel}}</button>
			<button class="btn btn-danger btn-red send_bank">{{LANG send}}</button>
			<form class="bank_transfer_form">
	      		<input class="hidden" id="upload-image" type="file" name="image" multiple accept="image/*">
				<input class="hidden" type="text" name="type" value="store">

				<input class="hidden" type="text" name="amount" id="bank_amount" value="">
				<input class="hidden" type="text" name="title" id="bank_title" value="">
				<input class="hidden" type="text" name="id" id="bank_id" value="">
				<input class="hidden" type="text" name="license" id="bank_license" value="">
	      		<input type="reset" id="configreset" value="Reset" class="hidden">
	      	</form>
		</div>
	</div>
</div>

<div class="modal fade matdialog" id="2checkout_modal" role="dialog" data-keyboard="false">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span></button>
				<h4 class="modal-title">{{LANG 2checkout}}</h4>
			</div>
			<form class="form form-horizontal" method="post" id="2checkout_form" action="#">
				<div class="modal-body twocheckout_modal">
					<div id="2checkout_alert"></div>
					<div class="clear"></div>
					<div class="row">
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="text" value="<?php echo($pt->user->name) ?>" id="card_name" placeholder="{{LANG name}}" autocomplete="off">
								<label for="card_name">{{LANG name}}</label>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="text" value="<?php echo($pt->user->address) ?>" id="card_address" placeholder="{{LANG address}}" autocomplete="off">
								<label for="card_address">{{LANG address}}</label>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="text" value="<?php echo($pt->user->city) ?>" id="card_city" placeholder="{{LANG city}}" autocomplete="off">
								<label for="card_city">{{LANG city}}</label>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="text" value="<?php echo($pt->user->state) ?>" id="card_state" placeholder="{{LANG state}}" autocomplete="off">
								<label for="card_state">{{LANG state}}</label>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="text" value="<?php echo($pt->user->zip) ?>" id="card_zip" placeholder="{{LANG zip}}" autocomplete="off">
								<label for="card_zip">{{LANG zip}}</label>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<select id="card_country" name="card_country">
									<?php
									$countries = '';
									foreach ($context['countries_name'] as $key => $value) {
										$selected = '';
										//if (IS_LOGGED) {
										//	$selected = ($key == $pt->user->country_id) ? 'selected' : '';
										//}
										$countries .= '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
									}
									echo $countries;
									?>
								</select>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="email" value="<?php echo($pt->user->email) ?>" id="card_email" placeholder="{{LANG email}}" autocomplete="off">
								<label for="card_email">{{LANG email}}</label>
							</div>
						</div>
						<div class="col-md-6">
							<div class="pg_mat_input">
								<input type="tel" value="<?php echo($pt->user->phone_number) ?>" id="card_phone" placeholder="{{LANG Phone number}}" autocomplete="off">
								<label for="card_phone">{{LANG Phone number}}</label>
							</div>
						</div>
					</div>
					<div class="clear"></div>
					<hr>
					<div class= two_check_card">
						<h4 class="modal-title">{{LANG Card Details}}</h4>
						<hr>
						<div class="row">
							<div class="col-md-12">
								<div class="pg_mat_input">
									<input id="card_number" name="card_number" type="hidden" class="form-control input-md" autocomplete="off">
									<input type="text" id="_number_" placeholder="{{LANG Card number}}" autocomplete="off">
									<label for="_number_">{{LANG Card number}}</label>
								</div>
							</div>
							<div class="col-md-4">
								<div class="pg_mat_input">
									<select id="card_month" name="card_month">
										<option value="01">01</option>
										<option value="02">02</option>
										<option value="03">03</option>
										<option value="04">04</option>
										<option value="05">05</option>
										<option value="06">06</option>
										<option value="07">07</option>
										<option value="08">08</option>
										<option value="09">09</option>
										<option value="10">10</option>
										<option value="11">11</option>
										<option value="12">12</option>
									</select>
								</div>
							</div>
							<div class="col-md-4">
								<div class="pg_mat_input">
									<select id="card_year" name="card_year">
										<?php for ($i=date('Y'); $i <= date('Y')+15; $i++) {  ?>
											<option value="<?php echo($i) ?>"><?php echo($i) ?></option>
										<?php } ?>
									</select>
								</div>
							</div>
							<div class="col-md-4">
								<div class="pg_mat_input">
									<input id="card_cvc" name="card_cvc" type="text" autocomplete="off" placeholder="CVC" maxlength="3" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');">
									<label for="card_cvc">CVC</label>
								</div>
							</div>
						</div>
					</div>
					<div class="clear"></div>
					<input type="text" id="2checkout_type" class="hidden" name="type">
					<input id="card_token" name="token" type="hidden" value="">
					<input id="store_amount" name="store_amount" type="hidden" value="0">
					<input id="store_item_id" name="store_item_id" type="hidden" value="">
					<input id="item_license" name="item_license" type="hidden" value="">
				</div>
				<div class="clear"></div>
				<div class="modal-footer">
					<div class="ball-pulse"><div></div><div></div><div></div></div>
					<button type="button" class="btn btn-main" onclick="tokenRequest()" id="2checkout_btn">{{LANG pay}}</button>
				</div>
			</form>
		</div>
	</div>
</div>

<script>
	<?php if ($config['checkout_payment'] == 'yes') { ?>
		// Called when token created successfully.
		var successCallback = function(data) {
			var myForm = document.getElementById('2checkout_form');
			$.post(link('main/checkout'), {
					card_number: $("#card_number").val(),
					card_cvc: $("#card_cvc").val(),
					card_month: $("#card_month").val(),
					card_year: $("#card_year").val(),
					card_name: $("#card_name").val(),
					card_address: $("#card_address").val(),
					card_city: $("#card_city").val(),
					card_state: $("#card_state").val(),
					card_zip: $("#card_zip").val(),
					card_country: $("#card_country").val(),
					card_email: $("#card_email").val(),
					card_phone: $("#card_phone").val(),
					amount: $('#store_amount').val(),
					id: $('#store_item_id').val(),
					type: 'store',
					item_license: $('#item_license').val(),
					token: data.response.token.token
				}, function(data, textStatus, xhr) {
				$('#2checkout_btn').html("{{LANG pay}}");
				$('#2checkout_btn').attr('disabled');
				$('#2checkout_btn').removeAttr('disabled');
				$('#2checkout_form').find('.ball-pulse').fadeOut(100);
				if (data.status == 200) {
					window.location.href = data.url;
				} else {
					$('#2checkout_alert').html("<div class='alert alert-danger'>"+data.error+"</div>");
					setTimeout(function () {
						$('#2checkout_alert').html("");
					},3000);
				}
				/*optional stuff to do after success */
			});
		};

		// Called when token creation fails.
		var errorCallback = function(data) {
			$('#2checkout_btn').html("{{LANG pay}}");
			$('#2checkout_btn').removeAttr('disabled');
			$('#2checkout_form').find('.ball-pulse').fadeOut(100);
			if (data.errorCode === 200) {
				tokenRequest();
			} else {
				$('#2checkout_alert').html("<div class='alert alert-danger'>"+data.errorMsg+"</div>");
				setTimeout(function () {
					$('#2checkout_alert').html("");
				},3000);
			}
		};

		var tokenRequest = function() {
			$('#card_number').val($('#_number_').val());
			$('#2checkout_btn').html("{{LANG Please wait..}}");
			$('#2checkout_btn').attr('disabled','true');
			if ($("#card_number").val() != '' && $("#card_cvc").val() != '' && $("#card_month").val() != '' && $("#card_year").val() != '' && $("#card_name").val() != '' && $("#card_address").val() != '' && $("#card_city").val() != '' && $("#card_state").val() != '' && $("#card_zip").val() != '' && $("#card_country").val() != 0 && $("#card_email").val() != '' && $("#card_phone").val() != '') {
				$('#2checkout_form').find('.ball-pulse').fadeIn(100);
				// Setup token request arguments
				var args = {
					sellerId: "<?php echo($config['checkout_seller_id']) ?>",
					publishableKey: "<?php echo($config['checkout_publishable_key']) ?>",
					ccNo: $("#card_number").val(),
					cvv: $("#card_cvc").val(),
					expMonth: $("#card_month").val(),
					expYear: $("#card_year").val()
				};
				// Make the token request
				TCO.requestToken(successCallback, errorCallback, args);
			}
			else{
				$('#2checkout_btn').html("{{LANG pay}}");
				$('#2checkout_btn').removeAttr('disabled');
				$('#2checkout_alert').html("<div class='alert alert-danger'>{{LANG Please check the details}}</div>");
				setTimeout(function () {
					$('#2checkout_alert').html("");
				},3000);
			}
		};

		$(function() {
			// Pull in the public encryption key for our environment
			TCO.loadPubKey("<?php echo($config['checkout_mode']) ?>");
		});
	<?php } ?>
	
	$(document).ready(function() {
		$("#upload-image").on('change', function() {
		//Get count of selected files
		var product_countFiles = $(this)[0].files.length;
		var product_imgPath = $(this)[0].value;
		var extn = product_imgPath.substring(product_imgPath.lastIndexOf('.') + 1).toLowerCase();
		var product_image_holder = $("#fake_img_holder");
		product_image_holder.empty();
		if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
			if (typeof(FileReader) != "undefined") {
			//loop for each file selected for uploaded.
			for (var i = 0; i < product_countFiles; i++) 
			{
				var product_reader = new FileReader();
				product_reader.onload = function(e) {
					$("<img />", {
						"src": e.target.result,
						"class": "thumb-image"
					}).appendTo(product_image_holder);
					}
					product_image_holder.show();
					product_reader.readAsDataURL($(this)[0].files[i]);
				}
				} else {
				product_image_holder.html("<p>This browser does not support FileReader.</p>");
				}
			}
		});
	});

	$(document).on('click', '.send_bank', function(event) {
		$(".bank_transfer_form").submit();
	});

	$(".bank_transfer_form").ajaxForm({
		type:'POST',
		dataType:'json',
		url: link('store/bank_transfer'),
		success:function(data){
			if (data.status == 200) {
				$('.bank_alert').html($('<div>',{
                    class:'alert alert-success',
                    text:data.message
                }));
                setTimeout(function(){
	                window.location.href = site_url('');
	            },3000);
			}
			else{
				$('.bank_alert').html($('<div>',{
                    class:'alert alert-danger',
                    text:data.message
                }));

			}
			setTimeout(function(){
                $('.alert-danger').slideUp('fast',function(){
                    $(this).remove(); 
                })    
                 $('.alert-success').slideUp('fast',function(){
                    $(this).remove(); 
                }) 
            },2000);
		}
	});

	function Pxp_GetStorePaymentMethods(type,_amount,_title,_id,_license,obj) {
		$(obj).attr('disabled','true');
		$(obj).text("{{LANG please_wait}}");
		$.post(link('main/get_payment_methods'), {type: type}, function(data, textStatus, xhr) {
			if (data.status == 200) {
				$('.payment_methods_modal').html(data.html);
				$('.payment_methods_modal').find('.btn-paypal').attr('onclick', "Pxp_GetPayPalLink('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-stripe-payment').attr('onclick', "Pxp_StripePayment('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-sms-payment').attr('onclick', "PayViaSms('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-bank-payments').attr('onclick', "Pxpx_BankPayment('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-paystack-payment').attr('onclick', "PayViaPaystack('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-razorpay-payment').attr('onclick', "PayViaRazorpay('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-2checkout-payment').attr('onclick', "PayVia2Checkout('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-cashfree-payment').attr('onclick', "PayViaCashfree('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.payment_methods_modal').find('.btn-iyzipay-payment').attr('onclick', "PayViaIyzipay('" + type + "','" + _amount + "','" + _title + "','" + _id + "','" + _license + "');");
				$('.go_pro--modal').fadeIn(250);
			}
			$(obj).removeAttr('disabled');
			$(obj).text("{{LANG buy}}");
		});
	}
	
	function PayVia2Checkout(type,_amount,_title,_id,_license){
		if (!type || !_amount) {
			return false;
		}

		$('#store_item_id').val(_id);
		$('#store_amount').val(_amount);
		$('#item_license').val(_license);
		$('.btn-2checkout-payment').attr('disabled','true');
		$('#2checkout_modal').modal({
            show: true
        });
		$('.go_pro--modal').fadeOut(250);
		$('.btn-2checkout-payment').removeAttr('disabled');
	}

	function PayViaCashfree(type,_amount,_title,_id,_license){
		if (!type || !_amount) {
			return false;
		}

		$('.btn-cashfree-payment').attr('disabled','true');

		$('#cashfree_type').val('store');
		$('#cashfree_store_item_id').val(_id);
		$('#cashfree_store_amount').val(_amount);
		$('#cashfree_item_license').val(_license);

		$("#cashfree_alert").html('');
		$('.go_pro--modal').fadeOut(250);
		$('#cashfree_modal_box').modal({
			show: true
		});

		$('.btn-2checkout-payment').removeAttr('disabled');
	}

	<?php if ($config['iyzipay_payment'] == "yes" && !empty($config['iyzipay_key']) && !empty($config['iyzipay_secret_key'])) { ?>
	function PayViaIyzipay(type,_amount,_title,_id,_license){
		if (!_amount) {
			return false;
		}

		$('.btn-iyzipay-payment').attr('disabled','true');

		$.post(link('store/iyzipay'), {amount:_amount,title:_title,store_item_id:_id,item_license:_license}, function(data) {
			if (data.status == 200) {
				$('#iyzipay_content').html('');
				$('#iyzipay_content').html(data.html);
			} else {
				$('.btn-iyzipay').attr('disabled', false).html("Iyzipay App not set yet.");
				$.toast("Iyzipay App not set yet.",{
                    duration: 5000,
                    type: 'error',
                    align: 'bottom',
                    singleton: true
                });
			}
			$('.btn-iyzipay').removeAttr('disabled');
			$('.btn-iyzipay').find('span').text("{{LANG iyzipay}}");
		});

		$('.btn-iyzipay-payment').removeAttr('disabled');
	}
	<?php } ?>

	function Pxp_GetPayPalLink(type,_amount,_title,_id,_license) {
		$('.btn-paypal').attr('disabled','true');
		$.post(link('store/get_paypal_link'), {type: type,amount:_amount,title:_title,id:_id,license:_license}, function(data, textStatus, xhr) {
			if (data.status == 200) {
				window.location.href = data.url;
			}
			$('.btn-paypal').removeAttr('disabled');
		});
	}

	function Pxpx_BankPayment(type,_amount,_title,_id,_license) {
		var click_event = "$('#upload-image').trigger('click');";
		$(".images-renderer").html('<div class="select-images" onclick="'+click_event+'"><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-image"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg><h5>{{LANG choose_an_image}}</h5></span></div>');
		$('#configreset').click();
		$('#bank_amount').attr('value',_amount);
		$('#bank_title').attr('value',_title);
		$('#bank_id').attr('value',_id);
		$('#bank_license').attr('value',_license);
		$('.bank_payment--modal').fadeIn(250);
	}

	function PayViaRazorpay(type,_amount,_title,_id,_license) {
		$('.btn-razorpay-payment').attr('disabled','true');
		$.post(link('razorpay/generate_order'), {type: type,amount:_amount,title:_title,id:_id,license:_license}, function(data, textStatus, xhr) {
			if (data.status == 200) {
				if( data.id !== '' ){
					var options = {
						"key": "<?php echo $config['razorpay_key'];?>", // Enter the Key ID generated from the Dashboard
						"amount": _amount * 100,
						"currency": "<?php echo $config['currency'];?>",
						"name": _title,
						"description": "Buy " + _license,
						"image": "{{CONFIG site_url}}/media/img/logo.{{CONFIG logo_extension}}",
						"order_id": data.id, //This is a sample Order ID. Pass the `id` obtained in the response of Step 1
						"handler": function (response){
							$.post(link('razorpay/proccess_payment'), {payment_id:response.razorpay_payment_id,order_id:response.razorpay_order_id,signature:response.razorpay_signature,type:type,amount:_amount,title:_title,id:_id,license:_license}, function (data) {
								if (data.status == 200) {
									window.location.href = data.url;
								} else {
									$('.confirm--modal--body').html('<i class="fa fa-spin fa-spinner"></i> {{LANG payment_declined}}');
								}
							});

						},
						"theme": {
							"color": "#F37254"
						}
					};
					var rzp1 = new Razorpay(options);
					rzp1.open();
				}
			}
			$('.btn-razorpay-payment').removeAttr('disabled');
		});
	}

	
	function PayViaSms(type,_amount,_title,_id,_license){
		$('.btn-sms-payment').attr('disabled','true');
		$.post(link('store/get_sms_link'), {type: type,amount:_amount + '00',title:_title,id:_id,license:_license}, function(data, textStatus, xhr) {
			if (data.status == 200) {
				window.location.href = data.url;
			}
			$('.btn-sms-payment').removeAttr('disabled');
		});
	}

	function PayViaPaystack(type,_amount,_title,_id,_license){
		$('.btn-paystack-payment').attr('disabled','true');
		$.post(link('paystack/create_payment'), {type: type,amount:_amount,title:_title,id:_id,license:_license}, function(data, textStatus, xhr) {
			window.location.href = data.url;
			$('.btn-paystack-payment').removeAttr('disabled');
		});
	}

	function Pxp_StripePayment(type,_amount,_title,_id,_license) {
		$('.btn-cart').attr('disabled','true');
		var handler = StripeCheckout.configure({
	        key: "<?php echo $config['stripe_id'];?>",
	        locale: 'english',
	        image: '',
	        token: function(token) {
	          $('.confirm--modal--body').html('<i class="fa fa-spin fa-spinner"></i> {{LANG c_payment}}');
	          $.post(link('store/stripe_payment'), {stripeToken:token.id,type:type,amount:_amount,title:_title,id:_id,license:_license}, function (data) {
	          	 if (data.status == 200) {
	          	 	window.location.href = data.url;
	          	 } else {
	          	 	$('.confirm--modal--body').html('<i class="fa fa-spin fa-spinner"></i> {{LANG payment_declined}}');
	          	 }
	          });
	        }
	    });

	    handler.open({
           name: "<?php echo $config['site_name']?>",
           description: "Buy " + _title + " : " + _license,
           amount: _amount,
           currency: '<?php echo $config['currency']?>',
           opened: function () {
           	   $('.btn-cart').removeAttr('disabled');
           	   $('.go_pro--modal').fadeOut(250);
           }
        });

	    $(window).on('popstate', function() {
	       handler.close();
	    });
	}

	function Px_delete_story(id){
		$.ajax({
			url: xhr_url()+'store/delete-store-item',
			type: 'GET',
			dataType: 'json',
			data: {post_id:id},
		}).done(function(data) {
			if (data.status == 200) {
				window.location.href = site_url('store');
			}
		});
	}
	function Px_edit_story(id){

	}
	
    <?php if( !isset( $context['post_data']['standalone'] ) ){ ?>
	jQuery(document).ready(function($) {

		var lbox = $(".light__box");

		lbox.find('.lightbox-outer').click(function(event) {
			if ($(event.target).hasClass('lightbox-outer')) {
				$('.light__box').remove();
				$('body').removeClass('scroll_stop');
				window.history.pushState("", "", site_url( 'store' ) );
			}
		});

		$(document).keyup(function(e) {
		    if (e.keyCode == 27) {
		    	$('.light__box').remove();
				$('body').removeClass('scroll_stop');
		    	window.history.pushState("", "", site_url( 'store' ) );
		    }
		});

	});
    <?php } ?>
</script>
<?php if( isset( $context['post_data']['standalone'] ) ){ ?>
<style>
.light__box {z-index: 1;position: relative;}
.light__box .lightbox-ol {display: none;}
.light__box .lightbox-outer .lightbox-inner {box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);}
</style>
<?php } ?>