Commits

Chris Moffitt committed afa3bdf Merge

Merging.

Comments (0)

Files changed (9)

docs/release-notes-0-9-2.txt

 - Added Czech translation
 - Updated French translation
 - Updated Spanish translation
+- Added Romanian translation
 
 Bug Fixes
 ---------
 - Replace some admin jquery scripts with simpler django readonly fields
 - Ensure that google checkout empties the cart
 - Converted to SOAP based Fedex api
+- Fix use of sale variable in context processor
+- Handle different ship to and bill to addressees better
 
 Performance Improvements
 ------------------------

satchmo/apps/satchmo_store/contact/forms.py

         copy_address = data['copy_address']
 
         ship_address = customer.shipping_address
-
-        if copy_address:
+        try:
+            setattr(ship_address, "addressee",data.get('ship_addressee', ""))
+            setattr(bill_address, "addressee",data.get('addressee', ""))
+        except AttributeError:
+            pass
+        # If we are copying the address and one isn't in place for shipping
+        # copy it
+        if not getattr(ship_address, "addressee", False) and copy_address:
+            try:
+                ship_address.addressee = bill_address.addressee
+            except AttributeError:
+                pass
+                
+        # Make sure not to overwrite a custom ship to name
+        if copy_address and getattr(ship_address, "addressee", "") == getattr(bill_address, "addressee", ""):
             # make sure we don't have any other default shipping address
             if ship_address and ship_address.id != bill_address.id:
                 ship_address.delete()
             bill_address.is_default_shipping = True
 
         bill_address.save()
-
-        if not copy_address:
+        # If we have different ship to and bill to names, preserve them
+        if not copy_address or getattr(ship_address, "addressee", "") != getattr(bill_address, "addressee", ""):
             if not ship_address or ship_address.id == bill_address.id:
                 ship_address = AddressBook()
 

satchmo/apps/satchmo_store/contact/templates/contact/_contact_info_form_js.html

         satchmo.update_ship_copy('#id_copy_address');
         $('#id_copy_address').click(function() {
             satchmo.update_ship_copy(this);
-        });    
+        });
     }
 });
 
     var old_last_name = $('#id_last_name').data('old_last_name');
     var full_name = $.trim(first_name + ' ' + last_name);
     var old_full_name = $.trim(old_first_name + ' ' + old_last_name);
-    
-    function name_updater(selector, first_name, full_name, old_full_name) {
-        if (!$.trim($(selector).attr('value')).length ||
-        $(selector).attr('value') === first_name ||
-        $(selector).attr('value') === old_full_name) {
-            $(selector).attr('value',  full_name);
-        }
+    if ($('#id_addressee').attr('value') === old_full_name) {
+    $('#id_addressee').attr('value', full_name);
     }
-    name_updater('#id_addressee', first_name, full_name, old_full_name);
-    name_updater('#id_ship_addressee', first_name, full_name, old_full_name);
-   
+    if ($('#id_ship_addressee').attr('value') === old_full_name) {
+    $('#id_ship_addressee').attr('value', full_name);
+    }
     $('#id_first_name').data('old_first_name', first_name);
     $('#id_last_name').data('old_last_name', last_name);
 };
 
 $(document).ready(function() {
+    satchmo.name_change();
     $('#id_first_name').bind("change", {}, satchmo.name_change);
     $('#id_last_name').bind("change", {}, satchmo.name_change);
 });
-</script>
+</script>

satchmo/apps/satchmo_store/contact/templates/contact/_contact_info_form_shipping.html

 
     {% if country %}
       {% if form.fields.ship_state.choices %}
-       <tr>
+       <tr class="shiprow">
          <td><label for="id_ship_state">{% if country.get_admin_area_display %}{{ country.get_admin_area_display }}{% else %}{% trans "State/Province" %}{% endif %} {% if form.ship_state.field.required %}*{% endif %}</label></td>
          <td><p id="id_ship_state_loading" style="display: none">Loading...</p> {{ form.ship_state }}</td>
        </tr>

satchmo/apps/satchmo_store/shop/context_processors.py

         'request' : request,
         'login_url': site_settings.LOGIN_URL,
         'logout_url': site_settings.LOGOUT_URL,
-        'sale': sale
+        'storewide_sale': sale
     }
 
     satchmo_context.send(shop_config, context=ctx)

satchmo/apps/satchmo_store/shop/templates/shop/_order_details.html

 {{ order.contact.primary_phone.phone }}<br/>
 
 <h4>{% trans "Billing Information" %}</h4>
+{{ order.bill_addressee }}<br/>
 {{ order.full_bill_street|linebreaksbr }}<br/>
 {{ order.bill_city }}<br/>
 {{ order.bill_state }}<br/>
 
 {% if order.is_shippable %}
 <h4>{% trans "Shipping Address" %}</h4>
+{{ order.ship_addressee }}<br/>
 {{ order.full_ship_street|linebreaksbr }}<br/>
 {{ order.ship_city }}<br/>
 {{ order.ship_state }}<br/>

satchmo/apps/satchmo_store/shop/templates/shop/_order_tracking_details.html

 
 {% if order.is_shippable %}
 <h4>{% trans "Shipping To" %}</h4>
+{{ order.ship_addressee }}<br/>
 {{ order.full_ship_street }}<br/>
 {{ order.ship_city }}<br/>
 {{ order.ship_state }}<br/>

satchmo/apps/satchmo_store/shop/templates/shop/multiple_product_form.html

 			</td>
 			<td class="price">
 				{% if sale %}<strike id="fullprice" style="display: block;">{{ product|discount_price:""|currency }}</strike>{% endif %}
-				<span id="price">{{ product|discount_price:sale|currency }}</span>
+				<span id="price">{{ product|discount_price:storewide_sale|currency }}</span>
 			</td>
 			<td class="qty">
 				{{ field }}

satchmo/apps/satchmo_store/shop/templates/shop/search.html

 		{% endif %}
 		<ul>
 		{% for product in results.products %}
-	        <li><a href="{{ product.get_absolute_url }}">{{ product.translated_name }}</a> {% trans "for" %} {{ product|discount_price:sale|currency}}</li>
+	        <li><a href="{{ product.get_absolute_url }}">{{ product.translated_name }}</a> {% trans "for" %} {{ product|discount_price:storewide_sale|currency}}</li>
 	    {% endfor %}
 		</ul>
 	{% else %}