Jump to content

Setting a Product Flag for a Category


awensveen

Recommended Posts

Hi,

I'm new to prestashop development.
I want to add new product flag for products from a certain category.

The theme I'm using used ApPageBuilder
Below is the listing from the "product_flags.tpl" 

I allready add a new Product Flag "BACK SOON"

I now want to add a new flag for products that are in a specific category.
In pseudo code 

{if $product.CATEGORY ==  <SPECIFIC CATEGORY>}
      <li class="product-flag NEW-FLAG">NEW FLAG</li>
 {/if}

{* 
* @Module Name: AP Page Builder
* @Website: apollotheme.com - prestashop template provider
* @author Apollotheme <[email protected]>
* @copyright Apollotheme
* @description: ApPageBuilder is module help you can build content for your shop
*}
<!-- @file modules\appagebuilder\views\templates\front\products\file_tpl aw -->
{block name='product_flags'}
<ul class="product-flags">
  {foreach from=$product.flags item=flag}
    <li class="product-flag {$flag.type}">{$flag.label}</li>
  {/foreach}
 
 {if $product.quantity_all_versions <= 0}
      <li class="product-flag out-of-stock">BACK SOON</li>
 {/if}
  </ul>
{/block}

But I don't know what parameters I can acces from $PRODUCT.

Help is appreciated.

Best Regards,

Arthur

Link to comment
Share on other sites

  • 6 months later...
  • 1 month 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...