Add To Cart Button Stop Working After Insert Of Another Button

Hello guys.

I have inserted into the products_list.tpl file the following code:

    {if $auth.account_type=="S"}
    {$packs = $smarty.session.product_ids_from_pack}
    {$real_products_from_packages = $smarty.session.real_products}
    {foreach from=$packs item=package key=key_pack name="quick_packs"}
    {$product_id = $product.product_id}
    {if $product_id == $real_products_from_packages[$key_pack][0].product_id}
    

{$packs[$key_pack][0].product_code|@print_r:true}

{/if} {/foreach}
                    {$packs = $smarty.session.product_ids_from_pack}
					{$real_products_from_packages = $smarty.session.real_products}
					{foreach from=$packs item=package key=key_pack name="quick_packs"}
						{$product_id = $product.product_id}
						{if $product_id == $real_products_from_packages[$key_pack][0].product_id}
                        {$prod_pack_id = $packs[$key_pack][0].product_id}
                           	<div class="ty-account-info__buttons buttons-container">
		          				<a href="{$config.current_url|fn_url}" data-ca-target-id="{$prod_pack_id}" class="cm-dialog-opener cm-dialog-auto-size ty-btn ty-btn__secondary" rel="nofollow">{__("print_code")}</a>
   								<div id="{$prod_pack_id}" class="hidden" title="{__("print_code")}">
        							<div class="ty-login-popup">

{**** The following line creates the conflict. If I remove it, the add to cart button works perfect! }
{include file=“addons/my_changes/views/my_changes/my_print_quick.tpl” style=“popup” id=“popup$block2.snapping_id”}
{
****************************************************************************************************}



{/if}
{/foreach}
{/if}

What I want to do is to show a unique code under the image of the product, and show a button which button loads my_print_quick.tpl into a popup box, which then prints a pdf.

When this line is inserted, the add to cart button does not respond at all.

If I comment or remove this line, everything works perfect!

I must say here that as you can see, I show this button after an if statement.

And if this statement is not true, the button is not showing and the add to cart button works perfect.

Does anyone know what the reason is that causes this malfunction??

If you want any other explanations please ask me. I am completely stuck.

Thank you very much in advance.

What is the content of this file? Please make sure that it does not contain unclosed html tags

I have attatched the file I am talking about.

As far as I can see, there are no unclosed html tags.

[attachment=12397:products_list_.tpl]

products_list_.tpl

I have attatched the file I am talking about.

As far as I can see, there are no unclosed html tags.

attachicon.gifproducts_list_.tpl

I meant the my_print_quick.tpl file. It also should not contain any forms

It contains forms.

Why it should not contain forms??

This is the content of my_print_quick.tpl file

{__("classroom_print")}


Option1 Option2 Option3

{$prod_id = $prod_pack_id} {$smarty.post.$prod_id} {include file="buttons/button.tpl" but_text=__("print_code") but_name="dispatch[my_changes.my_print.$prod_id]" but_role="select" but_meta="ty-btn__secondary"}

Solved this,

I just opened the form again after my popup using:

{$smarty.capture.$form_open nofilter} 

Everything is working like it should now.

Thanks for helping me! :)

It contains forms.

Why it should not contain forms??

This is the content of my_print_quick.tpl file

Because you cannot use 3rd party form inside default product form.

Because you cannot use 3rd party form inside default product form.

I understand.

But I have just made it ;)