Product::getFromCache( $product_id, $lang_id ) ] ); endforeach; endif; echo json_encode( [ 'html' => $output ] ); exit; } public static function warehouse_message() { global $lang_id; $values = json_decode( \S::get( 'values' ), true ); foreach( $values as $key => $val ) { if ( $key != 'product-id' and $key != 'quantity' ) $attributes[] = $val; } $result = \shop\Product::getWarehouseMessage( $values['product-id'], $attributes, $lang_id ); echo json_encode( $result ); exit; } // wyświetlenie atrybutów w widoku produktu static public function draw_product_attributes() { global $mdb, $lang_id; $combination = ''; $selected_values = \S::get( 'selected_values' ); foreach ( $selected_values as $value ) { $combination .= $value; if ( $value != end( $selected_values ) ) $combination .= '|'; } $product_id = \S::get( 'product_id' ); $product = Product::getFromCache( $product_id, $lang_id ); $product_data = $product -> getProductDataBySelectedAttributes( $combination ); echo json_encode( [ 'product_data' => $product_data ] ); exit; } }