来自Opencart树枝的信息ID

时间:2018-08-07 11:07:33

标签: opencart

在这种情况下,尝试获取包含信息页的页面ID的页面的完整URL。

在我的header.php控制器文件中,我有:

$data['currentURL'] = $this->url->link($this->request->get['route'], '', 'SSL');

但是当我使用以下命令将其调用到我的树枝文件中时:

{{ currentURL }}

我只能获得1/2的URL:

index.php?route=information/information

而不是:

index.php?route=information/information&information_id=10

我哪里出错了?我该如何解决呢?

谢谢!

1 个答案:

答案 0 :(得分:0)

对,这可以解决问题:

$(document).ready(function() { $(".getAssignment2").click(function() { var pNode = $(this).closest(".modalDialog"), id = pNode.prev(".modalDialog").attr("id") || $('.modalDialog').last().attr("id"); var prevModalResolver = function(id) { var expiry = $('#' + id).data('expiry'); var current_date = new Date(); var div_date = new Date(expiry); if (div_date.getTime() < current_date.getTime()) { let prev_id = $('#' + id).prev(".modalDialog").attr("id"); return prevModalResolver(prev_id); } else { return id; } }; var prev_id = prevModalResolver(id) window.location.href = "#" + prev_id; }); $(".getAssignment").click(function() { var pNode = $(this).closest(".modalDialog"), id = pNode.next(".modalDialog").attr("id") || $('.modalDialog').first().attr("id"); var nextModalResolver = function(id) { var expiry = $('#' + id).data('expiry'); var current_date = new Date(); var div_date = new Date(expiry); if (div_date.getTime() < current_date.getTime()) { let next_id = $('#' + id).next(".modalDialog").attr("id"); return nextModalResolver(next_id); } else { return id; } }; var next_id = nextModalResolver(id) window.location.href = "#" + next_id; }); }); $(function() { var current_date = new Date(); $(".with-expiry").each(function() { var div_date = $(this).data('expiry'); // wrap in Date class div_date = new Date(div_date); if (current_date.getTime() > div_date.getTime()) { $(this).hide(); } else { $(this).show(); } }); })

将其弹出到我的header.php控制器中,然后解决了!谢谢您指出正确的方向!