Jump to content

product customization button


daniele dexter

Recommended Posts

Good morning, I noticed a rather strange anomaly on the products in which I valued the Options > Personalization section of the product sheet.

I inserted labels to show the "Customize" button in the product on the site, but now I notice that they are no longer visible.

I did a test, unchecking the label, then activated again and saved. By doing so, the button appears on the site, but they pointed out to me that for some reason it disappears again after a while.

I saw on the page template that this control is present:

 

{if $product.is_customizable && count($product.customizations.fields)}
                <div class="product-customization-button">
                            {if !$configuration.is_catalog}
                                        <h3 class="action_product_customization" data-toggle="modal" data-target="#moda_product_customization">
                                                         <i class="lar la-edit"></i>
                                                             {l s='Product customization' d='Shop.Theme.Catalog'}
                                        </h3>
                                         <p>( {l s='If you can not add products to your cart, please customize the product!' d='Shop.Theme.Axon'} )</p>
                              {/if}
                   </div>
{/if}

 

I then checked the value of the 2 variables used in the if. When the button is visible they are valued, while when it is not there, the first is empty and the second is at 0. Of course, if he doesn't value them, he won't show them.

I wanted to understand if anyone has encountered this anomaly and managed to fix it in some way.

It doesn't seem to depend on the theme, because this control is present on the default version as well.

 

Thanks in advance for anyone who will help me.

Link to comment
Share on other sites

On 3/7/2023 at 9:01 PM, daniele dexter said:

I then checked the value of the 2 variables used in the if. When the button is visible they are valued, while when it is not there, the first is empty and the second is at 0. Of course, if he doesn't value them, he won't show them.

If you mean : 
$product.is_customizable is 1
count($product.customizations.fields) is 0

, then , see if the product setting (BO > Catalog > Products) has customization field configured properly. Why is it 0 if a customization field is already configured?

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