Jump to content

 

add1ctiv3

Member Since 23 Sep 2018
Offline Last Active Sep 05 2019 12:59 PM
-----

Posts I've Made

In Topic: Turn Off Cache Of Perticular Tpl

28 August 2019 - 07:33 PM

Hello, I am also facing the same problem.

 

I have this tpl hook ---> product_multicolumns_list.pre.tpl

 

There I have this code

{nocache}
{if $product && $product.product_id}
{$ribbon = get_products_promo_ribbon($product.product_id)}
{/if}

{if $ribbon && $image_data && $ribbon.is_visible == "Y" && strpos($image_data.absolute_path, "detailed") && !strpos($image_data.absolute_path, "thumbnails") && $image_data.width > $ribbon.container_width}
    <div class="promo_ribbon_container" style="width:{$ribbon.container_width}px; height:{$ribbon.container_width}px;">
        <div class="promo_ribbon" style="background-color:{$ribbon.ribbon_color}; font-size: {$ribbon.ribbon_label_font_size}px;
                width:{$ribbon.ribbon_width}px; height: {$ribbon.ribbon_height}px; left:-{$ribbon.ribbon_left}px;
                top:{$ribbon.ribbon_top}px; ">
            {$ribbon.ribbon_label}
        </div>
    </div>
{/if}
{/nocache}

This will add a ribbon on the top left corner of a product image. When i have automatic cache rebuild enabled its working as intended. But I turn it off the ribbon is shown even if $ribbon.is_visible == "N" which is obviously wrong. You can turn this var to Y and N from the backend control panel of the addon i m developing.

 

Is there a way to exclude this tpl from the cache (nocache is not working), or am I doing something wrong here?


In Topic: wysiwyg editor

01 November 2018 - 08:53 AM

Hello, I realize this is an old thread, but I can not find the answer anywhere else. I need to use a text editor in a backend add on page and while I add the class 'cm-wysiwyg'  to my textarea, nothing seems to happen. I clear the cache of course. When I try to do the same to the orders page for example, it works fine but not in my custom addon page. I believe its a js file not being included but I honestly dont know. Here is my page code for reference.

{capture name="mainbox"}

    {include file="common/subheader.tpl" title="{__("tb_settings_subheader_1")}"}

    <div class="taxydromikh-settings-block-container">

        <div class="taxydromikh-input-container">
            <!-- Username -->
            <label>{__("tb_settings_api_username_label")}</label>
            <input id="tb-api-username-input" class="form-control" type="text" placeholder="{__("tb_settings_api_username_placeholder")}" />
        </div>

        <div class="taxydromikh-input-container">
            <!-- Password -->
            <label>{__("tb_settings_api_password_label")}</label>
            <input id="tb-api-password-input" class="form-control" type="text" placeholder="{__("tb_settings_api_password_placeholder")}" />
        </div>

        <div class="taxydromikh-input-container">
            <!-- App Key -->
            <label>{__("tb_settings_api_key_label")}</label>
            <input  id="tb-api-key-input" class="form-control" type="text" placeholder="{__("tb_settings_api_key_placeholder")}" />
        </div>

    </div>

    <div class="taxydromikh-settings-block-container">

        <div class="taxydromikh-input-container">
            <label>{__("tb_settings_api_mode_label")}</label>
            <div class="tg-list-item">
                <input class="tgl tgl-skewed" id="tb-api-mode-checkbox" type="checkbox"/>
                <label style="width:7em;" title="{__("tb_settings_api_mode_title")}" class="tgl-btn" data-tg-off="{__("tb_settings_api_test_mode_text")}" data-tg-on="{__("tb_settings_api_live_mode_text")}" for="tb-api-mode-checkbox"></label>
            </div>
        </div>

        <div class="taxydromikh-input-container" style="margin-top:13px;">
            <!-- Taxydromiki test Link -->
            <label>{__("tb_settings_api_test_link_label")}</label>
            <input value="http://testvoucher.taxydromiki.gr/JobServices.asmx" id="tb-api-test-url-input" class="form-control" type="text" placeholder="{__("tb_settings_api_test_link_placeholder")}" />
        </div>

        <div class="taxydromikh-input-container">
            <!-- Taxydromiki live Link -->
            <label>{__("tb_settings_api_live_link_label")}</label>
            <input value="https://voucher.taxydromiki.gr/JobServices.asmx" id="tb-api-live-url-input" class="form-control" type="text" placeholder="{__("tb_settings_api_live_link_placeholder")}" />
        </div>

    </div>

    <div class="taxydromikh-settings-block-container">
        <div class="taxydromikh-input-container">
            <!-- Taxydromiki tracking website url -->
            <label>{__("tb_settings_tracking_url_label")}</label>
            <input value="https://www.taxydromiki.com/track" id="tb-tracking-url-input" class="form-control" type="text" placeholder="{__("tb_settings_tracking_url_placeholder")}" />
        </div>
    </div>

    <div class="tb-hr clearfix">&nbsp;</div>

    {include file="common/subheader.tpl" title="{__("tb_settings_subheader_2")}"}

    <div class="taxydromikh-settings-block-container">

        <div class="taxydromikh-input-container">
            <label>{__("tb_settings_close_function_label")}</label>
            <div class="tg-list-item">
                <input checked class="tgl tgl-skewed" id="tb-close-activation" type="checkbox"/>
                <label style="width:6em;" class="tgl-btn" data-tg-off="{__("tb_settings_off_text")}" data-tg-on="{__("tb_settings_on_text")}" for="tb-close-activation"></label>
            </div>
        </div>

    </div>

    <div class="taxydromikh-settings-block-container">

        <div class="taxydromikh-input-container">
            <label>{__("tb_settings_synch_function_label")}</label>
            <div class="tg-list-item">
                <input class="tgl tgl-skewed" id="tb-synch-activation" type="checkbox"/>
                <label style="width:6em;" class="tgl-btn" data-tg-off="{__("tb_settings_off_text")}" data-tg-on="{__("tb_settings_on_text")}" for="tb-synch-activation"></label>
            </div>
        </div>

    </div>

    <div class="tb-hr clearfix">&nbsp;</div>

    {include file="common/subheader.tpl" title="{__("tb_settings_subheader_3")}"}

    
    
    <textarea class="cm-wysiwyg"></textarea>




