Promotion Page Correction

Promotion page correction

The campaigns page is left too shallow.

It would be nice to be added to the next update.

Tested.

1 - There is no campaign search. (Name, Status, Type)

2 - An information about when they will end would be sufficient.

\app\functions\fn.promotions.php (add line)

$sorting = db_sort($params, $sortings, 'name', 'desc');

below this line

	if (AREA == 'A') {
		if (!empty($params['name'])) {
			$condition .= db_quote(' AND ?:promotion_descriptions.name LIKE ?l', '%' . trim($params['name']) . '%');
		}
	if (!empty($params['status'])) {
		$condition .= db_quote(' AND ?:promotions.status = ?s', $params['status']);
	}
	
	if (!empty($params['zone'])) {
		$condition .= db_quote(' AND ?:promotions.zone = ?s', $params['zone']);
	}
}

\design\backend\templates\views\promotions\manage.tpl (change)

{capture name="mainbox"}


{include file="common/pagination.tpl" save_current_page=true save_current_url=true}

{assign var=“c_url” value=$config.current_url|fn_query_remove:“sort_by”:“sort_order”}

{assign var=“c_icon” value=“<i class="icon-$search.sort_order_rev">”}
{assign var=“c_dummy” value=“<i class="icon-dummy">”}

{if $promotions}

    {hook name="promotions:manage_header"}{/hook}

    <th width="10%" class="mobile-hide">&nbsp;</th>
    <th width="10%" class="right"><a class="cm-ajax" href="{"`$c_url`&sort_by=status&sort_order=`$search.sort_order_rev`"|fn_url}" data-ca-target-id="pagination_contents">{__("status")}{if $search.sort_by == "status"}{$c_icon nofilter}{else}{$c_dummy nofilter}{/if}</a></th>
</tr>
</thead>

{foreach from=$promotions item=promotion}

    {assign var="allow_save" value=$promotion|fn_allow_save_object:"promotions"}

    {if $allow_save}
        {assign var="link_text" value=__("edit")}
        {assign var="additional_class" value="cm-no-hide-input"}
        {assign var="status_display" value=""}
    {else}
        {assign var="link_text" value=__("view")}
        {assign var="additional_class" value="cm-hide-inputs"}
        {assign var="status_display" value="text"}
    {/if}

<tr class="cm-row-status-{$promotion.status|lower} {$additional_class}">
    <td class="mobile-hide">
        <input name="promotion_ids[]" type="checkbox" value="{$promotion.promotion_id}" class="cm-item" /></td>
    <td data-th="{__("name")}">
        <a class="row-status" href="{"promotions.update?promotion_id=`$promotion.promotion_id`"|fn_url}">{$promotion.name}</a>
        {include file="views/companies/components/company_name.tpl" object=$promotion}
		
	<td data-th="Sontarih">
	{assign var="tarihci" value=$promotion.to_date-$smarty.now}
	{assign var="tarihci1" value=$tarihci/3600}
	{assign var="tarihci0" value=$tarihci1/60}
	{assign var="tarihci2" value=$tarihci1/24}
	{if $promotion.to_date}
	{$promotion.to_date|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}
	{if $promotion.to_date > $smarty.now}<br><b>{$tarihci2|number_format:0}</b> Gün <b>{$tarihci1|number_format:1}</b> Saat {else}<br><b>B İ T T İ</b>{/if}
	
	{else}--.--.----{/if}
	
	
	
	
	</td>
		
    <td class="center mobile-hide" data-th="{__("priority")}">
        <span>{$promotion.priority}</span>
    </td>
    <td class="mobile-hide" data-th="{__("zone")}">
        <span class="row-status">{__($promotion.zone)}</span>
    </td>

    {hook name="promotions:manage_data"}{/hook}

    <td class="right mobile-hide">
        <div class="hidden-tools">
        {capture name="tools_list"}
            {hook name="promotions:list_extra_links"}
            <li>{btn type="list" text=$link_text href="promotions.update?promotion_id=`$promotion.promotion_id`"}</li>
            {if $allow_save}
                <li>{btn type="list" text=__("delete") class="cm-confirm" href="promotions.delete?promotion_id=`$promotion.promotion_id`" method="POST"}</li>
            {/if}
            {/hook}
        {/capture}
        {dropdown content=$smarty.capture.tools_list}
        </div>
    </td>
    <td class="nowrap right" data-th="{__("status")}">
        {include file="common/select_popup.tpl" popup_additional_class="dropleft" display=$status_display id=$promotion.promotion_id status=$promotion.status hidden=true object_id_name="promotion_id" table="promotions"}
    </td>
