Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 26, 2011 @ 16:44
    Søren Spelling Lund
    0

    uCommerce 1.5.1.0 is out

    Thanks to Tim Gaunt from The Site Doctor, Fabio Bongivanni from Taipan, and Jeavon Leopold from Crumpled Dog for providing feedback for this release.
    • NEW: EmailService accepts multiple CC and BCC addresses for e-mail (comma separated in admin gui).
    • NEW: EmailService can insert dynamic data in subject and for template, e.g. "Confirmation for order number {orderNumber}." combined with Send() which takes a dictionary parameter.
    • NEW: Purchase order maintains a ModifiedOn field to make it easier to discover abandoned baskets.
    • NEW: Shipments can have tax applied via new CalculateShipmentTaxForShipments pipeline task.
    • FIX: SendEmailTask will use the culture code on the purchase order instead of current thread for the language of e-mail.
    • FIX: Payment fee added to requested amount automatically.
    • FIX: Rich text editor would change URLs to be relative to the editing page.
    • FIX: Billing- and shipping addresses would be duplicated with each call to EditBillingAddress and EditShipmentInformation.
    • FIX: Order lines will contain information about both the product family and variant instead of just the variant.
    • FIX: Performance increases when generating nice URLs for catalog, categories, and products using ids instead of names and SKUs.
    • FIX: Culture codes will hold codes longer than five chars, e.g. en-029 for Carribbean.
    • FIX: Umbraco installs done via Web Platform Installer would not grant db user exec permissions on stored procs.
    • UPD: Updated to NHibernate 3.1 (including Castle Windsor and FluentNHibernate).
  • Zac 223 posts 575 karma points
    May 05, 2011 @ 17:40
    Zac
    0

    FIX: Billing- and shipping addresses would be duplicated with each call to EditBillingAddress and EditShipmentInformation.

    This one still seems to be a bit odd, with the following code still producing an odd list of addresses

    Basket b = SiteContext.Current.OrderContext.GetBasket();
    OrderAddress shippingAddress = b.PurchaseOrder.OrderAddresses.ToList()

    I did some tests which you can see here. The first line of each block shows what post codes I used for billing and shipping, and the second line of each block shows the contents of SiteContext.Current.OrderContext.GetBasket().PurchaseOrder.OrderAddresses.ToList() :

     

    Billing: "BT1 1XX" Shipping: None
    Postcode:BT1 1XX | Postcode:BT1 1XX
    
    Billing: "BT1 2XX" Shipping: None 
    Postcode:BT1 2XX | Postcode:BT1 1XX | Postcode:BT1 2XX
    
    Billing: "BT1 3XX" Shipping: "BT1 3YY"
    Postcode:BT1 3XX | Postcode:BT1 1XX | Postcode:BT1 2XX | Postcode:BT1 3YY
    
    Billing: "BT1 4XX" Shipping: None
    Postcode:BT1 4XX | Postcode:BT1 1XX | Postcode:BT1 2XX | Postcode:BT1 3YY | Postcode:BT1 4XX
    
    Billing: "BT1 5XX" Shipping: "BT1 5YY"
    Postcode:BT1 5XX | Postcode:BT1 1XX | Postcode:BT1 2XX | Postcode:BT1 3YY | Postcode:BT1 4XX | Postcode:BT1 5YY

    It seems I can actually use this, by taking the FIRST element as the billing address, and the LAST element as the shipping address, as this seems to remain consistent. In the previous uCommerce version, it was actually more random and I hadn't figured out a way (other than using the XML) of getting the different addresses. I made a post about this before where I thought I'd cracked it but actually, it didn't hold up.

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 05, 2011 @ 18:02
    Søren Spelling Lund
    0

    Hi Zac,

    Could you post the code you're using to generate the addresses and display the above output?

    Thanks.

  • Zac 223 posts 575 karma points
    May 05, 2011 @ 18:17
    Zac
    0

    Hi Søren,

    I'm not using any code to generate the addresses, just manually doing it through the site (via the standard XSLT from version 1.0.5.0):

    <xsl:variable name="isPostback" select="string-length(umbraco.library:RequestForm('firstNameInput')) > 0" />

        <xsl:if test="$isPostback">
          <xsl:variable name="firstName" select="umbraco.library:RequestForm('firstNameInput')" />
          <xsl:variable name="lastName" select="umbraco.library:RequestForm('lastNameInput')" />
          <xsl:variable name="line1" select="umbraco.library:RequestForm('line1Input')" />
          <xsl:variable name="line2" select="umbraco.library:RequestForm('line2Input')" />
          <xsl:variable name="postalCode" select="umbraco.library:RequestForm('postalCodeInput')" />
          <xsl:variable name="city" select="umbraco.library:RequestForm('cityInput')" />
          <xsl:variable name="phone" select="umbraco.library:RequestForm('phoneInput')" />
          <xsl:variable name="mobile" select="umbraco.library:RequestForm('mobileInput')" />
          <xsl:variable name="countryId" select="umbraco.library:RequestForm('countryInput')" />
          <xsl:variable name="email" select="umbraco.library:RequestForm('emailInput')" />
          <xsl:variable name="attention" select="umbraco.library:RequestForm('attentionInput')" />
          <xsl:variable name="company" select="umbraco.library:RequestForm('companyInput')" />

          <xsl:variable name="editBillingInformationResult" select="CommerceLibrary:EditBillingInformation($firstName, $lastName, $email, $phone, $mobile, $company, $line1, $line2, $postalCode, $city, '', $attention, $countryId)"/>

          <xsl:variable name="hasShipmentData" select="string-length(umbraco.library:RequestForm('shipment_line1Input')) > 0" />
          <xsl:variable name="shipmentFieldsVisible" select="umbraco.library:RequestForm('showShipment') ='1'" />
          <xsl:choose>
            <xsl:when test="$hasShipmentData and $shipmentFieldsVisible">
              <xsl:variable name="shipment_firstName" select="umbraco.library:RequestForm('shipment_firstNameInput')" />
              <xsl:variable name="shipment_lastName" select="umbraco.library:RequestForm('shipment_lastNameInput')" />
              <xsl:variable name="shipment_line1" select="umbraco.library:RequestForm('shipment_line1Input')" />
              <xsl:variable name="shipment_line2" select="umbraco.library:RequestForm('shipment_line2Input')" />
              <xsl:variable name="shipment_postalCode" select="umbraco.library:RequestForm('shipment_postalCodeInput')" />
              <xsl:variable name="shipment_city" select="umbraco.library:RequestForm('shipment_cityInput')" />
              <xsl:variable name="shipment_countryId" select="umbraco.library:RequestForm('shipment_countryInput')" />
              <xsl:variable name="shipment_attention" select="umbraco.library:RequestForm('shipment_attentionInput')" />
              <xsl:variable name="shipment_company" select="umbraco.library:RequestForm('shipment_companyInput')" />

              <xsl:variable name="editShipmentInformationResult" select="CommerceLibrary:EditShipmentInformation('Shipment', $shipment_firstName, $shipment_lastName, '', '', '', $shipment_company, $shipment_line1, $shipment_line2, $shipment_postalCode, $shipment_city, '', $shipment_attention, $shipment_countryId)"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:variable name="editShipmentInformationResult2" select="CommerceLibrary:EditShipmentInformation('Shipment', $firstName, $lastName, '', '', '', $company, $line1, $line2, $postalCode, $city, '', $attention, $countryId)"/>
            </xsl:otherwise>

          </xsl:choose>
        </xsl:if>

    and I'm using the following code to print out the contents of the OrderAddress IEnumerable:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using UCommerce.Entities;
    using System.Text.RegularExpressions;
    using DidicarUmbracoModel;
    using umbraco;
    using UCommerce.Runtime;
    
    
    [XsltExtension]
    public class Business
    {
        public Business() { }
    
    
        public static string ShowAddresses()
        {
            Basket b = SiteContext.Current.OrderContext.GetBasket();
            OrderAddress shippingAddress = b.PurchaseOrder.OrderAddresses.ToList().Last();
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
    
        foreach (OrderAddress oa in b.PurchaseOrder.OrderAddresses.ToList())
                sb.AppendFormat("Postcode:{0} | ", oa.PostalCode);
    
        return sb.ToString();
        }
    }

    I'm calling this public static method in App_Code from the shipping method XSLT (since this is where the address page posts to)

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library"
      xmlns:CommerceLibrary="urn:CommerceLibrary"
      xmlns:Business="urn:Business"
      exclude-result-prefixes="msxml umbraco.library CommerceLibrary">
    
    ...
    
    <xsl:value-of select="Business:ShowAddresses()"/>

     

  • Zac 223 posts 575 karma points
    May 05, 2011 @ 18:20
    Zac
    0

    To elaborate on that, I'm entering a test address or pair of addresses, submitting them, getting the output once I'm on the shipping methods page, pressing my back button, and repeating.

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 05, 2011 @ 18:41
    Søren Spelling Lund
    0

    That's weird. To make sure we didn't miss anything during release I went ahead and installed uCommerce/Store from scratch (1.5.1.0/1.1.1.0) and went through the checkout flow (without completing the order) several times to see whether additional addresses show up. I see just the billing address and shipping address being added to the db.

    To get to the bottom of this I think I'm going to have to ask you to send me the site so I can take a closer look. Could I ask you to shoot me an e-mail so we can arrange it?

    Thanks,

Please Sign in or register to post replies

Write your reply to:

Draft