Jump to content

[SOLVED] Hide "Hook Extra Left" on Product page


artofadornment

Recommended Posts

Hi,

I'm using 1.5.3.1 and am hoping to hide my "send to a friend" and "add to wishlist" links on the product page ONLY when the customer is not logged in (so once they log in, they appear). I like how my "add to favorites"  link (favoriteproducts module) already does this, so I'd like that to happen for all three modules.

 

I'm guessing that the quickest and easiest way to do this is to hide the HOOK_EXTRA_LEFT on the product page altogether (instead of editing the blockwishlist and sendtoafriend modules), but I have no idea how. Could someone please lend me a hand?

 

Thanks in advance!

~ Elaine

Edited by artofadornment (see edit history)
Link to comment
Share on other sites

  • 1 month later...

and how you tried to add it?

it's necessary to modify CategoryController.php

I added the

<div><ul id="usefull_link_block">

{$HOOK_EXTRA_LEFT}

  </ul></div>

to the "product-list.tpl" and also tried to add the code for all the files by one by in the folder "sendtoafriend"

 

I am making a web site only for the catalog view I don't want to use the product detail page so I want to add the hook to the list page items.

Edited by boragursel (see edit history)
Link to comment
Share on other sites

add it to smarty array:
 

$this->context->smarty->assign(array(
			'category' => $this->category,
			'products' => (isset($this->cat_products) && $this->cat_products) ? $this->cat_products : null,
			'id_category' => (int)$this->category->id,
			'id_category_parent' => (int)$this->category->id_parent,
			'return_category_name' => Tools::safeOutput($this->category->name),
			'path' => Tools::getPath($this->category->id),
			'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
			'categorySize' => Image::getSize(ImageType::getFormatedName('category')),
			'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
			'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')),
			'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
			'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'),
			'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'),
			'suppliers' => Supplier::getSuppliers()
		));

use the same way as product controller uses:
 

 

$this->context->smarty->assign(array(
                'cmspage' => $cmspage,
'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'),
'customizationFields' => ($this->product->customizable) ? $this->product->getCustomizationFields($this->context->language->id) : false,
'accessories' => $this->product->getAccessories($this->context->language->id),
'return_link' => $return_link,
'product' => $this->product,
'product_manufacturer' => new Manufacturer((int)$this->product->id_manufacturer, $this->context->language->id),
'token' => Tools::getToken(false),
'features' => $this->product->getFrontFeatures($this->context->language->id),
'attachments' => (($this->product->cache_has_attachments) ? $this->product->getAttachments($this->context->language->id) : array()),
'allow_oosp' => $this->product->isAvailableWhenOutOfStock((int)$this->product->out_of_stock),
'last_qties' =>  (int)Configuration::get('PS_LAST_QTIES'),
'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'),
'HOOK_EXTRA_RIGHT' => Hook::exec('displayRightColumnProduct'),
'HOOK_PRODUCT_OOS' => Hook::exec('actionProductOutOfStock', array('product' => $this->product)),
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons', array('product' => $this->product)),
'HOOK_PRODUCT_TAB' =>  Hook::exec('displayProductTab', array('product' => $this->product)),
'HOOK_PRODUCT_TAB_CONTENT' =>  Hook::exec('displayProductTabContent', array('product' => $this->product)),
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
'display_ht' => !Tax::excludeTaxeOption(),
'currencySign' => $this->context->currency->sign,
'currencyRate' => $this->context->currency->conversion_rate,
'currencyFormat' => $this->context->currency->format,
'currencyBlank' => $this->context->currency->blank,
'jqZoomEnabled' => Configuration::get('PS_DISPLAY_JQZOOM'),
'ENT_NOQUOTES' => ENT_NOQUOTES,
'outOfStockAllowed' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK')
));
Link to comment
Share on other sites

Thanks for your generous help, I am about to solve I think. :)
 
The code
'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'), was already there in the ProductConroller.php so I added it to the CategoryController.php.
 
The links came to the page but they dont work. When I click Send to a friend the page refreshes and the links disappear.

post-745023-0-34427100-1388958339_thumb.png

Link to comment
Share on other sites

