Miva Merchant Modules and Development
Want to start an online store? We work with you from start to finish, from commerce platform to design to SEO.
Experience counts, and we have a lot.

SMT: Previous / Next Product Arrows/Links

Scot Ranney • December 22, 2023


<mvt:comment>
#
# previous and next product arrows,  mostly for SEO or old style ui
#
</mvt:comment>

<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Next(l.settings:product, l.settings:next_product)" />

<mvt:while expr="l.settings:next_product:active EQ 0 AND l.settings:next_product">
	<mvt:assign name="l.settings:next_product_temp" value="l.settings:next_product" />
	<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Next(l.settings:next_product_temp, l.settings:next_product)" />
</mvt:while>

<mvt:if expr="l.settings:next_product:active EQ 0">
	<mvt:assign name="l.settigns:next_product" value="''" />
</mvt:if>

<mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Product_Canonical(l.settings:next_product:id, l.settings:next_uri)" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Previous(l.settings:product, l.settings:prev_product)" />

<mvt:while expr="l.settings:prev_product:active EQ 0 AND l.settings:prev_product">
	<mvt:assign name="l.settings:prev_product_temp" value="l.settings:prev_product" />
	<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Previous(l.settings:prev_product_temp, l.settings:prev_product)" />
</mvt:while>

<mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Product_Canonical(l.settings:prev_product:id, l.settings:prev_uri)" />

<mvt:comment>
#
# styling is for Levels
#
</mvt:comment>

<hr>
<div class="row">
<div class="column half">
	<mvt:if expr="NOT ISNULL l.settings:prev_uri:uri">
	<a class="dark-red" href="&mvt:prev_uri:uri;">
		<span data-icon="@"></span>
		<small style="position: relative; top: -2px;">previous product</small>
	</a>
	<mvt:else>
	<span data-icon="@" class="gray"></span>
	</mvt:if>
</div>
<div class="column half align-right">
	<mvt:if expr="NOT ISNULL l.settings:next_uri:uri">
	<a class="dark-red" href="&mvt:next_uri:uri;">
		<small style="position: relative; top: -2px;">next product</small>
		<span data-icon="A"></span>
	</a>
	<mvt:else>
	<span data-icon="A" class="gray"></span>
	</mvt:if>
</div>
</div>

<mvt:comment>
#
# end prev/next product arrows
#
</mvt:comment>

https://www.scotsscripts.com/mvblog/smt-previous-next-product-arrowslinks.html

mvkb_products mvkb_smt