private function getExtraProductMergeAttributes(Buyable $product)
    {
        $result = [];
        $cfg    = config(self::EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY, []);

        if (!is_array($cfg)) {
            throw new InvalidCartConfigurationException(
                sprintf(
                    'The value of `%s` configuration must be an array',
                    self::EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY
                )
            );
        }

        foreach ($cfg as $attribute) {
            if (!is_string($attribute)) {
                throw new InvalidCartConfigurationException(
                    sprintf(
                        'The configuration `%s` can only contain an array of strings, `%s` given',
                        self::EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY,
                        gettype($attribute)
                    )
                );
            }

            $result[$attribute] = $product->{$attribute};
        }

        return $result;
    }
private function getExtraProductMergeAttributes(Buyable $product)
    {
        $result = [];
        $cfg    = config(self::EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY, []);

        if (!is_array($cfg)) {
            throw new InvalidCartConfigurationException(
                sprintf(
                    'The value of `%s` configuration must be an array',
                    self::EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY
                )
            );
        }

        foreach ($cfg as $attribute) {
            if (!is_string($attribute)) {
                throw new InvalidCartConfigurationException(
                    sprintf(
                        'The configuration `%s` can only contain an array of strings, `%s` given',
                        self::EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY,
                        gettype($attribute)
                    )
                );
            }

            $result[$attribute] = $product->{$attribute};
        }

        return $result;
    }
private function getExtraProductMergeAttributes ( Buyable $ product ) { $ result = [ ] ; $ cfg = config ( self :: EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY , [ ] ) ; if ( ! is_array ( $ cfg ) ) { throw new InvalidCartConfigurationException ( sprintf ( 'The value of `%s` configuration must be an array' , self :: EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY ) ) ; } foreach ( $ cfg as $ attribute ) { if ( ! is_string ( $ attribute ) ) { throw new InvalidCartConfigurationException ( sprintf ( 'The configuration `%s` can only contain an array of strings, `%s` given' , self :: EXTRA_PRODUCT_MERGE_ATTRIBUTES_CONFIG_KEY , gettype ( $ attribute ) ) ) ; } $ result [ $ attribute ] = $ product -> { $ attribute } ; } return $ result ; }
Returns the extra product merge attributes for cart_items based on the config

@param Buyable $product

@throws InvalidCartConfigurationException

@return array
Returns the extra product merge attributes for cart_items based on the config