$this->context->smarty->assign(array(
   'category' => $this->category,
   'description_short' => Tools::truncateString($this->category->description),
   'products' => (isset($this->cat_products) && $this->cat_products) ? $this->cat_products : null,
   'id_category' => (int)$this->category->id,
   'id_category_parent' => (int)$this->category->id_parent,
   'return_category_name' => Tools::safeOutput($this->category->name),
   'path' => Tools::getPath($this->category->id),
   'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
   'categorySize' => Image::getSize(ImageType::getFormatedName('category')),
   'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
   'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')),
   'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
   'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'),
   'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'),
   'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'),
   'suppliers' => Supplier::getSuppliers()
  ));
 }

Link to comment
Share on other sites

hello

 

you have to rebuild these modules because these modules uses also other variables like id_product

it's passed with $product variable, and you haven't got it in product-list tpl file because there is an foreach loop.

Link to comment
Share on other sites

hello

 

you have to rebuild these modules because these modules uses also other variables like id_product

it's passed with $product variable, and you haven't got it in product-list tpl file because there is an foreach loop.

Thanks I got it and will try. I will be in touch if I had a problem. Thanks for your concern.

Link to comment
Share on other sites

The code for products seems as below, the scripts of the module repeats itself and may be it is the problem.

Can this be an impossible or too hard thing to do? If it is I will give up.

 

Thanks again.

 

 

 

<div class="clearfix"></div>

<div class="features" id="features">
<h3 style="color: #444;padding-bottom:10px">Sergi</h3> <h4 style="color: #666; padding-bottom:2px">İstanbul Modern</h4> <a href="http://www.facebook.com/sharer.php?u=http://istanbul:8888/index.php?id_product=11&amp;controller=product&amp;t=Artists’ Film International " class="js-new-window">Share on Facebook!</a>
</div>






<div> <ul id="usefull_link_block">



<li id="favoriteproducts_block_extra_add" class="add">
    Ürünü beğendiklerime ekle
</li>

<li id="favoriteproducts_block_extra_added">
    Bu ürünün beğendiklerim listesinden çıkar
</li>
<li id="favoriteproducts_block_extra_removed">
    Ürünü beğendiklerime ekle
</li><script type="text/javascript">

$('document').ready(function(){
$('#send_friend_button').fancybox({
'hideOnContentClick': false
});

$('#sendEmail').click(function(){

var name = $('#friend_name').val();
var email = $('#friend_email').val();
var id_product = $('#id_product_comment_send').val();
if (name && email && !isNaN(id_product))
{
$.ajax({
url: "/modules/sendtoafriend/sendtoafriend_ajax.php",
type: "POST",
headers: {"cache-control": "no-cache"},
data: {action: 'sendToMyFriend', secure_key: '14651c0d2bfec11a10fa02aa1eefda81', name: name, email: email, id_product: id_product},
dataType: "json",
success: function(result) {
$.fancybox.close();
var msg = result ? "Your e-mail has been sent successfully" : "Your e-mail could not be sent. Please check the e-mail address and try again.";
var title = "Arkadaşıma gönder";
fancyMsgBox(msg, title);
}
});
}
else
$('#send_friend_form_error').text("You did not fill required fields");
});
});


</script>
<li class="sendtofriend">
<a id="send_friend_button" href="#send_friend_form">Arkadaşıma gönder</a>
</li>

<div style="display: none;">
<div id="send_friend_form">
<h2 class="title">Arkadaşıma gönder</h2>
<div class="product clearfix">
<img src="http://istanbul:8888/img/p/0/0-home_default.jpg" alt="" height="" width="">
<div class="product_desc">
<p class="product_name"><strong></strong></p>

</div>
</div>

