Skip to content

Commit

Permalink
fix qty rules
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Dec 17, 2024
1 parent 9aafe9e commit 138c2b9
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -645,4 +645,73 @@ public function destroy()
public function getConditionAttributes()
{
}

/**
* @OA\Post(
* path="/api/v1/admin/promotions/cart-rules/{id}/create-product-quantity-rule",
* operationId="createProductQuantityRule",
* tags={"CartRules"},
* summary="Create product quantity rule",
* description="Create product quantity rule",
* security={ {"sanctum_admin": {} }},
*
* @OA\Parameter(
* name="id",
* description="cart rule ID",
* required=true,
* in="path",
*
* @OA\Schema(
* type="integer"
* )
* ),
*
* @OA\RequestBody(
*
* @OA\MediaType(
* mediaType="application/json",
*
* @OA\Schema(
*
* @OA\Property(
* property="product_id",
* type="integer",
* description="Product ID",
* example=1
* ),
* @OA\Property(
* property="rules",
* type="array",
* description="Rules",
* example={{
* "value": "2",
* "operator": ">=",
* "attribute": "cart|items_qty",
* "attribute_type": "integer",
* "price": "10.50"
* }},
* ),
* required={"product_id", "quantity"}
* )
* )
* ),
*
* @OA\Response(
* response=200,
* description="Successful operation",
*
* @OA\JsonContent(
*
* @OA\Property(
* property="message",
* type="string",
* example="Product quantity rule created successfully."),
* )
* )
* )
* )
*/
public function createProductQuantityRule()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,14 @@ public function getConditionAttributes() {
]);
}

/**
*
* Create a new cart rule for the product quantity
*
* @return \Illuminate\Http\Response
*/
public function createProductQuantityRule($product_id, Request $request){

}

}
2 changes: 2 additions & 0 deletions src/Routes/V1/Admin/marketing-routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

Route::delete('{id}', 'destroy');

Route::post('{id}/create-product-quantity-rule', 'createProductQuantityRule');


});

Expand Down

0 comments on commit 138c2b9

Please sign in to comment.