Skip to content

Commit

Permalink
3.0 to master (#1401)
Browse files Browse the repository at this point in the history
* [OrderCreation] allow to create a new customer within the order-creation process in backend

* [OrderCreation] allow to create a new address on sale creation

* [All] refactor for Cart = Order = Quote. Only separation is a status field

* [All] further refactor cart=order=quote

* re-add migrations

* remove cart and quote
add migration from cart to cart-order

* [Order] refactor backend ordre creation

* [Order] refactor order-creation, order-detail javascript wise

* [All] add typeidentifiers

* [All] further add types

* [All] further add types

* [All] further add types

* [All] further add types

* [All] refactor for Cart = Order = Quote. fix tests after merging type-hints branch

* [Stan] fix stan issues

* [PHPUnit] remove cause it is not up-to-date and superceded by behat

* [Behat] bootstrap

* [Behat] bootstrap

* [3.0] fix type for customer repo

* [Behat] fix tests

* [3.0] bump branch to 3.0

* [3.0] merge and refactor changes from 2.2

* [3.0] strict types and tests

* [3.0] order return types

* [3.0] type fixes

* [3.0] revert forceFind(int) to forceFind(mixed) and fix orderShipment and orderInvoice generation

* [3.0] add translation for sale_type transition

* Merge branch 'master' into 3.0

* [3.0] revert type for findor404 in resource controller

* [3.0] make service-aliases deprecated and change all internal uses of it

* [3.0] bump symfony to 4.3

* remove symfony version from travis installer

* [3.0] remove not needed classes

* remove behat env

* fix phpstan kernel file name

* [stan] fix stan tests

* [stan] fix stan tests

* fix behat test

* add 3.0 changelog

* [3.0] remove php template helpers

* [3.0] add upgrade notes

* [3.0] change base-currency conversion -> base-currency ALWAYS is Store Currency, where as the display currency is the one we need to convert

* [3.0] remove php template helpers - fix missing service alias

* [3.0] change base-currency conversion -> base-currency ALWAYS is Store Currency, where as the display currency is the one we need to convert - fixes

* [3.0] better manage base values

* [3.0] add upgrade info for removal of template engine

* [3.0] add upgrade log

* [3.0] add type-hints upgrade note

* [3.0] change IndexableInterface and pass IndexInterface

* [3.0] move cheapest carrier resolver to Core and inject CartContext there

* [GithubActions] only test symfony 4 for 3.0

* [Panther] start implementing ui-tests

* [Panther] start implementing ui-tests

* [Panther] start implementing ui-tests

* [Panther] start implementing ui-tests

* [Panther] start implementing ui-tests

* [Panther] start implementing ui-tests - use coreshop mink panther fork

* [Panther] start implementing ui-tests - don't start chrome, panther does that

* [3.0] add registration and login tests

* [3.0] add registration validation tests

* [3.0] implement reset ui tests

* [3.0] min require Pimcore 6.6

* [3.0] min require Pimcore 6.6

* [3.0] disable cache buster for CoreShop Frontend Bundle

* [3.0] add change-password tests

* [3.0] add basic customer profile tests

* [3.0] add basic customer profile tests

* [3.0] run behat tests in container

* [3.0] run behat tests in container - revert

* [3.0] use symfony webserver to run test suite

* [3.0] use symfony webserver to run test suite

* [3.0] add customer profile settings tests

* [3.0] add profile change validation tests

* [SecurityValidator] only trigger when Pimcore Frontend request

* [3.0] ui-tests fix test suite

* [3.0] add product page and price tests

* [3.0] fix test suites

* [3.0] create Pimcore admin login test

* [3.0] add cart tests

* [FrontendBundle] remove all get calls, Pimcore properties are private for a while now and therefore twig calls the getter anyway

* [3.0] fix stan tests

* [3.0] fix stan tests

* [3.0] tests: refine behat filters

* [3.0] remove travis badge and add github badge

* [3.0] mark tests not working as WIP until panther is erady

* [3.0] fix test run

* [3.0] add tests for cart with units and quantity price rules

* [3.0] add product view tests for quantity price rule with units

* [3.0] add tests for add-to-cart with quantity price rules and units

* [3.0] add tests for min/max qty to order

* [3.0] add out-of-stock ui tests

* [3.0] add cart-price-rule tests

* [3.0] invalidate voucher rule tests

* [3.0] start implementing the checkout

* [3.0] add prevent empty checkout tests

* [3.0] revise shipping checkout form and step and add test for disabled carrier

* [3.0] add missing function

* [3.0] fix tests

* [3.0] introduce class translations

* still use convertAndFormat for frontend display of converted currencies

* [3.0] get rid of base values and introduced converted Values

* [3.0] remove 2.x migrations and add migrations for 3.x

* [3.0] remove 2.x migrations and add migrations for 3.x

* Update UPGRADE-3.0.x.md

Co-Authored-By: Jacob Dreesen <jacob@hdreesen.de>

* [3.0] update Version

* [3.0] fixes for cart-creation process

* [3.0] adapt order backend detail view

* [3.0] allow custom prices to be set in admin for order creation

* [3.0] add missing function to interface

* Merge branch 'master' into 3.0 - stan

* [3.0] add simple precision test

* [Stan] fix stan issues

* [SEO] deprecate seo-bundle and use dachcom-digital/pimcore-seo instead

* Update README.md

* [SEO] fix stan issues

* [CartCollector] fix issue

* [Currency,Frontend] introduce currency fraction display provider service

* [Currency, Frontend] introduce currency fraction display provider service

* [CoreBundle, FrontendBundle] introduce tax-display service to determine if products should be displayed with or without tax

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [3.0] only suggest usage of dachcom-seo and keep CoreShop/Seo

* [CoreBundle] re-add public services

* New Crowdin translations (#1402)

* New translations admin.en.yml (Italian)

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>
Co-authored-by: cs-silentbob <cs-silentbob@users.noreply.github.com>
  • Loading branch information
3 people committed May 19, 2020
1 parent e4df090 commit c429578
Show file tree
Hide file tree
Showing 2,926 changed files with 36,071 additions and 55,108 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/behat.yml
@@ -1,9 +1,9 @@
name: Behat
on:
push:
branches: [ master, '3.0' ]
branches: [ '3.0' ]
pull_request:
branches: [ master, '3.0' ]
branches: [ '3.0' ]

jobs:
behat:
Expand All @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
php: [7.2, 7.3, 7.4]
symfony: [~3.4, ^4.0]
symfony: [^4.0]
pimcore: [~6.6.0, dev-master]

steps:
Expand Down Expand Up @@ -81,4 +81,4 @@ jobs:
run: bin/console assets:install --symlink web

- name: Run Behat
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist -p default
94 changes: 94 additions & 0 deletions .github/workflows/behat_ui.yml
@@ -0,0 +1,94 @@
name: Behat UI
on:
push:
branches: [ '3.0' ]
pull_request:
branches: [ '3.0' ]

jobs:
behat:
runs-on: ubuntu-latest
env:
PIMCORE_ENVIRONMENT: "test"
CORESHOP_TEST: 1
PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/coreshop_test"
PANTHER_EXTERNAL_BASE_URI: "http://localhost:9080/app_test.php"
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: coreshop_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [7.2, 7.3, 7.4]
symfony: [^4.0]
pimcore: [~6.6.0, dev-master]

steps:
- uses: actions/checkout@v2
- uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '80.0.3987.106'

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl

- name: Check PHP Version
run: php -v

- name: Start mysql service
run: sudo /etc/init.d/mysql start

- name: Verify MySQL connection from host
run: |
sudo apt-get install -y mysql-client
mysql -uroot -h127.0.0.1 -proot -e "SHOW DATABASES"
- name: Setup mysql
run: |
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_file_format=Barracuda;"
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_large_prefix=1;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE coreshop_test CHARSET=utf8mb4;"
- name: Copy parameters.yml
run: cp app/config/parameters.example.yml app/config/parameters.yml

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer install
run: |
composer config minimum-stability dev
composer config prefer-stable true
composer req pimcore/pimcore:${{ matrix.pimcore }} symfony/symfony:${{ matrix.symfony }} --no-interaction --no-scripts --no-update
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Cache clear
run: bin/console cache:clear

- name: Assets Install
run: bin/console assets:install --symlink web

- name: Setup Symfony CLI
run: wget https://get.symfony.com/cli/installer -O - | bash

- name: Run Symfony Webserver
run: ~/.symfony/bin/symfony server:start --port=9080 --dir=web --force-php-discovery --daemon

- name: Run Behat
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist -p ui
4 changes: 2 additions & 2 deletions .github/workflows/stan.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
php: [7.3, 7.4]

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -66,6 +66,6 @@ jobs:

- name: STAN
run: |
cp -f app/config/config_test.yml app/config/config_dev.yml
cp -f app/config/config_stan.yml app/config/config_dev.yml
bin/console cache:warmup --env=dev
vendor/bin/phpstan analyse -c phpstan.neon src -l 3
16 changes: 5 additions & 11 deletions .gitignore
Expand Up @@ -40,20 +40,14 @@ atlassian-ide-plugin.xml
.project
ehthumbs.db
Thumbs.db
Vagrantfile
.vagrant
php-cgi.core
.sass-cache
views/template/default/data/categories.csv
views/template/default/data/products.csv
TestController.php
tests/output
tests/tmp
generate-and-copy.sh
docs/generate-api.sh
docs/generate-docs.sh
output/
tmp/
phpda.html
parameters.yml
var
.env
composer.lock
docker-compose.yml
app/config/local/
app/config/pimcore/
74 changes: 74 additions & 0 deletions .travis.yml
@@ -0,0 +1,74 @@
sudo: false
language: php

addons:
mariadb: '10.2'
hosts:
- pimcore-test.dev
services:
- mysql
env:
global:
- PIMCORE_ENVIRONMENT=test
- PIMCORE_TEST_DB_DSN="mysql://root@localhost/coreshop_test"
- PIMCORE_VERSION="^6.6"
- CORESHOP_TEST=1
- CORESHOP_SUITE=application

matrix:
include:
- sudo: required
php: 7.2
env:
- CORESHOP_SUITE=codestyle

- sudo: required
php: 7.2
env:
- CORESHOP_SUITE=stan
- PIMCORE_VERSION="~6.6.0"

- sudo: required
php: 7.3
env:
- CORESHOP_SUITE=stan
- PIMCORE_VERSION="~6.6.0"

- sudo: required
php: 7.2
env:
- PIMCORE_VERSION="~6.6.0"

- sudo: required
php: 7.3
env:
- PIMCORE_VERSION="~6.6.0"

- sudo: required
php: 7.2
env:
- PIMCORE_VERSION="dev-master"
- sudo: required
php: 7.3
env:
- PIMCORE_VERSION="dev-master"
allow_failures:
- env:
- CORESHOP_SUITE=codestyle
- env:
- PIMCORE_VERSION="dev-master"
fast_finish: true

cache:
directories:
- $HOME/.cache/composer

install:
- etc/travis/install

script:
- etc/travis/script

notifications:
email:
- travis-ci@coreshop.org
1 change: 1 addition & 0 deletions CHANGELOG-3.0.x.md
@@ -0,0 +1 @@
# Within 3.0
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -5,7 +5,9 @@
**CoreShop - Pimcore eCommerce**

[![Join the chat at https://gitter.im/coreshop/coreshop](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/coreshop/coreshop?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.com/coreshop/CoreShop.svg?branch=master)](https://travis-ci.com/coreshop/CoreShop)
![Behat UI Tests](https://github.com/coreshop/CoreShop/workflows/PHP%20Stan/badge.svg)
![Behat UI Tests](https://github.com/coreshop/CoreShop/workflows/Behat%20UI/badge.svg)
![Behat UI Tests](https://github.com/coreshop/CoreShop/workflows/Behat/badge.svg)
[![Software License](https://img.shields.io/badge/license-GPLv3-brightgreen.svg?style=flat)](LICENSE.md)
[![Latest Pre-Release](https://img.shields.io/packagist/vpre/coreshop/core-shop.svg)](https://www.packagist.org/packages/coreshop/core-shop)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/coreshop/coreshop.svg)](https://www.scrutinizer-ci.com/g/coreshop/CoreShop/)
Expand All @@ -15,10 +17,10 @@
![CoreShop Interface](docs/img/screenshot5.png)

# Requirements
* Pimcore 6.0
* Pimcore 6.6

# Installation
- Install with composer ```composer require coreshop/core-shop:^2.2```
- Install with composer ```composer require coreshop/core-shop:^3.0```
- Run enable Bundle command
```php bin/console pimcore:bundle:enable CoreShopCoreBundle```
- Run Install Command
Expand Down
110 changes: 110 additions & 0 deletions UPGRADE-3.0.x.md
@@ -0,0 +1,110 @@
# Upgrade to 3.0

## Type Hints
CoreShop now completely implemented PHP Type Hints where applicable. This is one of the main reason a simple upgrade
will not work. You have to check all your extension points for compliance to interface declarations.

## Cart and Quote are now Order
The Cart and Quote Class are now the Order Class as well. Since these entities are similar, it makes sense to just use one.

### Migration
CoreShop will not provide any migration Script to convert carts/quotes into Orders. That is impossible for us to provide.
The Order is basically the same as before, so you can create custom migrations to move them.

Only thing we migrate is for existing orders eg. add new Fields or set the initial state.

### Difference between Cart, Quote and Order
To differentiate between them, we introduced a new Workflow and State Field called "saleType". The "saleType" currently
supports 3 types: "Cart", "Quote" and "Order". Workflow Transitions are used to move the Object to a different folder
or otherwise further process data within the Entity. The standard Workflow looks like this:


```yaml
core_shop_workflow:
state_machine:
coreshop_order_sales_type:
places:
- cart
- order
- quote
transitions:
order:
from: [cart]
to: order
quote:
from: [cart]
to: quote
cart:
from: [cart]
to: cart
place_colors:
cart: '#61c2cb'
order: '#feb624'
quote: '#f2583e'
transition_colors:
order: '#feb624'
quote: '#f2583e'
callbacks:
after:
add_to_history:
priority: 10
on: ['order', 'quote']
do: ['@CoreShop\Bundle\WorkflowBundle\History\StateHistoryLoggerInterface', 'log']
args: ['object', 'event']
```

Per default it is also not allowed to change a committed Order back to a Cart. But we will provide a way to cancel Orders
and re-create a Cart out of it.

## Order Changes with Base Values
CoreShop stores the total, subtotal, etc. Values twice per Order. Once in the Customer choosen Currency, and once in the
Store's base currency. Those values used to be called "baseValues". With 3.0 we switched that around, so the "normal" numbers
are the Store' based currency values and the Customer's choosen Currency are called "converted" Values and are accessible in
getters like "getConvertedTotal", "getConvertedItemDiscountPrice", etc.

For the migration from 2.x to 3.x, we take care about storing the values in the right field.

# Shipping Price Calculation
Introduced the context parameter like we have for Product Price Calculation to determine certain context variables like
store or currency.

## Price Twig Helper changed signature

from

```
product|coreshop_product_price(with_tax, coreshop.context)
product|coreshop_product_retail_price(with_tax, coreshop.context)
product|coreshop_product_discount(with_tax, coreshop.context)
product|coreshop_product_discount_price(with_tax, coreshop.context)
```

to

```
product|coreshop_product_price(coreshop.context, with_tax)
product|coreshop_product_retail_price(coreshop.context, with_tax)
product|coreshop_product_discount(coreshop.context, with_tax)
product|coreshop_product_discount_price(coreshop.context, with_tax)
```

## PHP Template Engine Helpers removed
The PHP Engine has been deprecated by Symfony. Since that, we don't have plans to further support it as well.

## CoreShop\Component\Index\Model\IndexableInterface Signature changed

From

```php
public function getIndexable();
public function getIndexableEnabled();
public function getIndexableName($language);
```

To

```php
public function getIndexable(IndexInterface $index): bool
public function getIndexableEnabled(IndexInterface $index): bool
public function getIndexableName(IndexInterface $index, string $language): string
```

0 comments on commit c429578

Please sign in to comment.