$val ) { $quantity_options = \shop\Product::get_product_permutation_quantity_options( $val['parent_id'] ? $val['parent_id'] : $val['product-id'], $val['attributes'][0] ); if ( ( $val[ 'quantity' ] > $quantity_options['quantity'] ) and !$quantity_options['stock_0_buy'] ) { $basket[ $key ][ 'quantity' ] = $quantity_options['quantity']; if ( $message ) \S::error( 'Ilość jednego lub więcej produktów została zmniejszona z powodu niestarczających stanów magazynowych. Sprawdź proszę koszyk.' ); $result = true; } } \S::set_session( 'basket', $basket ); return $result; } public function __get( $variable ) { if ( array_key_exists( $variable, $this -> data ) ) return $this -> $variable; } public function __set( $variable, $value ) { $this -> $variable = $value; } public function offsetExists( $offset ) { return isset( $this -> $offset ); } public function offsetGet( $offset ) { return $this -> $offset; } public function offsetSet( $offset, $value ) { $this -> $offset = $value; } public function offsetUnset( $offset ) { unset( $this -> $offset ); } }