0

I am using OpenCart. I want to give a link from product_form.tpl to another page. I mean I have added a tab called 'Allocation' in which I have given a button 'Add Allocation' which should redirect an external page. I'd like also to provide the product_id within this link but it's not working properly...

Here is my code (product_form.tpl)

<div id="tab-allocate">
        <table class="list"><tr><td align="center"><a href="allocation.php?product_id=&product_id" target="_blank" class="copybutton" style="width:120px;">ADD ALLOCATION</a></td></tr></table>
        </div>

But allocation.php?product_id=&product_id is not working, it goes to allocate.php page but doesn't carry the product_id. What am I doing wrong?

4

2 回答 2

0

什么乱七八糟的HTML...

将该链接更改为该链接:

<a href="allocation.php?product_id=<?php echo $result['product_id']; ?>" target="_blank" class="copybutton" style="width:120px;">ADD ALLOCATION</a>

这应该有效。并将 CSS 样式放入 CSS 文件 ( catalog/view/themes/<YOUR_THEME>/css/stylesheet.css)。

于 2013-08-15T11:10:16.503 回答
0

我认为,您的传递参数有问题,请尝试这样

<a href="allocation.php?product_id=product_id" target="_blank" class="copybutton" style="width:120px;">

你以前的风格工作传递两个参数。例如 <a href="allocation.php?product_id=product_id&second_id=Second_id" target="_blank" class="copybutton" style="width:120px;">

希望这有帮助

附言。你也可以这样使用 $this->request->post['product_id'] OR $this->request->get['product_id']

于 2013-08-13T03:53:23.723 回答