I would really appriciate a feature so I could sort delivery and payment options.
My option are listed in a dropdown box and it would be great if the prefered choice could be at the top of the dropdown.
Developer forum
E-mail notifications
Sort delivery/payment options
Posted on 09/11/2010 13:23:11
Replies
Posted on 11/11/2010 19:04:36
The default output should give you a list of options sorted by name. If you need custom sorting, you can use an XSLT template and apply xsl:sort to the options in each loop (Paymethods, Shippingmethods).
Posted on 17/01/2011 12:31:06
Morten,
Do you have an XSLT template you can upload so we could see how this could be done? just as an example?
thanks.
Peter
Do you have an XSLT template you can upload so we could see how this could be done? just as an example?
thanks.
Peter
Posted on 17/01/2011 18:23:26
Your options are limited, but as an example you could sort payment methods by price.
I have attached a template showing how to do that.
If you need to do some weird custom sorting, based on values that is not available as tags, then you would probably have to add some kind of ASP.NET sortable list to the administration and render your own loops :)
/Morten
I have attached a template showing how to do that.
If you need to do some weird custom sorting, based on values that is not available as tags, then you would probably have to add some kind of ASP.NET sortable list to the administration and render your own loops :)
/Morten
Posted on 18/01/2011 10:55:39
Thats great.
But the price can vary, since some of the cards are using percentage as a fee calculation.
I changed two places in the code, so You can sort by ID (text) instead. That way you can put the "newest" pay or shipping method on top. You would have to delete and create paymethods to get the right sorting, but it works.
But the price can vary, since some of the cards are using percentage as a fee calculation.
I changed two places in the code, so You can sort by ID (text) instead. That way you can put the "newest" pay or shipping method on top. You would have to delete and create paymethods to get the right sorting, but it works.
<xsl:template match="loop[@name='Paymethods']">
<xsl:for-each select="item">
<xsl:sort data-type="text" order="descending" select="Ecom.Cart.Paymethod.ID" />
<label>
<input type="radio" name="EcomCartPaymethodID" value="{Ecom.Cart.Paymethod.ID}">
<xsl:if test="string(Ecom.Cart.Paymethod.IsSelected)">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
<xsl:value-of select="Ecom.Cart.Paymethod.Name" />
</label>
</xsl:for-each>
</xsl:template>
<xsl:template match="loop[@name='Shippingmethods']">
<xsl:for-each select="item">
<xsl:sort data-type="text" order="descending" select="Ecom.Cart.Shippingmethod.ID" />
<label>
<input type="radio" name="EcomCartShippingmethodID" value="{Ecom.Cart.Shippingmethod.ID}">
<xsl:if test="string(Ecom.Cart.Shippingmethod.IsSelected)">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
<xsl:value-of select="Ecom.Cart.Shippingmethod.Name" />
</label>
</xsl:for-each>
</xsl:template>