PHP Class App\Http\Controllers\OrdersController

Inheritance: extends Controller
Show file Open project: ant-vel/antVel Class Usage Examples

Protected Properties

Property Type Description
$order App\Repositories\OrderRepository The order repository instance.

Public Methods

Method Description
__construct ( OrderRepository $order ) : void Create a new controller instance.
addToOrder ( string $destination, integer $productId, Illuminate\Http\Request $request ) : Response Adds the selected product to the BASE cart.
addToOrderById ( [type] $orderId, [type] $productId, Illuminate\Http\Request $request ) Allows adding products to a specific order and create new wish lists.
cancel ( $orderId, Illuminate\Http\Request $request ) : Response cancels one of the user orders.
checkOut ( ) : Response Starts the checkout process.
checkOutResume ( integer $addressId ) : Response Starts the checkout process.
closeOrder ( $order_id ) Changes the status of an order to close, so the user can now check if received.
commentOrder ( $order_id ) : App\Http\Controllers\json function to action to deliver virtual products.
createWishList ( ) : view Show the create wish list form.
deliveryVirtualProduct ( $orderId, $productId, Illuminate\Http\Request $request, $ajax = true ) : App\Http\Controllers\json function to action to deliver virtual products.
destroy ( integer $order_id, string $type ) : void Remove the specified resource from storage.
fromGuestToUser ( $ordersController ) fromGuestToUser This method is able to transfer all the guest shopping cart user to an user cart order.
mailtest ( )
modalDetailsProductCart ( ) : view function, to lift the Modal to display the details product in the card (Only this seller).
moveFromOrder ( integer $origin, integer $destination, integer $productId ) : Redirects Removes the selected item from the cart, and stores it back in the Later Cart.
placeOrder ( $type ) : Response Starts the checkout process.
rateOrder ( $order_id ) function to action to rate both the order and its content.
rateProduct ( Illuminate\Http\Request $request )
rateSeller ( Illuminate\Http\Request $request )
removeFromOrder ( string $orderName, integer $productId, $idOrder = '' ) : Redirects Removes the selected item from the cart.
reports ( $type, $filter )
sendOrder ( $order_id ) Changes the status of an order to pending, so the process can start.
showCart ( ) : view Show the contents of the user Cart.
showDetailsProductCart ( $id, Illuminate\Http\Request $request ) : App\Http\Controllers\json get keys registered (Only this seller).
showOrder ( $id ) : view
showSellerOrder ( integer $id ) : Response Display the specified resource.
showWishList ( $id = '' ) : view Show the contents of a wish list.
startOrder ( $order_id ) Changes the status of an order to pending, so the process can start.
storeComment ( Illuminate\Http\Request $request ) : App\Http\Controllers\json function to action to deliver virtual products.
storeWishList ( Illuminate\Http\Request $request ) : Response Create the new wishList with a description.
updateQuantity ( $orderId, $orderDetailId, $newValue ) : Response this method is able to update the quantities values in the shopping cart.
usersOrders ( Illuminate\Http\Request $request ) : view Shows the seller wich orders he/she has pending.
wishListDirectory ( ) : view wish list directory.

Private Methods

Method Description
addToCartVirtualsProduct ( $product, $email, $orderId, $quantity ) : view

Method Details

__construct() public method

Create a new controller instance.
public __construct ( OrderRepository $order ) : void
$order App\Repositories\OrderRepository
return void

addToOrder() public method

Adds the selected product to the BASE cart.
public addToOrder ( string $destination, integer $productId, Illuminate\Http\Request $request ) : Response
$destination string type or order ('cart','later',etc)
$productId integer The id of the product to be added
$request Illuminate\Http\Request
return Response

addToOrderById() public method

Allows adding products to a specific order and create new wish lists.
public addToOrderById ( [type] $orderId, [type] $productId, Illuminate\Http\Request $request )
$orderId [type]
$productId [type]
$request Illuminate\Http\Request [laravel object]

cancel() public method

cancels one of the user orders.
public cancel ( $orderId, Illuminate\Http\Request $request ) : Response
$request Illuminate\Http\Request
return Response

checkOut() public method

Starts the checkout process.
public checkOut ( ) : Response
return Response

checkOutResume() public method

