Code Duplication    Length = 4-4 lines in 2 locations

includes/librairies/payments/payment.class.php 1 location

@@ 570-573 (lines=4) @@
567
					if (!empty($order_meta['order_items'])) {
568
						foreach ($order_meta['order_items'] as $item_id => $o) {
569
							$pid = $o['item_id'];
570
							if (strpos($item_id,'__') !== false) {
571
								$product_data_id = explode( '__', $item_id );
572
								$pid = ( !empty($product_data_id) && !empty($product_data_id[1]) ) ? $product_data_id[1] : $pid;
573
							}
574
							$product = wpshop_products::get_product_data( $pid );
575
							if ( get_post_type( $pid ) == WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION ) {
576
								$parent_def = wpshop_products::get_parent_variation ( $pid );

includes/modules/wps_product/controller/wps_product_ctr.php 1 location

@@ 106-109 (lines=4) @@
103
	 */
104
	function check_stock($product_id, $cart_asked_quantity, $combined_variation_id = '') {
105
		// Checking if combined variation ID exist and it is a simple option
106
		if( !empty($combined_variation_id) && ( strpos($combined_variation_id, '__') !== false ) ) {
107
			$var_id = explode( '__', $combined_variation_id);
108
			$combined_variation_id = $var_id[1];
109
		}
110
111
112
		if ( !empty($combined_variation_id) ) {