</tr>
{/foreach}
</table>
{else}

{__("no_data")}

{/if}

{include file=“common/pagination.tpl”}

{capture name=“buttons”}
{capture name=“tools_list”}
{hook name=“promotions:manage_tools_list”}
{if $promotions}

  • {btn type=“delete_selected” dispatch=“dispatch[promotions.m_delete]” form=“promotion_form”}

  • {/if}
    {/hook}
    {/capture}
    {dropdown content=$smarty.capture.tools_list class=“mobile-hide”}
    {/capture}

    {capture name=“adv_buttons”}
    {capture name=“tools_list”}

  • {btn type=“list” text=(“add_catalog_promotion”) href=“promotions.add?zone=catalog”}

  • {btn type=“list” text=(“add_cart_promotion”) href=“promotions.add?zone=cart”}

  • {/capture}
    {dropdown content=$smarty.capture.tools_list icon=“icon-plus” no_caret=true placement=“right”}
    {** Hook for the actions menu on the products manage page *}
    {/capture}

    {/capture}

    {capture name=“sidebar”}
    {hook name=“promotions:manage_sidebar”}
    {include file=“common/saved_search.tpl” dispatch=“promotions.manage” view_type=“users”}
    {include file=“views/promotions/components/promotions_search_form.tpl” dispatch=“promotions.manage”}
    {/hook}
    {/capture}

    {include file=“common/mainbox.tpl” title=__(“promotions”) content=$smarty.capture.mainbox sidebar=$smarty.capture.sidebar adv_buttons=$smarty.capture.adv_buttons buttons=$smarty.capture.buttons content_id=“manage_promotions”}

    \design\backend\templates\views\promotions\components\promotions_search_form.tpl (add creat)

    {if $in_popup}
        
    {else}
    {__("search")}
    {/if}
    {if $smarty.request.redirect_url}
        <input type="hidden" name="redirect_url" value="{$smarty.request.redirect_url}" />
    {/if}
    
    {if $selected_section != ""}
        <input type="hidden" id="selected_section" name="selected_section" value="{$selected_section}" />
    {/if}
    
    {if $put_request_vars}
        {array_to_fields data=$smarty.request skip=["callback"]}
    {/if}
    
    {$extra nofilter}
    
    {capture name="simple_search"}
        <div class="sidebar-field">
            <label for="elm_name">{__("promotion")}</label>
            <div class="break">
                <input type="text" name="name" id="elm_name" value="{$search.name}" />
            </div>
        </div>
    
    
         <div class="sidebar-field">
            <label for="elm_type">{__("type")}</label>
            <div class="controls">
                <select name="zone" id="elm_type">
                    <option value="">{__("all")}</option>
                    <option {if $search.zone == "cart"}selected="selected"{/if} value="cart">Sepet</option>
                    <option {if $search.zone == "catalog"}selected="selected"{/if} value="catalog">Katalog</option>
                </select>
            </div>
        </div>
    
    
    
        <div class="sidebar-field">
            <label for="elm_type">{__("status")}</label>
            {assign var="items_status" value=""|fn_get_default_statuses:true}
            <div class="controls">
                <select name="status" id="elm_type">
                    <option value="">{__("all")}</option>
                    {foreach from=$items_status key=key item=status}
                        <option value="{$key}" {if $search.status == $key}selected="selected"{/if}>{$status}</option>
                    {/foreach}
                </select>
            </div>
        </div>
    {/capture}
    
    {include file="common/advanced_search.tpl" no_adv_link=true simple_search=$smarty.capture.simple_search dispatch=$dispatch view_type="promotions"}
    

    {if $in_popup}


    {else}


    {/if}

    {include file="common/check_items.tpl"} {__("name")}{if $search.sort_by == "name"}{$c_icon nofilter}{else}{$c_dummy nofilter}{/if} Kampanya Tarih {__("priority")}{if $search.sort_by == "priority"}{$c_icon nofilter}{else}{$c_dummy nofilter}{/if} {__("zone")}{if $search.sort_by == "zone"}{$c_icon nofilter}{else}{$c_dummy nofilter}{/if}