{/capture}

{capture name="sidebar"}

    <div id="taxydromikh-sidebar-logo-container" class="taxydromikh-float-block sidebar-row">
        <img src="design/backend/media/images/addons/taxydromikh_bridge/geniki.png" />
    </div>

    <hr>

{/capture}

{capture name="adv_buttons"}
    <div class="btn btn-primary">{__("tb_save_settings_button_text")}</div>
{/capture}

{include file="common/mainbox.tpl" title="{__('taxydromikh_bridge')}" content=$smarty.capture.mainbox adv_buttons=$smarty.capture.adv_buttons select_languages=true buttons=$smarty.capture.buttons sidebar=$smarty.capture.sidebar}

{script src="js/addons/taxydromikh_bridge/taxydromikh_bridge_settings.js"}

Could you please point out my mistake? I am currently testing this on version 4.2.4.

 

Thanks in advance


In Topic: Invoice Template Update Not Working

06 October 2018 - 07:45 AM

Hello, I know this is an old post but I d really like your help with this cause i think i ve tried everything so far and its not working.

 

I have created an addon that gives the admin the ability to send an order details to a local carrier in our home country. I am using custom database tables to store these details and i dont temper with shipping mechanism built in cs-cart. Everything is working so far and the order is being sent successfully!

 

I need to modify the email notification sent to the customer when I change the orders status to "Complete". I want to add a line that mentions my carriers tracking number and a link where the customer can go to track it.

 

I first noticed that I need to temper with invoice.tpl so I tried to add this tpl hook:

 

design->themes->responsive->mail->templates->addons->myaddon_name->hooks->orders->invoice.post.tpl

 

The content of this file is this

 

<table cellpadding="0" cellspacing="0" border="0" width="100%" style="direction: {$language_direction};">

    <tr valign="top">

        <td style="font-size: 12px; font-family: Arial;"><strong>Tracking Number:</strong></td>

    </tr>

    <tr valign="top">

        <td><div style="overflow-x: auto; clear: both; width: 510px; height: 100%; padding-bottom: 20px; overflow-y: hidden; font-size: 12px; font-family: Arial;">TEST NUMBER</div></td>

    </tr>

</table>

 

So I try to alter the template with a static value first, so I know that is the right file to hook into. I delete the folder var->cache manually. I change my order status to 'complete'. Email is sent and Nothing happens. My email template (customers email) is exactly the same.

 

I then tried to add this file as well

 

design->backend->mail->templates->addons->myaddon_name->hooks->orders->invoice.post.tpl

 

put in the same content. Deleted cache folder again. Sent another email. NOTHING HAPPENS

 

I tried to pull a wonder my adding this file as well because i spotted this in a forum post

 

var->themes_repository->responsive->mail->templates->addons->myaddon->hooks->orders->invoice.post.tpl

 

NOTHING CHANGED

 

I have a cs-cart 4.7.2 version installation just to develop various addons. I have disabled all other addons just to make sure nothing overrides my invoice template.

 

What else do I freekin need to do?

 

Thanks in advance