first commit
This commit is contained in:
87
modules/aapfree/views/aapfree-extra.tpl
Normal file
87
modules/aapfree/views/aapfree-extra.tpl
Normal file
@@ -0,0 +1,87 @@
|
||||
{*
|
||||
*
|
||||
* PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
|
||||
*
|
||||
* @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/
|
||||
* @copyright 2010-2021 VEKIA
|
||||
* @license This program is not free software and you can't resell and redistribute it
|
||||
*
|
||||
* CONTACT WITH DEVELOPER http://mypresta.eu
|
||||
* support@mypresta.eu
|
||||
*
|
||||
*}
|
||||
<a id="send_aap_button" class="btn btn-primary" href="#send_AAP_form">
|
||||
<i class="material-icons">help_outline</i>{l s='Ask about product' mod='aapfree'}
|
||||
</a>
|
||||
|
||||
<div style="display: none;">
|
||||
<div id="send_AAP_form" class="card">
|
||||
<div class="card-block">
|
||||
<div class="product clearfix col-lg-12">
|
||||
<img src="{$link->getImageLink($aapfree_product->link_rewrite, $aapfree_product_cover, 'home_default')|escape:'html'}" alt="{$aapfree_product->name|escape:html:'UTF-8'}"/>
|
||||
<div class="product_desc">
|
||||
<p class="product_name"><strong>{$aapfree_product->name}</strong></p>
|
||||
{if $aapfree_SUMMARY == true}
|
||||
{$aapfree_product->description_short nofilter}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<fieldset class="form-group">
|
||||
<label class="form-control-label" for="question">{l s='Your question' mod='aapfree'}</label>
|
||||
<textarea name="aapfree_question" id="aapfree_question" class="form-control"></textarea>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="send_AAP_form_content col-lg-6" id="send_AAP_form_content">
|
||||
<div id="send_AAP_form_error" class="alert alert-danger" style="display:none;"></div>
|
||||
<div class="form_container">
|
||||
{if !Context::getContext()->customer->islogged()}
|
||||
<fieldset class="form-group">
|
||||
<label class="form-control-label" for="author">{l s='Your name' mod='aapfree'}</label>
|
||||
<input id="aapfree_author" name="aapfree_author" type="text" value="" class="form-control"/>
|
||||
</fieldset>
|
||||
{else}
|
||||
<fieldset class="form-group">
|
||||
<label class="form-control-label" for="author">{l s='Your name' mod='aapfree'}</label>
|
||||
<input disabled id="aapfree_author" name="aapfree_author" type="text" value="{Context::getContext()->customer->firstname} {Context::getContext()->customer->lastname}" class="form-control disabled"/>
|
||||
<p class="small">({l s='You are logged as a customer, we get your name automatically from your account details' mod='aapfree'})</p>
|
||||
</fieldset>
|
||||
{/if}
|
||||
{if !Context::getContext()->customer->islogged()}
|
||||
<fieldset class="form-group">
|
||||
<label class="form-control-label" for="aapfree_email">{l s='Your email address' mod='aapfree'}</label>
|
||||
<input id="aapfree_email" name="aapfree_email" type="text" value="" class="form-control"/>
|
||||
</fieldset>
|
||||
{else}
|
||||
<fieldset class="form-group">
|
||||
<label class="form-control-label" for="aapfree_email">{l s='Your email address' mod='aapfree'}</label>
|
||||
<input id="aapfree_email" name="aapfree_email" type="text" value="{Context::getContext()->customer->email}" class="form-control"/>
|
||||
</fieldset>
|
||||
{/if}
|
||||
<fieldset class="form-group">
|
||||
<label class="form-control-label" for="author">{l s='Phone number' mod='aapfree'}</label>
|
||||
<input id="aapfree_phone" name="aapfree_phone" type="text" value="" class="form-control"/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 send_AAP_form_content_button">
|
||||
<p class="submit pull-right">
|
||||
{if $aapfree_GDPR == 1}
|
||||
{literal}
|
||||
<input onchange="if($(this).is(':checked')){$('#sendAAPEmail').removeClass('gdpr_disabled'); $('#sendAAPEmail').removeAttr('disabled'); $('#sendAAPEmail').click(function(){aapfreeEmail();});}else{$('#sendAAPEmail').addClass('gdpr_disabled'); $('#sendAAPEmail').off('click'); $('#sendAAPEmail').attr('disabled', 1); }"
|
||||
id="gdpr_checkbox" type="checkbox">
|
||||
{/literal}
|
||||
{l s='I accept ' mod='aapfree'}
|
||||
<a target="_blank"
|
||||
href="{$link->getCmsLink($aapfree_GDPRCMS)}">{l s='privacy policy' mod='aapfree'}</a>
|
||||
{l s='rules' mod='aapfree'}
|
||||
{/if}
|
||||
<input {if $aapfree_GDPR == 1}disabled{/if} id="sendAAPEmail" class="btn btn-primary {if $aapfree_GDPR == 1}gdpr_disabled{/if}" name="sendAAPEmail" type="submit" value="{l s='Send' mod='aapfree'}"/>
|
||||
<input id="id_product_send" name="id_product" type="hidden" value="{$aapfree_product->id}"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
47
modules/aapfree/views/aapfree.css
Normal file
47
modules/aapfree/views/aapfree.css
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
|
||||
*
|
||||
* @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/
|
||||
* @copyright 2010-2021 VEKIA
|
||||
* @license This program is not free software and you can't resell and redistribute it
|
||||
*
|
||||
* CONTACT WITH DEVELOPER http://mypresta.eu
|
||||
* support@mypresta.eu
|
||||
*/
|
||||
|
||||
#send_AAP_form {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
#send_AAP_form .product {
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #cecece;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#send_AAP_form .pull-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#send_AAP_form #gdpr_checkbox {
|
||||
height: auto !important;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
#send_AAP_form .gdpr_disabled {
|
||||
opacity: .5;
|
||||
background: silver !important;
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
#send_AAP_form textarea {
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
.send_AAP_form_content_button {
|
||||
border-top: 1px solid #cecece;
|
||||
padding-top:20px;
|
||||
margin-top:20px;
|
||||
display:block;
|
||||
clear:both;
|
||||
}
|
||||
70
modules/aapfree/views/aapfree.js
Normal file
70
modules/aapfree/views/aapfree.js
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
|
||||
*
|
||||
* @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/
|
||||
* @copyright 2010-2021 VEKIA
|
||||
* @license This program is not free software and you can't resell and redistribute it
|
||||
*
|
||||
* CONTACT WITH DEVELOPER http://mypresta.eu
|
||||
* support@mypresta.eu
|
||||
*/
|
||||
|
||||
$('document').ready(function () {
|
||||
$('#send_aap_button').fancybox({
|
||||
'hideOnContentClick': false
|
||||
});
|
||||
|
||||
if (aapfree_aapfree_GDPR != 1) {
|
||||
$('#sendAAPEmail').click(function () {
|
||||
aapfreeEmail();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function aapfreeEmail() {
|
||||
var author = $('#aapfree_author').val();
|
||||
var email = $('#aapfree_email').val();
|
||||
var phone = $('#aapfree_phone').val();
|
||||
var question = $('#aapfree_question').val();
|
||||
var id_product = $('#id_product_send').val();
|
||||
if (email && !isNaN(id_product)) {
|
||||
$.ajax({
|
||||
url: aapfree_frontcontroller+'&'+$('#add-to-cart-or-refresh').serialize(),
|
||||
type: "POST",
|
||||
headers: {"cache-control": "no-cache"},
|
||||
data: {
|
||||
action: 'sendQuestion',
|
||||
secure_key: aapfree_secureKey,
|
||||
author: author,
|
||||
phone: phone,
|
||||
question: question,
|
||||
id_lang: aapfree_id_lang,
|
||||
email: email,
|
||||
id_product: id_product
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
$.fancybox.close();
|
||||
var msg = result ? aapfree_confirmation : aapfree_problem;
|
||||
var title = aapfree_title;
|
||||
fancyMsgBoxaapfree(msg, title);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#send_AAP_form_error').show().text(aapfree_missingFields);
|
||||
}
|
||||
}
|
||||
|
||||
function fancyMsgBoxaapfree(msg, title) {
|
||||
if (title) msg = "<h2 style=\"padding-bottom:10px;\">" + title + "</h2><p>" + msg + "</p>";
|
||||
msg += "<br/><p class=\"submit\" style=\"text-align:right; padding-bottom: 0\"><input class=\" btn btn-primary\" type=\"button\" value=\"OK\" onclick=\"$.fancybox.close();\" /></p>";
|
||||
$.fancybox(msg, {
|
||||
'autoDimensions': false,
|
||||
'width': 500,
|
||||
'height': 'auto',
|
||||
'transitionIn': 'none',
|
||||
'transitionOut': 'none'
|
||||
});
|
||||
}
|
||||
|
||||
35
modules/aapfree/views/index.php
Normal file
35
modules/aapfree/views/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
Reference in New Issue
Block a user