<div class="send_friend_form_content" id="send_friend_form_content">
<div id="send_friend_form_error"></div>
<div id="send_friend_form_success"></div>
<div class="form_container">
<p class="intro_form">Alıcı: :</p>
<p class="text">
<label for="friend_name">Name of your friend <sup class="required">*</sup> :</label>
<input id="friend_name" name="friend_name" value="" type="text">
</p>
<p class="text">
<label for="friend_email">Arkadaşınızın eposta adresleri <sup class="required">*</sup> :</label>
<input id="friend_email" name="friend_email" value="" type="text">
</p>
<p class="txt_required"><sup class="required">*</sup> Zorunlu alan</p>
</div>
<p class="submit">
<input id="id_product_comment_send" name="id_product" value="" type="hidden">
<a href="#" onclick="$.fancybox.close();">İptal</a>&nbsp;Veya&nbsp;
<input id="sendEmail" class="button" name="sendEmail" value="Gönder" type="submit">
</p>
</div>
</div>
</div>
<li class="print"><a href="javascript:print();">Print</a></li>
</ul></div>




</div>
</li>
<li class="ajax_block_product alternate_item clearfix">



<div class="center_block">

<a href="http://istanbul:8888/index.php?id_product=8&amp;controller=product" class="product_img_link" title="Aşk’a 103 Adım">
<img src="http://istanbul:8888/img/p/3/0/30-home_default.jpg" alt="" height="114" width="124">
<span class="new">Yeni</span> </a>
<h1><a href="http://istanbul:8888/index.php?id_product=8&amp;controller=product" title="Aşk’a 103 Adım">Aşk’a 103 Adım</a></h1>
<div id="desc" class="desc"><p class="product_desc"><a href="http://istanbul:8888/index.php?id_product=8&amp;controller=product" title="Oyun, yeni evli bir çiftin, daha ilk haftadan zedelenen evliliğine ayna tutuyor. Oyun, yeni evli bir çiftin, daha ilk haftadan zedelenen evliliğine ayna tutuyor."></a></p><p><a href="http://istanbul:8888/index.php?id_product=8&amp;controller=product" title="Oyun, yeni evli bir çiftin, daha ilk haftadan zedelenen evliliğine ayna tutuyor. Oyun, yeni evli bir çiftin, daha ilk haftadan zedelenen evliliğine ayna tutuyor.">Oyun, yeni evli bir çiftin, daha ilk haftadan zedelenen evliliğine ayna tutuyor. Oyun, yeni evli bir çiftin, daha ilk haftadan zedelenen evliliğine ayna tutuyor.</a></p><p></p></div>


<div class="clearfix"></div>

<div class="features" id="features">
<h3 style="color: #444;padding-bottom:10px">Tiyatro</h3> <h4 style="color: #666; padding-bottom:2px">Cumartesi</h4> <h4 style="color: #666; padding-bottom:2px">20:30</h4> <h4 style="color: #666; padding-bottom:2px">Profilo Kültür Merkezi</h4> <a href="http://www.facebook.com/sharer.php?u=http://istanbul:8888/index.php?id_product=8&amp;controller=product&amp;t=Aşk’a 103 Adım" class="js-new-window">Share on Facebook!</a>
</div>






<div> <ul id="usefull_link_block">



<li id="favoriteproducts_block_extra_add" class="add">
    Ürünü beğendiklerime ekle
</li>

<li id="favoriteproducts_block_extra_added">
    Bu ürünün beğendiklerim listesinden çıkar
</li>
<li id="favoriteproducts_block_extra_removed">
    Ürünü beğendiklerime ekle
</li><script type="text/javascript">

$('document').ready(function(){
$('#send_friend_button').fancybox({
'hideOnContentClick': false
});

$('#sendEmail').click(function(){

var name = $('#friend_name').val();
var email = $('#friend_email').val();
var id_product = $('#id_product_comment_send').val();
if (name && email && !isNaN(id_product))
{
$.ajax({
url: "/modules/sendtoafriend/sendtoafriend_ajax.php",
type: "POST",
headers: {"cache-control": "no-cache"},
data: {action: 'sendToMyFriend', secure_key: '14651c0d2bfec11a10fa02aa1eefda81', name: name, email: email, id_product: id_product},
dataType: "json",
success: function(result) {
$.fancybox.close();
var msg = result ? "Your e-mail has been sent successfully" : "Your e-mail could not be sent. Please check the e-mail address and try again.";
var title = "Arkadaşıma gönder";
fancyMsgBox(msg, title);
}
});
}
else
$('#send_friend_form_error').text("You did not fill required fields");
});
});


</script>
<li class="sendtofriend">
<a id="send_friend_button" href="#send_friend_form">Arkadaşıma gönder</a>
</li>

