Skip to content

COMMERCE 4.1.10 - как добавить переход между товарами?

Подскажите, как сделать переход между товарами категории на странице товара?

 

В Downloads это выглядит так:

 

691055fb465b.jpg

И реализовано в шаблоне view просмотра файла так:

 

	{{if $prev || $next}}
	<div class='ipsGrid ipsGrid_collapsePhone ipsPager ipsSpacer_top'>
		{{if $prev !== NULL}}
			<div class="ipsGrid_span6 ipsType_left ipsPager_prev">
				<a href="{$prev->url()}" title="{lang="prev_file"}" rel="prev">
					<span class="ipsPager_type">{lang="prev_file"}</span>
					<span class="ipsPager_title ipsType_light ipsType_break">{wordbreak="$prev->mapped('title')"}</span>
				</a>
			</div>
		{{else}}
			<div class='ipsGrid_span6'> </div>
		{{endif}}
		{{if $next !== NULL}}
			<div class="ipsGrid_span6 ipsType_right ipsPager_next">
				<a href="{$next->url()}" title="{lang="next_file"}" rel="next">
					<span class="ipsPager_type">{lang="next_file"}</span>
					<span class="ipsPager_title ipsType_light ipsType_break">{wordbreak="$next->mapped('title')"}</span>
				</a>
			</div>
		{{else}}
			<div class='ipsGrid_span6'> </div>
		{{endif}}
	</div>
	<hr class='ipsHr'>
{{endif}}

 

Как заставить работать аналогичный код в шаблоне package (просмотр товара в Commerce)?

Featured Replies

Для начала нужно смотреть если в коде предусмотрена реализация переходов между товарами.

  • Author

Не предусмотрена. Можно сделать код для перехода по следующему и предыдущему id товара в категории? Может быть не такой сложный, как дефолтный.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.