CanFinalize.php
3 years ago
HasAffiliation.php
2 years ago
HasAttributes.php
1 year ago
HasBillingAddress.php
2 years ago
HasCharge.php
3 years ago
HasCheckout.php
3 years ago
HasCommissionStructure.php
2 years ago
HasCoupon.php
3 years ago
HasCustomer.php
3 years ago
HasDiscount.php
1 year ago
HasImageSizes.php
2 years ago
HasLicense.php
2 years ago
HasLineItem.php
2 years ago
HasOrder.php
3 years ago
HasPaymentInstrument.php
1 year ago
HasPaymentIntent.php
3 years ago
HasPaymentMethod.php
3 years ago
HasPayout.php
2 years ago
HasPayouts.php
2 years ago
HasPrice.php
3 years ago
HasProcessorType.php
3 years ago
HasProduct.php
3 years ago
HasPurchase.php
3 years ago
HasPurchases.php
3 years ago
HasReferral.php
2 years ago
HasReferralItems.php
2 years ago
HasReferrals.php
2 years ago
HasRefund.php
3 years ago
HasShippingAddress.php
1 year ago
HasSubscription.php
3 years ago
HasSubscriptions.php
3 years ago
SyncsCustomer.php
3 years ago
HasShippingAddress.php
18 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Models\Traits; |
| 4 | |
| 5 | trait HasShippingAddress { |
| 6 | /** |
| 7 | * Always set discount as object. |
| 8 | * |
| 9 | * @param array|object $value Value to set. |
| 10 | * @return $this |
| 11 | */ |
| 12 | protected function setShippingAddressAttribute( $value ) { |
| 13 | // force either string or object. |
| 14 | $this->attributes['shipping_address'] = is_string( $value ) ? $value : (object) $value; |
| 15 | return $this; |
| 16 | } |
| 17 | } |
| 18 |