Jump to content

problem with some coding in prestashop 8.1


foxnetwork

Recommended Posts

I just need a little help to hide some info in a theme tpl file 

I have made a module with hook to add some data to my themes /templates/catalog/_partials/product-add-to-cart.tpl  I inserted hook in tpl file as below     {hook h="displaycustomhook"}  and all show up ok

 

I have a button in module to show or not show which is in configuration file  has value of 0 or 1  what I am trying to do is not display the area under the hook when the value is 1 or turned on and display it when value is 0 turned off but I have tried different if statements in the tpl file and nothing works. I don't know whether this has to be done in the module or not. I don't know whether I have to read the configuration file from the tpl file or from the model and pass the value somehow to the tpl file. As you can tell not real experienced. 

Any help appreciated

 

  <div class="product-quantity">
        <div class="qty">
          <input
            type="text"
            name="qty"
            id="quantity_wanted"
            value="{$product.quantity_wanted|escape:'html':'UTF-8'}"
            class="input-group"
            {*min="{$product.minimal_quantity|escape:'html':'UTF-8'}"*}
          />
        </div>
        
        {hook h="displaycustomhook"}
         

 

<button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" {if !$product.add_to_cart_url || $product.quantity_wanted>$product.quantity}disabled{/if}>
            {*<i class="material-icons shopping-cart">&#xE547;</i>*}
            <i class="fa fa-shopping-cart"></i>
            {if isset($tc_config.YBC_TC_LABEL_CART) && $tc_config.YBC_TC_LABEL_CART}
                 {$tc_config.YBC_TC_LABEL_CART|escape:'html':'UTF-8'}
            {else}
                {l s='Add to cart' d='Shop.Theme.Actions'}
            {/if}
          </button>

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