Starts the checkout process.
public checkOutResume ( integer $addressId ) : Response
$addressId integer The address id selected to be copied
return Response

closeOrder() public method

Changes the status of an order to close, so the user can now check if received.
public closeOrder ( $order_id )

commentOrder() public method

@param $order_id int
public commentOrder ( $order_id ) : App\Http\Controllers\json
return App\Http\Controllers\json message error or message success

createWishList() public method

Show the create wish list form.
public createWishList ( ) : view
return view for orders.cart

deliveryVirtualProduct() public method

@param $orderId int|string id order
public deliveryVirtualProduct ( $orderId, $productId, Illuminate\Http\Request $request, $ajax = true ) : App\Http\Controllers\json
$productId int|string id product @param $request Request object to validate the type of request @return json message error or message success
$request Illuminate\Http\Request
return App\Http\Controllers\json

destroy() public method

Remove the specified resource from storage.
public destroy ( integer $order_id, string $type ) : void
$order_id integer
$type string
return void

fromGuestToUser() public static method

It happens when a guest user has a shopping cart and press in checkout button.
public static fromGuestToUser ( $ordersController )

mailtest() public method

public mailtest ( )

modalDetailsProductCart() public method

@return view
public modalDetailsProductCart ( ) : view
return view

moveFromOrder() public method

Removes the selected item from the cart, and stores it back in the Later Cart.
public moveFromOrder ( integer $origin, integer $destination, integer $productId ) : Redirects
$origin integer type of the origin order ('cart','later',etc)
$destination integer type of the destination order ('cart','later',etc)
$productId integer of the product
return Redirects back to de cart

placeOrder() public method

Starts the checkout process.
public placeOrder ( $type ) : Response
return Response

rateOrder() public method

@param $order_id int
public rateOrder ( $order_id )

rateProduct() public method

public rateProduct ( Illuminate\Http\Request $request )
$request Illuminate\Http\Request

rateSeller() public method

public rateSeller ( Illuminate\Http\Request $request )
$request Illuminate\Http\Request

removeFromOrder() public method

Removes the selected item from the cart.
public removeFromOrder ( string $orderName, integer $productId, $idOrder = '' ) : Redirects
$orderName string type or order ('cart','later',etc)
$productId integer Product id to be removed from the order
return Redirects back to de cart

reports() public method

public reports ( $type, $filter )

sendOrder() public method

Changes the status of an order to pending, so the process can start.
public sendOrder ( $order_id )

showCart() public method

Show the contents of the user Cart.
public showCart ( ) : view
return view for orders.cart

showDetailsProductCart() public method

@param $id int|string id product
public showDetailsProductCart ( $id, Illuminate\Http\Request $request ) : App\Http\Controllers\json
$request Illuminate\Http\Request Request object to validate the type of request @return json
return App\Http\Controllers\json

showOrder() public method

public showOrder ( $id ) : view
return view

showSellerOrder() public method

Display the specified resource.
public showSellerOrder ( integer $id ) : Response
$id integer
return Response

showWishList() public method

Show the contents of a wish list.
public showWishList ( $id = '' ) : view
return view for orders.wish

startOrder() public method

Changes the status of an order to pending, so the process can start.
public startOrder ( $order_id )

storeComment() public method

@param $order_id int
public storeComment ( Illuminate\Http\Request $request ) : App\Http\Controllers\json
$request Illuminate\Http\Request
return App\Http\Controllers\json message error or message success

storeWishList() public method

Create the new wishList with a description.
public storeWishList ( Illuminate\Http\Request $request ) : Response
$request Illuminate\Http\Request
return Response JSON

updateQuantity() public method

this method is able to update the quantities values in the shopping cart.
public updateQuantity ( $orderId, $orderDetailId, $newValue ) : Response
$orderId is the shopping cart order id
$orderDetailId is the shopping cart order details
$newValue is new quantity to be used in the update
return Response

usersOrders() public method

Shows the seller wich orders he/she has pending.
public usersOrders ( Illuminate\Http\Request $request ) : view
$request Illuminate\Http\Request
return view

wishListDirectory() public method

wish list directory.
public wishListDirectory ( ) : view
return view for orders.cart

Property Details

$order protected property

The order repository instance.
protected OrderRepository,App\Repositories $order
return App\Repositories\OrderRepository