Skip to content

Commit

Permalink
Order context use Shop_AddressInfo not Shop_CheckoutAddressInfo, upda…
Browse files Browse the repository at this point in the history
…te references.
  • Loading branch information
damanic committed Apr 4, 2022
1 parent 9c8719b commit dd47f5d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion classes/shop_addressinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function save_to_order($order, $billing=true)
/**
* Checks whether the address represented with the object matches the address represented with another address information object.
* @documentable
* @param Shop_CheckoutAddressInfo $address_info Specifies another address information object to compare with.
* @param Shop_AddressInfo $address_info Specifies another address information object to compare with.
* @return boolean Returns TRUE if the address matches. Returns FALSE otherwise.
*/
public function equals($address_info)
Expand Down
2 changes: 1 addition & 1 deletion docs/actions/checkout_billing_info.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<h4 class="separated">Variables</h4>
<ul>
<li><strong>$billing_info</strong> – an object of the <a href="http://lemonstand.com/wiki/class_shop_checkoutaddressinfo" target="_blank">Shop_CheckoutAddressInfo</a> class representing a customer's billing name and address.</li>
<li><strong>$billing_info</strong> – an object of the <a href="http://lemonstand.com/wiki/class_shop_checkoutaddressinfo" target="_blank">Shop_AddressInfo</a> class representing a customer's billing name and address.</li>
<li><strong>$countries</strong> – a collection of countries for populating the Country list. The collection is an object of the <a href="http://lemonstand.com/wiki/class_db_datacollection" target="_blank">Db_DataCollection</a> class. Each element in the collection is an object of the <a href="http://lemonstand.com/wiki/class_shop_country" target="_blank">Shop_Country</a> class.</li>
<li><strong>$states</strong> – a collection of countries for populating the State list. The collection is an object of the <a href="http://lemonstand.com/wiki/class_db_datacollection" target="_blank">Db_DataCollection</a> class. Each element in the collection is an object of the <a href="http://lemonstand.com/wiki/class_shop_countrystate" target="_blank">Shop_CountryState class</a>.</li>
<li><strong>$discount</strong> - estimated cart discount. You can display this value during the checkout process.</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/actions/checkout_shipping_info.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<h4 class="separated">Variables</h4>
<ul>
<li><strong>$shipping_info</strong> – an object of the <a herf="http://lemonstand.com/wiki/class_shop_checkoutaddressinfo" target="_blank">Shop_CheckoutAddressInfo</a> class representing a customer's shipping name and address.</li>
<li><strong>$shipping_info</strong> – an object of the <a herf="http://lemonstand.com/wiki/class_shop_checkoutaddressinfo" target="_blank">Shop_AddressInfo</a> class representing a customer's shipping name and address.</li>
<li><strong>$countries</strong> – a collection of countries for populating the Country list. The collection is an object of the <a href="http://lemonstand.com/wiki/class_db_datacollection" target="_blank">Db_DataCollection</a> class. Each element in the collection is an object of the <a href="http://lemonstand.com/wiki/class_shop_country" target="_blank">Shop_Country</a> class.</li>
<li><strong>$states</strong> – a collection of countries for populating the State list. The collection is an object of the <a href="http://lemonstand.com/wiki/class_db_datacollection" target="_blank">Db_DataCollection</a> class. Each element in the collection is an object of the <a href="http://lemonstand.com/wiki/class_shop_countrystate" target="_blank">Shop_CountryState class</a>.</li>
<li><strong>$discount</strong> - estimated cart discount. You can display this value during the checkout process.</li>
Expand Down
31 changes: 16 additions & 15 deletions models/shop_order.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,25 +547,26 @@ public function after_validation($deferred_session_key = null)
* Returns shipping address information object.
* The object is populated with shipping address information from the order.
* @documentable
* @return Shop_CheckoutAddressInfo Returns an address information object.
* @return Shop_AddressInfo Returns an address information object.
*/
public function get_shipping_address_info()
{
$result = new Shop_CheckoutAddressInfo();
$result->act_as_billing_info = false;
$result = new Shop_AddressInfo();
$result->act_as_billing_info = false;

$result->first_name = $this->shipping_first_name;
$result->last_name = $this->shipping_last_name;
$result->company = $this->shipping_company;
$result->phone = $this->shipping_phone;
$result->country = $this->shipping_country_id;
$result->state = $this->shipping_state_id;
$result->street_address = $this->shipping_street_addr;
$result->city = $this->shipping_city;
$result->zip = $this->shipping_zip;
$result->shipping_addr_is_business = $this->is_business;
$result->first_name = $this->shipping_first_name;
$result->last_name = $this->shipping_last_name;
$result->company = $this->shipping_company;
$result->phone = $this->shipping_phone;
$result->email = $this->billing_email ? $this->billing_email : $this->customer->email;
$result->street_address = $this->shipping_street_addr;
$result->city = $this->shipping_city;
$result->state = $this->shipping_state_id;
$result->country = $this->shipping_country_id;
$result->zip = $this->shipping_zip;
$result->shipping_addr_is_business = $this->is_business;

return $result;
return $result;
}

/**
Expand Down Expand Up @@ -2069,7 +2070,7 @@ public function create_order_copy( $items = array(), $save = true, $session_key
* Apply shipping tax
*/

$shipping_info = new Shop_CheckoutAddressInfo();
$shipping_info = new Shop_AddressInfo();
$shipping_info->act_as_billing_info = false;
$shipping_info->load_from_customer( $customer );

Expand Down

0 comments on commit dd47f5d

Please sign in to comment.