7 users online. Create an account or sign in to join them.Users

Search

I'm building a shopping cart which is too simple to warrant using the shopping cart extension. I want to calculate the order total from the sum of the basket items:

The basket looks like this:

<xsl:for-each select="basket-items/entry">
    <xsl:variable name="line-cost}">
        <xsl:value-of select="quantity * (/data/products/entry[./@id=current()/product-id]/price)" />
    </xsl:variable>
    <xsl:value-of select="format-number($line-cost,'£###.00')"/>
</xsl:for-each>

I need to work out the cumulative value of the line costs. Can anyone suggest how I'd do this please.

Hey Stuart, @phoques explanation on my thread might help here: http://symphony-cms.com/discuss/thread/81462/

Thanks Andrew. That sorted it.

Woopa! :) appy days.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details