@@ -6,35 +6,35 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Local_Pickup_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method( &$jsonld ) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | - $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | - } |
|
| 11 | + if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | + $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | - } |
|
| 15 | + if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( ! in_array( 'OnSitePickup', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'OnSitePickup' ); |
|
| 21 | - } |
|
| 19 | + if ( ! in_array( 'OnSitePickup', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | + array_push( $jsonld['availableDeliveryMethod'], 'OnSitePickup' ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | - $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | - } |
|
| 27 | + if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | + $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - $offer_shipping_details['shippingRate'][] = array( |
|
| 32 | - '@type' => 'MonetaryAmount', |
|
| 33 | - 'name' => $this->wc_shipping_method->get_title(), |
|
| 34 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ) ?: '0', |
|
| 35 | - 'currency' => get_woocommerce_currency(), |
|
| 36 | - ); |
|
| 31 | + $offer_shipping_details['shippingRate'][] = array( |
|
| 32 | + '@type' => 'MonetaryAmount', |
|
| 33 | + 'name' => $this->wc_shipping_method->get_title(), |
|
| 34 | + 'value' => $this->wc_shipping_method->get_option( 'cost' ) ?: '0', |
|
| 35 | + 'currency' => get_woocommerce_currency(), |
|
| 36 | + ); |
|
| 37 | 37 | |
| 38 | - } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | } |
@@ -6,32 +6,32 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Local_Pickup_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method(&$jsonld) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 11 | + if ( ! isset($jsonld['availableDeliveryMethod'])) { |
|
| 12 | 12 | $jsonld['availableDeliveryMethod'] = array(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 15 | + if ( ! is_array($jsonld['availableDeliveryMethod'])) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array($jsonld['availableDeliveryMethod']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( ! in_array( 'OnSitePickup', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'OnSitePickup' ); |
|
| 19 | + if ( ! in_array('OnSitePickup', $jsonld['availableDeliveryMethod'])) { |
|
| 20 | + array_push($jsonld['availableDeliveryMethod'], 'OnSitePickup'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate(&$offer_shipping_details) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 27 | + if ( ! isset($offer_shipping_details['shippingRate'])) { |
|
| 28 | 28 | $offer_shipping_details['shippingRate'] = array(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $offer_shipping_details['shippingRate'][] = array( |
| 32 | 32 | '@type' => 'MonetaryAmount', |
| 33 | 33 | 'name' => $this->wc_shipping_method->get_title(), |
| 34 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ) ?: '0', |
|
| 34 | + 'value' => $this->wc_shipping_method->get_option('cost') ?: '0', |
|
| 35 | 35 | 'currency' => get_woocommerce_currency(), |
| 36 | 36 | ); |
| 37 | 37 | |
@@ -6,35 +6,35 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Flat_Rate_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method( &$jsonld ) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | - $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | - } |
|
| 11 | + if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | + $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | - } |
|
| 15 | + if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | - } |
|
| 19 | + if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | + array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | - $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | - } |
|
| 27 | + if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | + $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - $offer_shipping_details['shippingRate'][] = array( |
|
| 32 | - '@type' => 'MonetaryAmount', |
|
| 33 | - 'name' => $this->wc_shipping_method->get_title(), |
|
| 34 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ), |
|
| 35 | - 'currency' => get_woocommerce_currency(), |
|
| 36 | - ); |
|
| 31 | + $offer_shipping_details['shippingRate'][] = array( |
|
| 32 | + '@type' => 'MonetaryAmount', |
|
| 33 | + 'name' => $this->wc_shipping_method->get_title(), |
|
| 34 | + 'value' => $this->wc_shipping_method->get_option( 'cost' ), |
|
| 35 | + 'currency' => get_woocommerce_currency(), |
|
| 36 | + ); |
|
| 37 | 37 | |
| 38 | - } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | } |
@@ -6,32 +6,32 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Flat_Rate_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method(&$jsonld) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 11 | + if ( ! isset($jsonld['availableDeliveryMethod'])) { |
|
| 12 | 12 | $jsonld['availableDeliveryMethod'] = array(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 15 | + if ( ! is_array($jsonld['availableDeliveryMethod'])) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array($jsonld['availableDeliveryMethod']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 19 | + if ( ! in_array('ParcelDelivery', $jsonld['availableDeliveryMethod'])) { |
|
| 20 | + array_push($jsonld['availableDeliveryMethod'], 'ParcelDelivery'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate(&$offer_shipping_details) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 27 | + if ( ! isset($offer_shipping_details['shippingRate'])) { |
|
| 28 | 28 | $offer_shipping_details['shippingRate'] = array(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $offer_shipping_details['shippingRate'][] = array( |
| 32 | 32 | '@type' => 'MonetaryAmount', |
| 33 | 33 | 'name' => $this->wc_shipping_method->get_title(), |
| 34 | - 'value' => $this->wc_shipping_method->get_option( 'cost' ), |
|
| 34 | + 'value' => $this->wc_shipping_method->get_option('cost'), |
|
| 35 | 35 | 'currency' => get_woocommerce_currency(), |
| 36 | 36 | ); |
| 37 | 37 | |
@@ -6,36 +6,36 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Free_Shipping_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method( &$jsonld ) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | - $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | - } |
|
| 11 | + if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 12 | + $jsonld['availableDeliveryMethod'] = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | - } |
|
| 15 | + if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | - } |
|
| 19 | + if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | + array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | - $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | - } |
|
| 27 | + if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 28 | + $offer_shipping_details['shippingRate'] = array(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - $offer_shipping_details['shippingRate'][] = array( |
|
| 32 | - '@type' => 'MonetaryAmount', |
|
| 33 | - 'name' => $this->wc_shipping_method->get_title(), |
|
| 34 | - 'value' => '0', |
|
| 35 | - 'currency' => get_woocommerce_currency(), |
|
| 36 | - ); |
|
| 31 | + $offer_shipping_details['shippingRate'][] = array( |
|
| 32 | + '@type' => 'MonetaryAmount', |
|
| 33 | + 'name' => $this->wc_shipping_method->get_title(), |
|
| 34 | + 'value' => '0', |
|
| 35 | + 'currency' => get_woocommerce_currency(), |
|
| 36 | + ); |
|
| 37 | 37 | |
| 38 | - } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | } |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Free_Shipping_Shipping_Method extends Shipping_Method { |
| 8 | 8 | |
| 9 | - public function add_available_delivery_method( &$jsonld ) { |
|
| 9 | + public function add_available_delivery_method(&$jsonld) { |
|
| 10 | 10 | |
| 11 | - if ( ! isset( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 11 | + if ( ! isset($jsonld['availableDeliveryMethod'])) { |
|
| 12 | 12 | $jsonld['availableDeliveryMethod'] = array(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( ! is_array( $jsonld['availableDeliveryMethod'] ) ) { |
|
| 16 | - $jsonld['availableDeliveryMethod'] = array( $jsonld['availableDeliveryMethod'] ); |
|
| 15 | + if ( ! is_array($jsonld['availableDeliveryMethod'])) { |
|
| 16 | + $jsonld['availableDeliveryMethod'] = array($jsonld['availableDeliveryMethod']); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( ! in_array( 'ParcelDelivery', $jsonld['availableDeliveryMethod'] ) ) { |
|
| 20 | - array_push( $jsonld['availableDeliveryMethod'], 'ParcelDelivery' ); |
|
| 19 | + if ( ! in_array('ParcelDelivery', $jsonld['availableDeliveryMethod'])) { |
|
| 20 | + array_push($jsonld['availableDeliveryMethod'], 'ParcelDelivery'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function add_shipping_rate( &$offer_shipping_details ) { |
|
| 25 | + public function add_shipping_rate(&$offer_shipping_details) { |
|
| 26 | 26 | |
| 27 | - if ( ! isset( $offer_shipping_details['shippingRate'] ) ) { |
|
| 27 | + if ( ! isset($offer_shipping_details['shippingRate'])) { |
|
| 28 | 28 | $offer_shipping_details['shippingRate'] = array(); |
| 29 | 29 | } |
| 30 | 30 | |