Skip to content

Can't display the Date an order was placed #947

Closed Answered by duncanmcclean
wautersj asked this question in Help
Discussion options

You must be logged in to vote

Oh, sorry, didn't realise you were storing orders in a database, in which case editing the resources/order.yaml blueprint is correct. You can delete the "Orders" collection and its blueprint since you're not using entries.

However, instead of the computed code in the AppServiceProvider, you'll need to override the Order Eloquent model and create a model accessor to return the order date.

  1. Create a new file in App\Models called Order.php, with the following contents:
<?php

namespace App\Models;

use DoubleThreeDigital\SimpleCommerce\Orders\OrderModel as BaseOrder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Support\Arr;

class Order extends BaseOrder
{
    public fun…

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@duncanmcclean
Comment options

Comment options

You must be logged in to vote
1 reply
@duncanmcclean
Comment options

Answer selected by duncanmcclean
Comment options

You must be logged in to vote
1 reply
@duncanmcclean
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants