Jump to content


Photo

Exclude combinations table from selected product pages in prestashop


  • Please log in to reply
1 reply to this topic

#1 ForzaJuve

ForzaJuve

    Member

  • Members
  • PipPip
  • 11 posts

Posted 07 November 2017 - 09:16 AM

Good morning,
 
I have your module, one of my product has about 15 combinations and it makes a long table. 
I would like to make an exception for this product and that the table wouldn't be displayed. 
So it would be an exception only for this product. 
With your module it is possible to make exceptions but it is the opposite :  I just want to enter the number of the product without table (because all the other product must display the table and they are > 2000). 
 
Is there an easy way to make this exception ?
 
Best regards,


looking for the best presta addons with outstanding support? check this: PrestaShop Modules

#2 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 07 November 2017 - 09:17 AM

Hello
by default it does not have this kind of feature.
but it is possible to alter the default feature "priduct restrictions". You can enable it, define the product where you dont want to display combinations table.

then it is necessary to modify module tpl file:
modules/combinationstab/views/templates/hook/productfooter.tpl

there is a code:

{if $ctp_pr==1}
{if Tools::getValue('id_product','false') != 'false' && $page_name == 'product'}
{if !in_array(Tools::getValue('id_product'), $ctp_pr_ids)}
{assign var='hideblock' value=1}
{/if}
{/if}
{/if}

change it to:

{if $ctp_pr==1}
{if Tools::getValue('id_product','false') != 'false' && $page_name == 'product'}
{if in_array(Tools::getValue('id_product'), $ctp_pr_ids)}
{assign var='hideblock' value=1}
{/if}
{/if}
{/if}

feature will work in an opposite way then - module will hide product on selected product pages.


free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png