From e02d96eb80f9fc5cfd20c3022c98fd58d61ab222 Mon Sep 17 00:00:00 2001 From: Martin Sznaper Date: Tue, 9 Aug 2022 00:07:43 +0200 Subject: [PATCH] Improvements + Delete the given optionValue + Return the collection of all option values By OptionID + Get collection of product rules by Product --- src/Bigcommerce/Api/Client.php | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/Bigcommerce/Api/Client.php b/src/Bigcommerce/Api/Client.php index 00eb60fa..578ee540 100644 --- a/src/Bigcommerce/Api/Client.php +++ b/src/Bigcommerce/Api/Client.php @@ -2053,4 +2053,42 @@ public static function getSkusByProduct($productId, $filter = array()) $filter = Filter::create($filter); return self::getCollection('/products/'.$productId.'/skus' . $filter->toQuery(), 'Sku'); } + + /** + * Delete the given optionValue. + * + * @param int $optionId + * @Param int $valueId + * @return mixed + */ + public static function deleteOptionValue($optionId, $valueId) + { + return self::deleteResource('/options/' . $optionId .'/values/'. $valueId); + } + + /** + * Return the collection of all option values By OptionID + * + * @param int $optionId + * @param array $filter + * @return array + */ + public static function getOptionValuesByOption($optionId, $filter = array()) + { + $filter = Filter::create($filter); + return self::getCollection('/options/' . $optionId . '/values' . $filter->toQuery(), 'OptionValue'); + } + + /** + * Get collection of product rules by ProductId + * + * @param int $productId + * @param array $filter + * @return mixed + */ + public static function getRulesByProduct($productId, $filter = array()) + { + $filter = Filter::create($filter); + return self::getCollection('/products/'.$productId.'/rules' . $filter->toQuery(), 'Rule'); + } }