Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
46,186 changes: 46,186 additions & 0 deletions docs/api/php_api/php_api_reference/namespaces/ibexa-contracts-shoppinglist.html

Large diffs are not rendered by default.

218 changes: 215 additions & 3 deletions docs/api/rest_api/rest_api_reference/rest_api_reference.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/commerce/commerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The commerce component of [[= product_name =]] covers various areas of managing

[[= cards([
"commerce/cart/cart",
"commerce/shopping_list/shopping_list",
"commerce/checkout/checkout",
"commerce/order_management/order_management",
"commerce/payment/payment",
Expand Down
61 changes: 61 additions & 0 deletions docs/commerce/shopping_list/install_shopping_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---

Check warning on line 1 in docs/commerce/shopping_list/install_shopping_list.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/install_shopping_list.md#L1

[Ibexa.ReadingLevel] The grade level is 6.11. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 6.11. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/commerce/shopping_list/install_shopping_list.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Install the Shopping list LTS update.
editions: lts-update commerce
month_change: true
---

# Install Shopping List

## Install framework

Run the following command to install the package:

``` bash
composer require ibexa/shopping-list
```

TODO: Describe what install does

Check that the following line have been added by the recipe to `config/bundles.php` file's array:
```php
Ibexa\Bundle\ShoppingList\IbexaShoppingListBundle::class => ['all' => true],
```

## Modify database schema

Add the tables needed by the bundle:

=== "MySQL"

```bash
php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/shopping-list/src/bundle/Resources/config/schema.yaml | mysql -u <username> -p <password> <database_name>
```

=== "PostgreSQL"

```bash
php bin/console ibexa:doctrine:schema:dump-sql --force-platform=postgres vendor/ibexa/shopping-list/src/bundle/Resources/config/schema.yaml | psql <database_name>
```

TODO: possible charset issue, see https://github.com/ibexa/doctrine-schema/pull/38

TODO: Default shopping list creation for existing customers?

## Configure

TODO

TODO: `ibexa.site_access.config.default.shopping_list.pagination.list_per_page_limit`

TODO: Probably a file that will be created by recipe:

Check warning on line 50 in docs/commerce/shopping_list/install_shopping_list.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/install_shopping_list.md#L50

[Ibexa.FutureTense] Use present tense instead of future.
Raw output
{"message": "[Ibexa.FutureTense] Use present tense instead of future.", "location": {"path": "docs/commerce/shopping_list/install_shopping_list.md", "range": {"start": {"line": 50, "column": 28}}}, "severity": "WARNING"}

```yaml
# config/routes/ibexa_shopping_list.yaml

ibexa.shopping_list:
resource: '@IbexaShoppingListBundle/Resources/config/routing.yaml'

ibexa.rest.shopping_list:
resource: '@IbexaShoppingListBundle/Resources/config/routing_rest.yaml'
prefix: '%ibexa.rest.path_prefix%'
```
31 changes: 31 additions & 0 deletions docs/commerce/shopping_list/shopping_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---

Check warning on line 1 in docs/commerce/shopping_list/shopping_list.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/shopping_list.md#L1

[Ibexa.ReadingLevel] The grade level is 10.47. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 10.47. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/commerce/shopping_list/shopping_list.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Shopping list feature allows to store potential purchases, recurrent product sets, and other wish lists for later use into carts.
page_type: landing_page
month_change: true
editions: lts-update commerce
---

# Shopping list

A shopping list allows to store potential purchases, recurrent product set, and other wishes for later use into cart.
A user can have several shopping lists.

TODO: more precise introduction

## Getting Started

[[= cards([
"commerce/shopping_list/shopping_list_guide",
"commerce/shopping_list/install_shopping_list",
], columns=2) =]]

## Development

[[= cards([
("api/php_api/php_api_reference/namespaces/ibexa-contracts-shoppinglist.html", "PHP API Reference", "<code>Ibexa\Contracts\ShoppingList</code>"),
("api/rest_api/rest_api_reference/rest_api_reference.html#tag/Shopping-Lists", "REST API Reference", "<code>commerce/shopping-list</code> resources"),
], columns=2) =]]

TODO:

- Custom storefront: JS API, design, templates,…
31 changes: 31 additions & 0 deletions docs/commerce/shopping_list/shopping_list_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---

Check warning on line 1 in docs/commerce/shopping_list/shopping_list_guide.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/shopping_list_guide.md#L1

[Ibexa.ReadingLevel] The grade level is 8.84. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 8.84. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/commerce/shopping_list/shopping_list_guide.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Shopping list feature allows to store potential purchases, recurrent product set, and other whish lists for later use into carts.
month_change: true
editions: lts-update commerce
---

# Shopping list feature guide

Shopping lists give customers a simple yet powerful way to manage future purchases.

Check warning on line 9 in docs/commerce/shopping_list/shopping_list_guide.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/shopping_list_guide.md#L9

[Ibexa.VerySimply] Avoid using 'simple'.
Raw output
{"message": "[Ibexa.VerySimply] Avoid using 'simple'.", "location": {"path": "docs/commerce/shopping_list/shopping_list_guide.md", "range": {"start": {"line": 9, "column": 33}}}, "severity": "WARNING"}
It can cover many purchase planning cases.
For example, users can save in shopping lists frequently rebought supplies, products which still need some customisation reflexion, acquisition project still needing discussion, or budget validation.

TODO: Limitation: Shopping list doesn't store quantity

Knowing products added to shopping lists, sellers can organise campaign about most added products, encourage conversion.

Check failure on line 15 in docs/commerce/shopping_list/shopping_list_guide.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/shopping_list_guide.md#L15

[Ibexa.British] Use the US spelling 'organize' instead of the British 'organise'.
Raw output
{"message": "[Ibexa.British] Use the US spelling 'organize' instead of the British 'organise'.", "location": {"path": "docs/commerce/shopping_list/shopping_list_guide.md", "range": {"start": {"line": 15, "column": 55}}}, "severity": "ERROR"}

TODO: develop a bit more.
TODO: Other personas?

## Shopping list management overview

Each user have a default shopping list and can create new ones.
TODO: Policy: Is there a policy to add to customer role to enable shopping list features?
TODO: Limit: How many shopping lists can be created per user?

A customer can create a shopping list
- from catalog when adding a product to a shopping list and choosing to create a new one instead of targeting an existing one
- in shopping lists management interface
- TODO: when saving for later from cart to shopping list?

A shopping list is named

Check warning on line 31 in docs/commerce/shopping_list/shopping_list_guide.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/commerce/shopping_list/shopping_list_guide.md#L31

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/commerce/shopping_list/shopping_list_guide.md", "range": {"start": {"line": 31, "column": 25}}}, "severity": "WARNING"}
105 changes: 62 additions & 43 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,59 +64,78 @@ def cards(pages, columns=1, style="cards", force_version=False):
page = page_data
custom_title = None
custom_description = None
match = re.search("https://[^@/]+.ibexa.co", page)
if match:
with urllib.request.urlopen(page) as file:
content = file.read().decode('utf-8')
match = re.search("<meta property=\"og:title\" content=\"(.*)\"", content, re.MULTILINE)

path, hash = page.split("#") if "#" in page else (page, "")
if hash:
hash = '#' + hash

if re.search("^https://[^@/]+.ibexa.co", path):
html = True
content = urllib.request.urlopen(path).read().decode('utf-8')
elif re.search(".html$", path):
html = True
content = open("docs/%s" % path, "r").read()
page = '/'.join((
'/',
site,
language,
version,
page
))
else:
html = False
path = path.rstrip('/')
content = open("docs/%s.md" % path, "r").read()
page = '/'.join((
'/',
site,
language,
version,
path,
hash
))

if html:
match = re.search("<meta property=\"og:title\" content=\"(.*)\"", content, re.MULTILINE)
if match:
title = match.groups()[0]
else:
match = re.search("<title>(.*)</title>", content, re.MULTILINE)
if match:
title = match.groups()[0]
else:
match = re.search("<title>(.*)</title>", content, re.MULTILINE)
if match:
title = match.groups()[0]
else:
title = ""
match = re.search("<meta property=\"og:description\" content=\"(.*)\"", content, re.MULTILINE)
title = ""
match = re.search("<meta property=\"og:description\" content=\"(.*)\"", content, re.MULTILINE)
if match:
description = match.groups()[0]
else:
match = re.search("<meta name=\"description\" content=\"(.*)\"", content, re.MULTILINE)
if match:
description = match.groups()[0]
else:
match = re.search("<meta name=\"description\" content=\"(.*)\"", content, re.MULTILINE)
if match:
description = match.groups()[0]
else:
description = ""
href = page
description = ""
href = page
title = custom_title if custom_title else title
title = title.replace("(Ibexa Documentation)", "").strip()
description = custom_description if custom_description else description
else:
file, _ = page.split("#") if "#" in page else (page, "")
with open("docs/%s.md" % file, "r") as doc_file:
doc = doc_file.read()
match = re.search("^# (.*)", doc, re.MULTILINE)
if match:
header = match.groups()[0]
else:
header = ""
default_meta = {
"title": header,
"short": "",
"description": ""
}
doc_meta = {
**default_meta,
**meta.get_data(doc)[1]
}
href = '/'.join((
'/',
site,
language,
version,
page
))
title = custom_title if custom_title else doc_meta['short'] or doc_meta['title']
description = custom_description if custom_description else doc_meta['description'] or "&nbsp;"
match = re.search("^# (.*)", content, re.MULTILINE)
if match:
header = match.groups()[0]
else:
header = ""
default_meta = {
"title": header,
"short": "",
"description": ""
}
current_meta = {
**default_meta,
**meta.get_data(content)[1]
}
href = page
title = custom_title if custom_title else current_meta['short'] or current_meta['title']
description = custom_description if custom_description else current_meta['description'] or "&nbsp;"

cards.append(
CARDS_TEMPLATE % (
Expand Down
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ nav:
- Cart: commerce/cart/cart.md
- Cart API: commerce/cart/cart_api.md
- Quick order: commerce/cart/quick_order.md
- Shopping list:
- Shopping list: commerce/shopping_list/shopping_list.md
- Shopping list guide: commerce/shopping_list/shopping_list_guide.md
- Install shopping list: commerce/shopping_list/install_shopping_list.md
- Checkout:
- Checkout: commerce/checkout/checkout.md
- Configure checkout: commerce/checkout/configure_checkout.md
Expand Down
2 changes: 1 addition & 1 deletion tools/api_refs/api_refs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REST_API_OUTPUT_FILE=${3:-./docs/api/rest_api/rest_api_reference/rest_api_refere

DXP_EDITION='commerce'; # Edition from and for which the Reference is built
DXP_VERSION='5.0.*'; # Version from and for which the Reference is built
DXP_ADD_ONS=(automated-translation rector); # Packages not included in $DXP_EDITION but added to the Reference, listed without their vendor "ibexa"
DXP_ADD_ONS=(automated-translation rector shopping-list); # Packages not included in $DXP_EDITION but added to the Reference, listed without their vendor "ibexa"
DXP_EDITIONS=(oss headless experience commerce); # Available editions ordered by ascending capabilities
SF_VERSION='7.3'; # Symfony version used by Ibexa DXP
PHPDOC_VERSION='3.8.0'; # Version of phpDocumentor used to build the Reference
Expand Down