我遇到问题,我在magento网站上使用默认主题,并使用此脚本。它仅适用于RWD主题。我试图找到一些关于它的信息,但没有找到任何东西。如果你知道一些东西可以帮助我在默认主题中使用这个脚本,请帮忙。
<div class="block block-subscribe">
<div class="block-title">
<strong><span><?php echo $this->__('Newsletter') ?></span></strong>
</div>
<div id="feedback" style="display:none" class="mini-newsletter">
Thank you for subscribing to our newsletter!
</div>
<form action="<?php echo $this->getFormActionUrl() ?>" name="newsletter-form" id="newsletter-form" method="post">
<div class="block-content">
<div class="form-subscribe-header">
<label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label>
</div>
<div class="input-box">
<input type="text" placeholder="Email address" name="email" id="newsletter" title="<?php echo $this->__('Subscribe to Our Newsletter') ?>" class="required-entry input-subscribe" style="width:178px;" />
<div class="error-news-msg" id="error-news-msg" style="display:none;">Please enter a valid email address.</div>
</div>
<div class="actions">
<button type="button" title="<?php echo $this->__('Subscribe') ?>" onclick="myfunc();" class="button">
<span><span>Subscribe</span></span>
</button>
</div>
</div>
</form>
<script type="text/javascript">
function myfunc()
{
var newsletterSubscriberFormDetail = new VarienForm('newsletter-form');
var form_email = $('newsletter').getValue();
var params_form = $('newsletter-validate-detail');
//alert(params_form);
if(echeck(form_email))
{
//alert(form_email);
//alert(Form.serialize($('newsletter-validate-detail')));
new Ajax.Updater({ success: 'newsletter-form' }, '<?php echo $this->getUrl('newsletter/subscriber/new') ?>', {
asynchronous:true, evalScripts:false,
parameters: { email: form_email },
onComplete:function(request, json){Element.hide('newsletter-form');Element.show('feedback');},
onLoading:function(request, json){Element.hide('news-loader');}
});
}
else
{
//alert(form_email);
return false;
}
}
function echeck(str) {
var at="@";
var dot=".";
var lat=str.indexOf(at);
var lstr=str.length;
var ldot=str.indexOf(dot);
if (str.indexOf(at)==-1){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
if (str.indexOf(at,(lat+1))!=-1){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
if (str.indexOf(dot,(lat+2))==-1){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
if (str.indexOf(" ")!=-1){
//alert("Invalid E-mail ID")
goProcedural();
return false
}
return true
}
function goProcedural()
{
Element.show('error-news-msg');
Element.hide.delay(5, 'error-news-msg');
}
</script>
答案 0 :(得分:-1)
请将管理员配置中的主题包文件夹路径从rwd更改为自定义文件夹名称。您可以通过从管理面板&gt;设置包名称和主题文件夹名称来执行此操作。系统&gt;配置&gt;设计