Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort by the order it's pulled from in the cart/shipping config file #1085

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
78f99a6
Update README logo for light & dark mode (#972)
wilsenhc Apr 28, 2023
28eb8f6
Hotfix [0.3] - Refactor row selecting on tables. (#976)
alecritson May 11, 2023
0a8c789
Feat [0.3] - Add price relationship to products (#981)
alecritson May 11, 2023
44e4f88
Merge in 0.2.6
alecritson May 16, 2023
b556caf
Hotfix [0.3] - Update composer.json to use self.version for Lunar Sco…
glennjacobs May 18, 2023
947f14a
Hotfix [0.3] - Freeze time in tests (#999)
glennjacobs May 18, 2023
d13ab28
Feat [0.3] - Add status scope to products (#982)
alecritson May 18, 2023
ad5e5dc
[0.3] reposition Tag section in order page (#1002)
wychoong May 18, 2023
ea5a57d
Hotfix [0.3] - Handle rounding properly on unit qty pricing (#998)
glennjacobs May 22, 2023
fe2e7f7
Merge in 0.2 to 0.3 (#1010)
alecritson May 22, 2023
d92c119
Hotfix [0.3] - fix cart casting (#1011)
wychoong May 23, 2023
df8077c
Feat [0.3] - Brand table search (#859)
wychoong May 23, 2023
1e4346e
Fix attribute group saving validation (#1012)
alecritson May 23, 2023
1ccf0de
PHPStan (#1001)
glennjacobs May 24, 2023
450c476
Hotfix [0.3] - Sort brand by `name` in hub product page (#1069)
wychoong May 24, 2023
4283bb1
Hotfix [0.3] - Reset table pagination after search/filter applied (#1…
wychoong May 24, 2023
3792773
Documentation/Contribution updates (#1072)
alecritson May 24, 2023
e7bc486
Hotfix - Ensure $rate is an object when serializing TaxBreakdown (#1005)
kylekanderson May 23, 2023
7d75555
Release 0.3.0 (#1073)
alecritson May 24, 2023
5a94f0a
Update roadmap in docs
glennjacobs May 24, 2023
6759b69
Sort by the order it's pulled from in the cart/shipping config file
dewebdesigns May 25, 2023
4e14b2e
Fix to Cart Docs (#1091)
glennjacobs May 30, 2023
76007ca
Fix bug that sets the default weight to kg instead of using a length …
dewebdesigns Jun 22, 2023
49bfb79
Variant backorder validation (#1089)
migsAV Jun 22, 2023
c21c8c9
Merge branch '0.3' into feature/remove-sorting-by-default
glennjacobs Jun 22, 2023
9a34a1e
Add changelog entry
dewebdesigns Jun 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
blank_issues_enabled: false

contact_links:
- name: Support Questions & Other
url: https://github.com/lunarphp/lunar/discussions
about: 'If you have a question, or need some support from the community'
- name: Feature request
url: https://github.com/lunarphp/lunar/discussions/new/choose
about: For ideas or feature requests
- name: Support questions & other
url: https://github.com/lunarphp/lunar/discussions/new/choose
about: If you have a question, or need some support from the community
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/enhancement_request.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Static Analysis"

on:
pull_request:

concurrency:
group: sa-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

jobs:
static-analysis:
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.2"]
laravel: ["^9.0", "^10.0"]
dependencies: ["highest"]

name: "PHP ${{ matrix.php }} - L${{ matrix.laravel }} ${{ matrix.dependencies == 'highest' && '↑' || '↓' }}"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
extensions: "dom, curl, libxml, mbstring, zip, fileinfo"
tools: "composer:v2"
coverage: "none"

- name: "Install dependencies from composer.json"
if: "matrix.dependencies != 'lowest'"
run: "composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress"

- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress --prefer-lowest"

- name: "Run PHPStan"
run: ./vendor/bin/phpstan
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ yarn.lock
package-lock.json
.DS_Store
.nova
phpstan.neon
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><a href="https://lunarphp.io/" target="_blank"><img src="https://raw.githubusercontent.com/lunarphp/art/main/lunar-logo.svg" width="200" alt="Lunar"></a></p>
<p align="center"><a href="https://lunarphp.io/" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/lunarphp/art/main/lunar-logo-dark.svg"><img alt="Lunar" width="200" src="https://raw.githubusercontent.com/lunarphp/art/main/lunar-logo.svg"></picture></a></p>

[Lunar](https://lunarphp.io) is a set of Laravel packages that bring functionality akin to Shopify and other e-commerce platforms to Laravel. You have complete freedom to create your own storefront(s), but we've already done the hard work for you in the backend.

Expand All @@ -14,6 +14,12 @@ This repository serves as a monorepo for the main packages that make up Lunar.

- [Full documentation](https://docs.lunarphp.io/) - Includes in-depth guides on everything Lunar

## Contribution

- Bug reports should be submitted as a new Github issue
- Enhancements should [https://github.com/lunarphp/lunar/discussions/new?category=enhancements](be in discussions)
- Feature requests should [https://github.com/lunarphp/lunar/discussions/new?category=feature-requests](be in discussions)

## Community

- [Join our discord server](https://discord.gg/v6qVWaf) and chat to the developers and people using Lunar.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"mockery/mockery": "^1.4.4",
"orchestra/testbench": "^7.0|^8.0",
"phpunit/phpunit": "^9.5",
"symplify/monorepo-builder": "^10.0"
"symplify/monorepo-builder": "^10.0",
"nunomaduro/larastan": "^2.0"
},
"autoload": {
"files": [
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export default defineConfig({
{ text: 'Livewire Starter Kit', link: 'https://github.com/lunarphp/livewire-starter-kit' },
{ text: 'Add-ons', link: 'https://github.com/lunarphp/awesome' },
{ text: 'Discord', link: 'https://discord.gg/v6qVWaf' },
{ text: 'Discussions', link: 'https://github.com/lunarphp/lunar/discussions' },
{ text: 'Roadmap', link: 'https://github.com/orgs/lunarphp/projects/1' }
{ text: 'Discussions', link: 'https://github.com/lunarphp/lunar/discussions' }
]
},
{
Expand All @@ -70,6 +69,7 @@ export default defineConfig({
{ text: 'Configuration', link: '/core/configuration' },
{ text: 'Initial Set-Up', link: '/core/set-up' },
{ text: 'Upgrade Guide', link: '/core/upgrading' },
{ text: 'Release Schedule', link: '/core/release-schedule' },
{ text: 'Security', link: '/core/securing-your-site' },
{ text: 'Contributing', link: '/core/contributing' }
]
Expand Down
2 changes: 1 addition & 1 deletion docs/admin-hub/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Create a Livewire component to handle your custom discount type.

namespace App\Http\Livewire\Components;

use Illuminate\Support\Facades\DB;
use Lunar\Facades\DB;
use Lunar\Models\Discount;
use Lunar\Hub\Http\Livewire\Components\Discounts\Types\AbstractDiscountType;

Expand Down
17 changes: 17 additions & 0 deletions docs/core/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ So that Lunar tables do not conflict with your existing application database tab
'table_prefix' => 'lunar_',
```

### Database Connection

`lunar/database.php`

By default, the package uses the default database connection defined in Laravel. Here specify a custom database connection for Lunar.

```php
'connection' => 'some_custom_connection',
```

If you are using a custom database connection that is not the default connection in your Laravel configuration, you need to specify it in the .env file as well.

```
ACTIVITY_LOGGER_DB_CONNECTION=some_custom_connection
```
In our package, we utilize Spatie's [laravel-activitylog](https://spatie.be/docs/laravel-activitylog) for logging. The mentioned configuration allows the activity logger to use a different database connection instead of the default database connection.

### Orders

`lunar/orders.php`
Expand Down
10 changes: 6 additions & 4 deletions docs/core/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ You can contribute to the project in many different ways. Reporting bugs, fixing

## Monorepo

Lunar uses a monorepo [lunarphp/lunar](https://github.com/lunarphp/lunar) to house the core, admin hub and documentation. [Monorepos](https://en.wikipedia.org/wiki/Monorepo) are quite common, but may not be familiar to some. The monorepo helps us to organise the code for ease of development.
Lunar uses a monorepo [lunarphp/lunar](https://github.com/lunarphp/lunar) approach to maintaining its codebase. [Monorepos](https://en.wikipedia.org/wiki/Monorepo) are quite common, but may not be familiar to some. The monorepo helps us to organise the code for ease of development.

## Repository Branching

**Bug Fixes** should target the latest compatible branch version i.e `0.3`. The `main` branch should never have bug fix PR's unless they fix features that are in an upcoming release.

**Features** should target the `main` branch if they introduce breaking changes, otherwise they can target the latest compatible branch version i.e `0.3`.
**Features** that bring new (or enhance current) functionality to Lunar should always target the `main` branch.

## Contributing Code

Expand Down Expand Up @@ -54,7 +54,7 @@ Open source code belongs to all of us, and it's all of our responsibility to pus

## Proposing a Feature

Before you start coding away on the next awesome feature, we highly recommend starting a [discussion](https://github.com/lunarphp/lunar/issues/new/choose) to check that your contribution will be welcomed. We would hate for you to spend valuable time on something that won't be merged into Lunar.
Before you start coding away on the next awesome feature, we highly recommend starting a [discussion](https://github.com/lunarphp/lunar/discussions) to check that your contribution will be welcomed. We would hate for you to spend valuable time on something that won't be merged into Lunar.

However, you're more than welcome to code away on your idea if you think it will help the discussion.

Expand All @@ -65,8 +65,10 @@ If the pull request is missing information or unclear as to what it offers or so

A PR should be able to include the following:

- Clearly show in the title the version the PR is targeting i.e. `[0.3]` or `[0.4]`.
- The title should be relevant and quickly explain what to expect inside
- A clear description of the feature or fix
- References to any issues the PR resolves
- Label as either a `bug`, `enhancement`, `feature` or `documentation`
- Any relevant documentation updates
- Unit tests with adequate code coverage
- Changelog entry
Expand Down
5 changes: 0 additions & 5 deletions docs/core/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
composer require lunarphp/lunar
```

::: tip Laravel 10
Laravel 10 support is still in beta release. You can install it by targeting `0.3.0-beta`, but it is not considered production ready at this point.
```sh
composer require lunarphp/lunar "^0.3.0-beta"
```
:::

### Add the LunarUser Trait
Expand Down
2 changes: 0 additions & 2 deletions docs/core/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Although the admin hub uses Laravel Livewire, there is no requirement for your a

Lunar as a company has grand plans to continue developing new functionality to help you build awesome e-commerce websites. We want Lunar to be a true alternative to the likes of Magento, Shopify, WooCommerce, etc.

Keep an eye on [our roadmap](https://github.com/orgs/lunarphp/projects/1) for future plans and recent releases.

## Get started

Enough waffle! Let's help you [install Lunar...](/core/installation)
1 change: 0 additions & 1 deletion docs/core/reference/carts.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ foreach ($cart->discountBreakdown as $discountBreakdown) {
}
$discountBreakdown->total->value
}
```

foreach ($cart->discountBreakdown as $discountBreakdown) {
$discountBreakdown->discount_id
Expand Down
27 changes: 27 additions & 0 deletions docs/core/reference/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ $taxClass = TaxClass::where(...)->first();
$currency = Currency::where(...)->first();
```

You can also specify a status to limit results to using the provided scope.

```php
Product::status('published')->get();
```

Then we need to create our base option and it's values.

```php
Expand Down Expand Up @@ -431,6 +437,19 @@ $price->price->formatted('fr') // 1,99 £GB
$price->price->formatted('en-gb', \NumberFormatter::SPELLOUT) // one point nine nine.
```

If you are using unit quantities in your product pricing, then you may wish to also use the following methods.

```php
// will give the decimal price for a single unit
$price->price->unitDecimal

// will give the decimal price for a single unit, without rounding
$price->price->unitDecimal(false)

// will give the formatted price for a single unit
$price->price->unitFormatted
```

### Base Pricing

Pricing is defined on a variant level, meaning you will have a different price for each variant and also for each currency in the system. In order to add pricing to a variant, you can either create the model directly or use the relationship method.
Expand Down Expand Up @@ -568,6 +587,14 @@ $pricing->tiers;
$pricing->customerGroupPrices;
```

Sometimes you might want to simply get all prices a product has from the variants, instead of loading up all a products variants fetching the prices that way, you can use the `prices` relationship on the product.

```php
$product->prices
```

This will return a collection of `Price` models.

## Full Example

For this example, we're going to be creating some Dr. Martens boots. Below is a screenshot of what we're aiming for:
Expand Down
37 changes: 37 additions & 0 deletions docs/core/release-schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Release Schedule

## Overview

Lunar is currently on a `0.x` version. This means in order to get to a stable `1.0.0` release, we need to go through quite a rapid development cycle to ensure we are delivering bug fixes and features you expect from your e-commerce system.

For this reason we have committed to a release schedule that we feel will communicate what new features you can expect, when they will arrive and when important bug fixes will be released. Also, importantly, contributors will know with a certain level of accuracy when the feature they are proposing will be included and at what version.

### Schedule

- Feature Releases `0.x` - Released at the start of every month
- Bug Fixes `0.x.x` - Grouped and released at the end of each working week (Friday)
- Critical/Security Bug Fixes `0.x.x` - Released within the day they are merged.

## Backwards Compatibility and Upgrading

One concern is if we are releasing `0.x` versions frequently, what does this mean for you as the developer in terms of the level of effort required to upgrade for each version, for example `0.2` to `0.3` or `0.2` to `0.5` etc.

For each release there will be a dedicated upgrade section on the [Upgrade Guide](/core/upgrading) page, which will provide the required upgrade steps for you to take.

## Feature Releases (`0.x`)

Minor versions will be released at the start of each month. The `main` branch is considered the "edge" version and will contain features for the next release.

This timeframe will give all contributors enough time to finalise their pull requests and also allow us to test the features to ensure they are ready for release.

Once a new version is released, the previous version will no longer be supported and it will be recommended for all developers to upgrade to the latest version.

:::tip
If a bug is found on a previous version that is also present on the latest `0.x` release, it will be fixed in the latest release, unless it is a security issue.
:::

### Bug fixes (`0.x.x`)

If there are PR's which have been opened to fix bugs, we will generally group them together and do a patch release at the end of the week, depending on volume and level.

Any fixes which are deemed critical will be released as they are merged to ensure everyone benefits straight away. When a release is tagged it will automatically be broadcast to our discord server.
40 changes: 40 additions & 0 deletions packages/admin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.3.0

> Latest updates from `0.2` have been brought in.

### Fixed

- The sales dashboard graph now correctly shows figures.
- When going to a new page on table listings, the page will now scroll to the top.
- The iframe height on email previews has been increased to avoid cut off.
- Refactor row selection on tables to avoid extra roundtrips to Livewire.
- AttributeGroup saving will now pass the id if being edited to prevent false validation exception being thrown.
- Added a validation check for the product variant backorder.

### Changed

- Dashboard stats are now responsible for their own date ranges where applicable.
- The tags panel on the order detail screen has been moved below the address details.
- Brands will now list alphabetically by default.
- Dimensions are now sorted by the order in the shipping configuration file.

### Added

- Brands are now searchable and can have saved searches.

## 0.3.0-beta.3

> Maintenance update to bring changes from 0.2.5 in.
Expand Down Expand Up @@ -38,6 +62,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Changed Auth guard to use Laravel's default driver.
- Updated `db_date` function to return just the formmatted string.

## 0.2.7

### Fixed

- Added missing notification translation.
- Variant stock level will now be validated correctly to prevent DB exception on save.
- Variant image uploading will now check for S3 usage when uploading, the same as product saving.
- When reordering items, the `$index` now checks for an integer instead of purely existence to prevent failure when `$index` is `0`.
- Improved validation on translatable attributes to prevent exception when entering multiple languages.

## 0.2.6

### Fixed

- When creating an option, `wire:model` should now correctly reference `newProductOption` when editing the name in a different locale.

## 0.2.5

### Fixed
Expand Down
Loading
Loading