includes/shipping/flat-rate/class-wc-shipping-flat-rate.php 1 location
|
@@ 207-215 (lines=9) @@
|
| 204 |
|
* @param array $package |
| 205 |
|
* @return int |
| 206 |
|
*/ |
| 207 |
|
public function get_package_item_qty( $package ) { |
| 208 |
|
$total_quantity = 0; |
| 209 |
|
foreach ( $package['contents'] as $item_id => $values ) { |
| 210 |
|
if ( $values['quantity'] > 0 && $values['data']->needs_shipping() ) { |
| 211 |
|
$total_quantity += $values['quantity']; |
| 212 |
|
} |
| 213 |
|
} |
| 214 |
|
return $total_quantity; |
| 215 |
|
} |
| 216 |
|
|
| 217 |
|
/** |
| 218 |
|
* Finds and returns shipping classes and the products with said class. |
includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php 1 location
|
@@ 238-246 (lines=9) @@
|
| 235 |
|
* @param array $package |
| 236 |
|
* @return int |
| 237 |
|
*/ |
| 238 |
|
public function get_package_item_qty( $package ) { |
| 239 |
|
$total_quantity = 0; |
| 240 |
|
foreach ( $package['contents'] as $item_id => $values ) { |
| 241 |
|
if ( $values['quantity'] > 0 && $values['data']->needs_shipping() ) { |
| 242 |
|
$total_quantity += $values['quantity']; |
| 243 |
|
} |
| 244 |
|
} |
| 245 |
|
return $total_quantity; |
| 246 |
|
} |
| 247 |
|
|
| 248 |
|
/** |
| 249 |
|
* Finds and returns shipping classes and the products with said class. |