Opencart版本2.0.3.1,产品页面上的“查看”按钮不工作
我想在我以前的电子商务网站上增加一个评论功能。然而,“写评论”按钮似乎不起作用,它不会把我带到评论页面;似乎是一个断开的链接。我跟踪了opencart的评论,但只有这个bug 我使用的是opencart版本2.0.3.1Opencart版本2.0.3.1,产品页面上的“查看”按钮不工作,opencart,e-commerce,opencart2.x,Opencart,E Commerce,Opencart2.x,我想在我以前的电子商务网站上增加一个评论功能。然而,“写评论”按钮似乎不起作用,它不会把我带到评论页面;似乎是一个断开的链接。我跟踪了opencart的评论,但只有这个bug 我使用的是opencart版本2.0.3.1 我认为,您产品页面上的“查看”选项卡有问题 由于可能的OpenCart经验。“编写审阅”按钮的最佳代码是: <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click')
我认为,您产品页面上的“查看”选项卡有问题 由于可能的OpenCart经验。“编写审阅”按钮的最佳代码是:
<a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); $('html, body').animate({scrollTop: $('ul.nav-tabs').offset().top},'slow'); return false;">Write a review</a>
确保您的
.htaccess
中没有任何http->https重定向,控制台中是否有任何错误?你的商店使用的是什么模板?请告诉我这是否对你有帮助。我不知道代码在哪里,所以我可能会先保留它,因为我这里有一个更重要的问题。你能帮我吗?我以前没有使用opencart,我只想在这里做一些更改,因此如果您能提前帮助我,我非常感谢:请检查问题我有截图问题谢谢我的live站点链接?您知道问题出在哪里吗?为什么评论会被展示出来?
<?php if ($review_status) { ?>
<div id="tab-review" class="tab-content">
<div id="review"></div>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
$('#review').fadeOut('slow');
$('#review').load(this.href);
$('#review').fadeIn('slow');
return false;
});
$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
$('#button-review').bind('click', function() {
$.ajax({
url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
type: 'post',
dataType: 'json',
data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),
beforeSend: function() {
$('.success, .warning').remove();
$('#button-review').attr('disabled', true);
$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
},
complete: function() {
$('#button-review').attr('disabled', false);
$('.attention').remove();
},
success: function(data) {
if (data['error']) {
$('#review-title').after('<div class="warning">' + data['error'] + '</div>');
}
if (data['success']) {
$('#review-title').after('<div class="success">' + data['success'] + '</div>');
$('input[name=\'name\']').val('');
$('textarea[name=\'text\']').val('');
$('input[name=\'rating\']:checked').attr('checked', '');
$('input[name=\'captcha\']').val('');
}
}
});
});
//--></script>
<?php if ($reviews) { ?>
<?php foreach ($reviews as $review) { ?>
<div class="review-list">
<div class="author"><b><?php echo $review['author']; ?></b> <?php echo $text_on; ?> <?php echo $review['date_added']; ?></div>
<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $review['rating'] . '.png'; ?>" alt="<?php echo $review['reviews']; ?>" /></div>
<div class="text"><?php echo $review['text']; ?></div>
</div>
<?php } ?>
<div class="pagination"><?php echo $pagination; ?></div>
<?php } else { ?>
<div class="content"><?php echo $text_no_reviews; ?></div>
<?php } ?>
// HTTP
define('HTTP_SERVER', 'https://yoursite.com/');
// HTTPS
define('HTTPS_SERVER', 'https://yoursite.com/');