<div style="display: none;">
<div id="send_friend_form">
<h2 class="title">Arkadaşıma gönder</h2>
<div class="product clearfix">
<img src="http://istanbul:8888/img/p/0/0-home_default.jpg" alt="" height="" width="">
<div class="product_desc">
<p class="product_name"><strong></strong></p>

</div>
</div>

<div class="send_friend_form_content" id="send_friend_form_content">
<div id="send_friend_form_error"></div>
<div id="send_friend_form_success"></div>
<div class="form_container">
<p class="intro_form">Alıcı: :</p>
<p class="text">
<label for="friend_name">Name of your friend <sup class="required">*</sup> :</label>
<input id="friend_name" name="friend_name" value="" type="text">
</p>
<p class="text">
<label for="friend_email">Arkadaşınızın eposta adresleri <sup class="required">*</sup> :</label>
<input id="friend_email" name="friend_email" value="" type="text">
</p>
<p class="txt_required"><sup class="required">*</sup> Zorunlu alan</p>
</div>
<p class="submit">
<input id="id_product_comment_send" name="id_product" value="" type="hidden">
<a href="#" onclick="$.fancybox.close();">İptal</a>&nbsp;Veya&nbsp;
<input id="sendEmail" class="button" name="sendEmail" value="Gönder" type="submit">
</p>
</div>
</div>
</div>
<li class="print"><a href="javascript:print();">Print</a></li>
</ul></div>




</div>
</li>
<li class="ajax_block_product item clearfix">



<div class="center_block">

<a href="http://istanbul:8888/index.php?id_product=10&amp;controller=product" class="product_img_link" title="Bay Kolpert">
<img src="http://istanbul:8888/img/p/tr-default-home_default.jpg" alt="" height="114" width="124">
<span class="new">Yeni</span> </a>
<h1><a href="http://istanbul:8888/index.php?id_product=10&amp;controller=product" title="Bay Kolpert">Bay Kolpert</a></h1>
<div id="desc" class="desc"><p class="product_desc"><a href="http://istanbul:8888/index.php?id_product=10&amp;controller=product" title="Oyunda tüketim toplumunun doyumsuzluğuyla değişik heyecanlar arayan bir çift konu ediliyor."></a></p><p><a href="http://istanbul:8888/index.php?id_product=10&amp;controller=product" title="Oyunda tüketim toplumunun doyumsuzluğuyla değişik heyecanlar arayan bir çift konu ediliyor.">Oyunda tüketim toplumunun doyumsuzluğuyla değişik heyecanlar arayan bir çift konu ediliyor.</a></p><p></p></div>


<div class="clearfix"></div>

<div class="features" id="features">
<h3 style="color: #444;padding-bottom:10px">Tiyatro</h3> <h4 style="color: #666; padding-bottom:2px">Cumartesi</h4> <h4 style="color: #666; padding-bottom:2px">21:00</h4> <h4 style="color: #666; padding-bottom:2px">Sekizincikat</h4> <a href="http://www.facebook.com/sharer.php?u=http://istanbul:8888/index.php?id_product=10&amp;controller=product&amp;t=Bay Kolpert" class="js-new-window">Share on Facebook!</a>
</div>






<div> <ul id="usefull_link_block">



<li id="favoriteproducts_block_extra_add" class="add">
    Ürünü beğendiklerime ekle
</li>

<li id="favoriteproducts_block_extra_added">
    Bu ürünün beğendiklerim listesinden çıkar
</li>
<li id="favoriteproducts_block_extra_removed">
    Ürünü beğendiklerime ekle
</li><script type="text/javascript">

$('document').ready(function(){
$('#send_friend_button').fancybox({
'hideOnContentClick': false
});

$('#sendEmail').click(function(){

var name = $('#friend_name').val();
var email = $('#friend_email').val();
var id_product = $('#id_product_comment_send').val();
if (name && email && !isNaN(id_product))
{
$.ajax({
url: "/modules/sendtoafriend/sendtoafriend_ajax.php",
type: "POST",
headers: {"cache-control": "no-cache"},
data: {action: 'sendToMyFriend', secure_key: '14651c0d2bfec11a10fa02aa1eefda81', name: name, email: email, id_product: id_product},
dataType: "json",
success: function(result) {
$.fancybox.close();
var msg = result ? "Your e-mail has been sent successfully" : "Your e-mail could not be sent. Please check the e-mail address and try again.";
var title = "Arkadaşıma gönder";
fancyMsgBox(msg, title);
}
});
}
else
$('#send_friend_form_error').text("You did not fill required fields");
});
});


