В общем суть такая
имеем
{foreach from=$product_groups key="group_key" item=group name="spg"} {* Group name *} {if !"ULTIMATE"|fn_allowed_for || $product_groups|count > 1} {$group.name} {/if}{* Products list *} {if !"ULTIMATE"|fn_allowed_for || $product_groups|count > 1} <ul class="ty-shipping-options__products"> {foreach from=$group.products item="product"} {if !(($product.is_edp == 'Y' && $product.edp_shipping != 'Y') || $product.free_shipping == 'Y')} <li class="ty-shipping-options__products-item"> {if $product.product} {$product.product nofilter} {else} {$product.product_id|fn_get_product_name} {/if} </li> {/if} {/foreach} </ul> {/if} {* Shippings list *} {if $group.shippings && !$group.all_edp_free_shipping && !$group.all_free_shipping && !$group.free_shipping && !$group.shipping_no_required} {if $display == "select"} <p> <select id="ssr_{$company_id}" name="shipping_ids[{$company_id}]" {if $onchange}onchange="{$onchange}"{/if}> {/if} {foreach from=$group.shippings item="shipping"} {if $cart.chosen_shipping.$group_key == $shipping.shipping_id} {assign var="checked" value="checked=\"checked\""} {assign var="selected" value="selected=\"selected\""} {assign var="strong_begin" value="<strong>"} {assign var="strong_end" value="</strong>"} {else} {assign var="checked" value=""} {assign var="selected" value=""} {assign var="strong_begin" value=""} {assign var="strong_end" value=""} {/if} {if $shipping.delivery_time} {assign var="delivery_time" value="(`$shipping.delivery_time`)"} {else} {assign var="delivery_time" value=""} {/if} {if $shipping.rate} {capture assign="rate"} {include file="common/price.tpl" value=$shipping.rate} {/capture} {if $shipping.inc_tax} {assign var="rate" value="`$rate` ("} {if $shipping.taxed_price && $shipping.taxed_price != $shipping.rate} {capture assign="tax"}{include file="common/price.tpl" value=$shipping.taxed_price class="ty-nowrap"}{/capture} {assign var="rate" value="`$rate` (`$tax` "} {/if} {assign var="inc_tax_lang" value=__('inc_tax')} {assign var="rate" value="`$rate``$inc_tax_lang`)"} {/if} {else} {assign var="rate" value=__("free_shipping")} {/if} {hook name="checkout:shipping_method"} {if $display == "radio"} <div class="tsp-control-group"> <input type="radio" class="tsp-checkbox" id="sh_{$group_key}_{$shipping.shipping_id}" name="shipping_ids[{$group_key}]" value="{$shipping.shipping_id}" onclick="fn_calculate_total_shipping_cost();" {$checked} /> <label for="sh_{$group_key}_{$shipping.shipping_id}" > <span class="tsp-radio-title">{$shipping.shipping} {$delivery_time} - {$rate nofilter}</span> </label> </div> {elseif $display == "select"} <option value="{$shipping.shipping_id}" {$selected}>{$shipping.shipping} {$delivery_time} - {$rate nofilter}</option> {elseif $display == "show"} <p> {$strong_begin}{$rate.name} {$delivery_time} - {$rate nofilter}{$strong_begin} </p> {/if} {/hook} {/foreach} {if $display == "select"} </select> <p> {/if} {else} {if $group.all_free_shipping} <p>{__("free_shipping")}</p> {elseif $group.all_edp_free_shipping || $group.shipping_no_required } <p>{__("no_shipping_required")}</p> {else} <p class="ty-error-text"> {if $display == "show"} <strong>{__("text_no_shipping_methods")}</strong> {else} {__("text_no_shipping_methods")} {/if} </p> {/if} {/if} {foreachelse} <p> {if !$cart.shipping_required} {__("no_shipping_required")} {elseif $cart.free_shipping} {__("free_shipping")} {/if} </p> {/foreach} {if $smarty.foreach.spg.last && !$group.all_edp_free_shipping && !($group.all_free_shipping || $group.free_shipping)} <div class="container-fluid"> <div class="row"> <div class="tsp-order-step__content-foot"> <div class="col-md-2 col-sm-2 col-xs-2"> <div class="tsp-recycle__foot-total-label">{__("total")}:</div> </div> <div class="col-md-8 col-sm-8 col-xs-8"> <div class="tsp-recycle__foot-total-price">{include file="common/price.tpl" value=$cart.display_shipping_cost class="ty-price"}</div> </div> </div> </div> </div> {/if} <!--shipping_rates_list--> </div>
нужно вынести блок
{if $smarty.foreach.spg.last && !$group.all_edp_free_shipping && !($group.all_free_shipping || $group.free_shipping)}{/if}{__("total")}:{include file="common/price.tpl" value=$cart.display_shipping_cost class="ty-price"}за пределы сохранив ajax
То есть имеем а нужно сделать так единственный вариант переписывать JS? или же есть возможность схитрить с помощью smarty?