Jump to content

Add hook to Quickview for selected categories?


CharlenePro

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!

 

 

Link to comment
Share on other sites

  • razaro changed the title to Add hook to Quickview for selected categories?
  • 6 months later...

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...