</script>
<li class="sendtofriend">
<a id="send_friend_button" href="#send_friend_form">Arkadaşıma gönder</a>
</li>

<div style="display: none;">
<div id="send_friend_form">
<h2 class="title">Arkadaşıma gönder</h2>
<div class="product clearfix">
<img src="http://istanbul:8888/img/p/0/0-home_default.jpg" alt="" height="" width="">
<div class="product_desc">
<p class="product_name"><strong></strong></p>

</div>
</div>

<div class="send_friend_form_content" id="send_friend_form_content">
<div id="send_friend_form_error"></div>
<div id="send_friend_form_success"></div>
<div class="form_container">
<p class="intro_form">Alıcı: :</p>
<p class="text">
<label for="friend_name">Name of your friend <sup class="required">*</sup> :</label>
<input id="friend_name" name="friend_name" value="" type="text">
</p>
<p class="text">
<label for="friend_email">Arkadaşınızın eposta adresleri <sup class="required">*</sup> :</label>
<input id="friend_email" name="friend_email" value="" type="text">
</p>
<p class="txt_required"><sup class="required">*</sup> Zorunlu alan</p>
</div>
<p class="submit">
<input id="id_product_comment_send" name="id_product" value="" type="hidden">
<a href="#" onclick="$.fancybox.close();">İptal</a>&nbsp;Veya&nbsp;
<input id="sendEmail" class="button" name="sendEmail" value="Gönder" type="submit">
</p>
</div>
</div>
</div>
<li class="print"><a href="javascript:print();">Print</a></li>
</ul></div>




</div>
</li>
<li class="ajax_block_product last_item alternate_item clearfix">



<div class="center_block">

<a href="http://istanbul:8888/index.php?id_product=12&amp;controller=product" class="product_img_link" title="Lorem ipsum">
<img src="http://istanbul:8888/img/p/tr-default-home_default.jpg" alt="" height="114" width="124">
<span class="new">Yeni</span> </a>
<h1><a href="http://istanbul:8888/index.php?id_product=12&amp;controller=product" title="Lorem ipsum">Lorem ipsum</a></h1>
<div id="desc" class="desc"><p class="product_desc"><a href="http://istanbul:8888/index.php?id_product=12&amp;controller=product" title="İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet"></a></p><p><a href="http://istanbul:8888/index.php?id_product=12&amp;controller=product" title="İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet">İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet İyi Geceler Desdemona, Günaydın Juliet</a></p><p></p></div>


<div class="clearfix"></div>

<div class="features" id="features">
<h3 style="color: #444;padding-bottom:10px">Konser</h3> <h4 style="color: #666; padding-bottom:2px">Cumartesi</h4> <h4 style="color: #666; padding-bottom:2px">20:30</h4> <h4 style="color: #666; padding-bottom:2px">bilmemne chjsdfjhksf</h4> <a href="http://www.facebook.com/sharer.php?u=http://istanbul:8888/index.php?id_product=12&amp;controller=product&amp;t=Lorem ipsum" class="js-new-window">Share on Facebook!</a>
</div>






<div> <ul id="usefull_link_block">



<li id="favoriteproducts_block_extra_add" class="add">
    Ürünü beğendiklerime ekle
</li>

<li id="favoriteproducts_block_extra_added">
    Bu ürünün beğendiklerim listesinden çıkar
</li>
<li id="favoriteproducts_block_extra_removed">
    Ürünü beğendiklerime ekle
</li><script type="text/javascript">

