Prestashop 1.7 Hook admin product does not display
up vote
0
down vote
favorite
I have a module on Prestashop that works on versions 1.6 and 1.7.
In version 1.6, I managed to display an additional field on the product sheet in the bacok office. I wish to do the same for version 1.7, but without success for now ...
I try with the displayAdminProductsMainStepLeftColumnMiddle hook
my controller of the module:
public function displayAdminProductsMainStepLeftColumnMiddle($params) {
$product = new Product($params['id_product']);
$this->context->smarty->assign(array(
'id_product_jshop' => $product->id_product_jshop
)
);
return $this->display(__FILE__, '/views/templates/1.7/admin/jshop.tpl');
The recording of the hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
and my view:
<div class="m-b-1 m-t-1">
<h2>{l s='Custom Attribute from module' mod='jshopimport'}</h2>
<fieldset class="form-group">
<div class="col-lg-12 col-xl-4">
<label class="form-control-label">{l s='ID JSHOP' mod='jshopimport'}</label>
<input type="text" name="id_product_jshop" class="form-control" {if $id_product_jshop && $id_product_jshop != ''}value="{$id_product_jshop}"{/if}/>
</div>
</fieldset>
<div class="clearfix"></div>
</div>
Have you an idea what is wrong?
hook prestashop-1.7
add a comment |
up vote
0
down vote
favorite
I have a module on Prestashop that works on versions 1.6 and 1.7.
In version 1.6, I managed to display an additional field on the product sheet in the bacok office. I wish to do the same for version 1.7, but without success for now ...
I try with the displayAdminProductsMainStepLeftColumnMiddle hook
my controller of the module:
public function displayAdminProductsMainStepLeftColumnMiddle($params) {
$product = new Product($params['id_product']);
$this->context->smarty->assign(array(
'id_product_jshop' => $product->id_product_jshop
)
);
return $this->display(__FILE__, '/views/templates/1.7/admin/jshop.tpl');
The recording of the hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
and my view:
<div class="m-b-1 m-t-1">
<h2>{l s='Custom Attribute from module' mod='jshopimport'}</h2>
<fieldset class="form-group">
<div class="col-lg-12 col-xl-4">
<label class="form-control-label">{l s='ID JSHOP' mod='jshopimport'}</label>
<input type="text" name="id_product_jshop" class="form-control" {if $id_product_jshop && $id_product_jshop != ''}value="{$id_product_jshop}"{/if}/>
</div>
</fieldset>
<div class="clearfix"></div>
</div>
Have you an idea what is wrong?
hook prestashop-1.7
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a module on Prestashop that works on versions 1.6 and 1.7.
In version 1.6, I managed to display an additional field on the product sheet in the bacok office. I wish to do the same for version 1.7, but without success for now ...
I try with the displayAdminProductsMainStepLeftColumnMiddle hook
my controller of the module:
public function displayAdminProductsMainStepLeftColumnMiddle($params) {
$product = new Product($params['id_product']);
$this->context->smarty->assign(array(
'id_product_jshop' => $product->id_product_jshop
)
);
return $this->display(__FILE__, '/views/templates/1.7/admin/jshop.tpl');
The recording of the hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
and my view:
<div class="m-b-1 m-t-1">
<h2>{l s='Custom Attribute from module' mod='jshopimport'}</h2>
<fieldset class="form-group">
<div class="col-lg-12 col-xl-4">
<label class="form-control-label">{l s='ID JSHOP' mod='jshopimport'}</label>
<input type="text" name="id_product_jshop" class="form-control" {if $id_product_jshop && $id_product_jshop != ''}value="{$id_product_jshop}"{/if}/>
</div>
</fieldset>
<div class="clearfix"></div>
</div>
Have you an idea what is wrong?
hook prestashop-1.7
I have a module on Prestashop that works on versions 1.6 and 1.7.
In version 1.6, I managed to display an additional field on the product sheet in the bacok office. I wish to do the same for version 1.7, but without success for now ...
I try with the displayAdminProductsMainStepLeftColumnMiddle hook
my controller of the module:
public function displayAdminProductsMainStepLeftColumnMiddle($params) {
$product = new Product($params['id_product']);
$this->context->smarty->assign(array(
'id_product_jshop' => $product->id_product_jshop
)
);
return $this->display(__FILE__, '/views/templates/1.7/admin/jshop.tpl');
The recording of the hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
and my view:
<div class="m-b-1 m-t-1">
<h2>{l s='Custom Attribute from module' mod='jshopimport'}</h2>
<fieldset class="form-group">
<div class="col-lg-12 col-xl-4">
<label class="form-control-label">{l s='ID JSHOP' mod='jshopimport'}</label>
<input type="text" name="id_product_jshop" class="form-control" {if $id_product_jshop && $id_product_jshop != ''}value="{$id_product_jshop}"{/if}/>
</div>
</fieldset>
<div class="clearfix"></div>
</div>
Have you an idea what is wrong?
hook prestashop-1.7
hook prestashop-1.7
asked Nov 19 at 16:46
user1450740
90112
90112
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
The function must to start with "hook" and
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
and then you registering without hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
add a comment |
up vote
0
down vote
accepted
For information, I found my error.
Before I was done in my install function :
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle'));
return parent::install();
With this solution, the hook was nor registered !!
The goot practice is :
if (!parent::install()
|| !$this->registerHook('displayAdminProductsExtra')
|| !$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle')) {
return false;
}
It is important to do first
parent::install()
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The function must to start with "hook" and
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
and then you registering without hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
add a comment |
up vote
0
down vote
The function must to start with "hook" and
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
and then you registering without hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
add a comment |
up vote
0
down vote
up vote
0
down vote
The function must to start with "hook" and
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
and then you registering without hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
The function must to start with "hook" and
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
and then you registering without hook
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle');
answered Nov 23 at 12:48
Gabriele Carbonai
18713
18713
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
add a comment |
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
Yes I try this and it does not work yet
– user1450740
Nov 23 at 13:20
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
after that, try to go in your module page and reset it
– Gabriele Carbonai
Nov 23 at 13:42
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
I uninstall my module, and install it again.. it does not work..
– user1450740
Nov 23 at 14:01
add a comment |
up vote
0
down vote
accepted
For information, I found my error.
Before I was done in my install function :
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle'));
return parent::install();
With this solution, the hook was nor registered !!
The goot practice is :
if (!parent::install()
|| !$this->registerHook('displayAdminProductsExtra')
|| !$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle')) {
return false;
}
It is important to do first
parent::install()
add a comment |
up vote
0
down vote
accepted
For information, I found my error.
Before I was done in my install function :
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle'));
return parent::install();
With this solution, the hook was nor registered !!
The goot practice is :
if (!parent::install()
|| !$this->registerHook('displayAdminProductsExtra')
|| !$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle')) {
return false;
}
It is important to do first
parent::install()
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
For information, I found my error.
Before I was done in my install function :
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle'));
return parent::install();
With this solution, the hook was nor registered !!
The goot practice is :
if (!parent::install()
|| !$this->registerHook('displayAdminProductsExtra')
|| !$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle')) {
return false;
}
It is important to do first
parent::install()
For information, I found my error.
Before I was done in my install function :
$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle'));
return parent::install();
With this solution, the hook was nor registered !!
The goot practice is :
if (!parent::install()
|| !$this->registerHook('displayAdminProductsExtra')
|| !$this->registerHook('displayAdminProductsMainStepLeftColumnMiddle')) {
return false;
}
It is important to do first
parent::install()
answered 2 days ago
user1450740
90112
90112
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379194%2fprestashop-1-7-hook-admin-product-does-not-display%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown