<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум ReadyScript &mdash; Вывод сохраненных адресов пользователя [Решено]]]></title>
		<link>https://forum.readyscript.ru/topic/874/vyvod-sokhranennykh-adresov-polzovatelya-resheno/</link>
		<atom:link href="https://forum.readyscript.ru/feed/rss/topic/874/" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Вывод сохраненных адресов пользователя [Решено]».]]></description>
		<lastBuildDate>Fri, 09 Dec 2016 13:36:23 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Вывод сохраненных адресов пользователя [Решено]]]></title>
			<link>https://forum.readyscript.ru/post/5528/#p5528</link>
			<description><![CDATA[<p><strong>Закусило Александр, </strong> То что нужно, спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Илья)]]></author>
			<pubDate>Fri, 09 Dec 2016 13:36:23 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5528/#p5528</guid>
		</item>
		<item>
			<title><![CDATA[Re: Вывод сохраненных адресов пользователя [Решено]]]></title>
			<link>https://forum.readyscript.ru/post/5525/#p5525</link>
			<description><![CDATA[<p>Надо воспользоваться конструкцей Smarty <strong>@last</strong> где вы проверяете на checked.<br /></p><div class="codebox"><pre><code>&lt;table id=&quot;address-list&quot;&gt;  
        {if $current_user-&gt;inGroup(&#039;supervisor&#039;)} 
            {$address_list = array_reverse($address_list)}          
            {foreach from=$address_list item=address}
                &lt;tr class=&quot;addressItem&quot;&gt;
                    &lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;use_addr&quot; value=&quot;{$address.id}&quot; id=&quot;adr_{$address.id}&quot; {if $address@last}checked{/if}&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;label for=&quot;adr_{$address.id}&quot;&gt;{$address-&gt;getLineView()}&lt;/label&gt;
                        &lt;a href=&quot;{$router-&gt;getUrl(&#039;shop-front-checkout&#039;, [&#039;Act&#039; =&gt;&#039;deleteAddress&#039;, &#039;id&#039; =&gt; $address.id])}&quot; class=&quot;deleteAddress&quot;/&gt;&amp;times;&lt;/a&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            {/foreach}
            {/if}
            &lt;tr class=&quot;addressItem&quot;&gt;
                &lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;use_addr&quot; value=&quot;0&quot; id=&quot;use_addr_new&quot; {if $order.use_addr == 0}checked{/if}&gt;&lt;/td&gt;
                &lt;td&gt;&lt;label for=&quot;use_addr_new&quot;&gt;Другие данные&lt;/label&gt;&lt;/td&gt;
            &lt;/tr&gt;                
        &lt;/table&gt;</code></pre></div><p><a href="http://www.smarty.net/docs/en/language.function.foreach.tpl#foreach.property.last">http://www.smarty.net/docs/en/language. … perty.last</a></p>]]></description>
			<author><![CDATA[null@example.com (Закусило Александр)]]></author>
			<pubDate>Fri, 09 Dec 2016 07:51:45 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5525/#p5525</guid>
		</item>
		<item>
			<title><![CDATA[Re: Вывод сохраненных адресов пользователя [Решено]]]></title>
			<link>https://forum.readyscript.ru/post/5522/#p5522</link>
			<description><![CDATA[<p>checked ставиться на адрес с первым id, а хотелось бы переделать, что бы checked ставил на последний id, я могу это поправить в шаблоне?<br /></p><div class="codebox"><pre><code>Использовать следующие данные: 
        &lt;table id=&quot;address-list&quot;&gt;  
        {if $current_user-&gt;inGroup(&#039;supervisor&#039;)} 
            {$address_list = array_reverse($address_list)}          
            {foreach from=$address_list item=address}
                &lt;tr class=&quot;addressItem&quot;&gt;
                    &lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;use_addr&quot; value=&quot;{$address.id}&quot; id=&quot;adr_{$address.id}&quot; {if $order.use_addr == $address.id}checked{/if}&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;label for=&quot;adr_{$address.id}&quot;&gt;{$address-&gt;getLineView()}&lt;/label&gt;
                        &lt;a href=&quot;{$router-&gt;getUrl(&#039;shop-front-checkout&#039;, [&#039;Act&#039; =&gt;&#039;deleteAddress&#039;, &#039;id&#039; =&gt; $address.id])}&quot; class=&quot;deleteAddress&quot;/&gt;&amp;times;&lt;/a&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            {/foreach}
            {/if}
            &lt;tr class=&quot;addressItem&quot;&gt;
                &lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;use_addr&quot; value=&quot;0&quot; id=&quot;use_addr_new&quot; {if $order.use_addr == 0}checked{/if}&gt;&lt;/td&gt;
                &lt;td&gt;&lt;label for=&quot;use_addr_new&quot;&gt;Другие данные&lt;/label&gt;&lt;/td&gt;
            &lt;/tr&gt;                
        &lt;/table&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Илья)]]></author>
			<pubDate>Fri, 09 Dec 2016 06:43:45 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5522/#p5522</guid>
		</item>
		<item>
			<title><![CDATA[Re: Вывод сохраненных адресов пользователя [Решено]]]></title>
			<link>https://forum.readyscript.ru/post/4431/#p4431</link>
			<description><![CDATA[<p>Воспользуйтесь функцией array_reverse в шаблоне для списка адресов, это будет самым простым решением.</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Thu, 01 Sep 2016 11:32:41 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/4431/#p4431</guid>
		</item>
		<item>
			<title><![CDATA[Вывод сохраненных адресов пользователя [Решено]]]></title>
			<link>https://forum.readyscript.ru/post/4429/#p4429</link>
			<description><![CDATA[<p>Добрый день. Сейчас сохраненные адреса пользователя выводятся следующим образом<br />Адрес с id 1<br />Адрес с id 2<br />т.е. вывод начинается с первого id, подскажите как это переделать наоборот?<br /><a href="http://itmages.ru/image/view/4818176/872461d8"><span class="postimg"><img src="http://storage3.static.itmages.ru/i/16/0901/s_1472726156_9807491_872461d84f.png" alt="http://storage3.static.itmages.ru/i/16/0901/s_1472726156_9807491_872461d84f.png" /></span></a></p><p><strong>Вывод адресов наоборот</strong></p><p><span class="bbu">Вставить в шаблон </span><br /></p><div class="codebox"><pre><code>{$address_list = array_reverse($address_list)}  </code></pre></div><p><strong>Выбор последнего адреса</strong></p><p><span class="bbu">Заменить</span><br /></p><div class="codebox"><pre><code>&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;use_addr&quot; value=&quot;{$address.id}&quot; id=&quot;adr_{$address.id}&quot; {if $order.use_addr == $address.id}checked{/if}&gt;&lt;/td&gt;</code></pre></div><p><span class="bbu">На это</span><br /></p><div class="codebox"><pre><code>&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;use_addr&quot; value=&quot;{$address.id}&quot; id=&quot;adr_{$address.id}&quot; {if $address@last}checked{/if}&gt;&lt;/td&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Илья)]]></author>
			<pubDate>Thu, 01 Sep 2016 10:35:34 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/4429/#p4429</guid>
		</item>
	</channel>
</rss>