$('document').ready(function(){
$('#send_friend_button').fancybox({
'hideOnContentClick': false
});

$('#sendEmail').click(function(){

var name = $('#friend_name').val();
var email = $('#friend_email').val();
var id_product = $('#id_product_comment_send').val();
if (name && email && !isNaN(id_product))
{
$.ajax({
url: "/modules/sendtoafriend/sendtoafriend_ajax.php",
type: "POST",
headers: {"cache-control": "no-cache"},
data: {action: 'sendToMyFriend', secure_key: '14651c0d2bfec11a10fa02aa1eefda81', name: name, email: email, id_product: id_product},
dataType: "json",
success: function(result) {
$.fancybox.close();
var msg = result ? "Your e-mail has been sent successfully" : "Your e-mail could not be sent. Please check the e-mail address and try again.";
var title = "Arkadaşıma gönder";
fancyMsgBox(msg, title);
}
});
}
else
$('#send_friend_form_error').text("You did not fill required fields");
});
});


</script>
<li class="sendtofriend">
<a id="send_friend_button" href="#send_friend_form">Arkadaşıma gönder</a>
</li>

<div style="display: none;">
<div id="send_friend_form">
<h2 class="title">Arkadaşıma gönder</h2>
<div class="product clearfix">
<img src="http://istanbul:8888/img/p/0/0-home_default.jpg" alt="" height="" width="">
<div class="product_desc">
<p class="product_name"><strong></strong></p>

</div>
</div>

<div class="send_friend_form_content" id="send_friend_form_content">
<div id="send_friend_form_error"></div>
<div id="send_friend_form_success"></div>
<div class="form_container">
<p class="intro_form">Alıcı: :</p>
<p class="text">
<label for="friend_name">Name of your friend <sup class="required">*</sup> :</label>
<input id="friend_name" name="friend_name" value="" type="text">
</p>
<p class="text">
<label for="friend_email">Arkadaşınızın eposta adresleri <sup class="required">*</sup> :</label>
<input id="friend_email" name="friend_email" value="" type="text">
</p>
<p class="txt_required"><sup class="required">*</sup> Zorunlu alan</p>
</div>
<p class="submit">
<input id="id_product_comment_send" name="id_product" value="" type="hidden">
<a href="#" onclick="$.fancybox.close();">İptal</a>&nbsp;Veya&nbsp;
<input id="sendEmail" class="button" name="sendEmail" value="Gönder" type="submit">
</p>
</div>
</div>
</div>
<li class="print"><a href="javascript:print();">Print</a></li>
</ul></div>




</div>

Edited by boragursel (see edit history)
Link to comment
Share on other sites

No, unfortunately it doesn't work.

 

 

As I mentioned above message (message with the code)

The code for products seems as above, the scripts of the module repeats itself and may be it is the problem.

Can this be an impossible or too hard thing to do? If it is I will give up.

 

Thanks again.

Link to comment
Share on other sites

  • 4 weeks later...

Hi Vekia,

 

I retired the project for some time, now I am on it again.

Trying to assign the product id to the product list page.

 

I couldn't decide which one is true:

{assign var=id_product value=$smarty.get.id_product|intval}

or

{assign var=id_product value=$product->id|escape:'htmlall':'UTF-8'}

Link to comment
Share on other sites

  • 3 months later...
  • 8 months later...

open module file:

sendtoafriend.php

 

 

below:
 

	public function hookExtraLeft($params)
	{
		/* Product informations */
		$product = new Product((int)Tools::getValue('id_product'), false, $this->context->language->id);
		$image = Product::getCover((int)$product->id);


		$this->context->smarty->assign(array(
			'stf_product' => $product,
			'stf_product_cover' => (int)$product->id.'-'.(int)$image['id_image'],
			'stf_secure_key' => $this->secure_key
		));

		return $this->display(__FILE__, 'sendtoafriend-extra.tpl');
	}

add this code:
 

	public function hookExtraRight($params)
	{
		/* Product informations */
		$product = new Product((int)Tools::getValue('id_product'), false, $this->context->language->id);
		$image = Product::getCover((int)$product->id);


		$this->context->smarty->assign(array(
			'stf_product' => $product,
			'stf_product_cover' => (int)$product->id.'-'.(int)$image['id_image'],
			'stf_secure_key' => $this->secure_key
		));

		return $this->display(__FILE__, 'sendtoafriend-extra.tpl');
	}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...