Jump to content
CharlenePro

Add hook to Quickview for selected categories?

Recommended Posts

Prestashop 1.7.3.4

I want to display custom content after short description in Quick View popup window for products under selected categories.

Here's what I did.
1) Install contentbox module to create custom html content
2) Create a hook 'customtext'
3) Assign contentbox module to hook 'customtext' in Design - Position
4) Insert the hook to file (themes/classic/templates/catalog/_partials/quickview.tpl)

          {block name='product_description_short'}
            <div id="product-description-short" itemprop="description">{$product.description_short nofilter}</div>
          {/block}
          {hook h='customtext'}

Everything looked fine, the custom content displayed after short description in all the Quick View popups.

But I want it to show for products only in categories 3 and 10, so I changed it like this.

          {block name='product_description_short'}
            <div id="product-description-short" itemprop="description">{$product.description_short nofilter}</div>
          {/block}
          {if $category->id == 3}
          {hook h='customtext'}
          {/if}
          {if $category->id == 10}
          {hook h='customtext'}
          {/if}

Then the custom contents didn't show up. Is there anything else I need to change?

I added the same code for product page (themes/classic/templates/catalog/product.tpl), it worked fine with selected categories, but just not working in quick view.

Thanks a lot for any help!

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More