Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Declare the new import entity:
```xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd">
<entity name="learning" label="Learning Courses Import" model="OrangeCompany\Learning\Model\Import\Courses"
<entity name="learning" label="Learning Courses Import" model="ExampleCorp\Learning\Model\Import\Courses"
behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" />
</config>
```
Expand All @@ -54,12 +54,12 @@ As we extend the [Magento/ImportExport/Model/Import/Entity/AbstractEntity][0]{:t
- `getEntityTypeCode` - EAV entity type code getter
- `validateRow` - Validating the row

> `OrangeCompany/Learning/Model/Import/Courses.php`
> `ExampleCorp/Learning/Model/Import/Courses.php`

{% collapsible File content for Courses.php %}

```php
namespace OrangeCompany\Learning\Model\Import;
namespace ExampleCorp\Learning\Model\Import;

use Exception;
use Magento\Framework\App\ResourceConnection;
Expand Down Expand Up @@ -426,7 +426,7 @@ The validation rules will be checking for a required **name** and a greater than

To add the ability to download a sample csv file for our new entity, create the following file:

``OrangeCompany/Learning/Files/Sample/learning.csv``
``ExampleCorp/Learning/Files/Sample/learning.csv``

With the following content:

Expand All @@ -449,7 +449,7 @@ Next, register the sample file for our entity.
<type name="Magento\ImportExport\Model\Import\SampleFileProvider">
<arguments>
<argument name="samples" xsi:type="array">
<item name="learning" xsi:type="string">OrangeCompany_Learning</item>
<item name="learning" xsi:type="string">ExampleCorp_Learning</item>
</argument>
</arguments>
</type>
Expand Down
12 changes: 6 additions & 6 deletions src/guides/v2.3/ext-best-practices/tutorials/custom-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This tutorial shows you how to create and insert your own widget on the frontend
```xml
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
<widget class="OrangeCompany\Learning\Block\Widget\Test" id="orange_test_widget">
<widget class="ExampleCorp\Learning\Block\Widget\Test" id="orange_test_widget">
<label>My New Widget</label>
<description>This is a test widget!!!</description>
<parameters>
Expand Down Expand Up @@ -75,7 +75,7 @@ Add a text and a select field:
```xml
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
<widget class="OrangeCompany\Learning\Block\Widget\Test" id="orange_test_widget">
<widget class="ExampleCorp\Learning\Block\Widget\Test" id="orange_test_widget">
...
<parameters>
<parameter name="title" xsi:type="text" required="true" visible="true" sort_order="10">
Expand Down Expand Up @@ -129,10 +129,10 @@ After selecting the widget type and the layout location, we should be able to se
Create the block class that we provided on the widget's initialization, responsible for
rendering it on the frontend.

> `OrangeCompany/Learning/Block/Widget/Test`
> `ExampleCorp/Learning/Block/Widget/Test`

```php
namespace OrangeCompany\Learning\Block\Widget;
namespace ExampleCorp\Learning\Block\Widget;

use Magento\Framework\View\Element\Template;
use Magento\Widget\Block\BlockInterface;
Expand All @@ -147,11 +147,11 @@ class Test extends Template implements BlockInterface

And finally, create the template that will be used for showing the widget's data on the frontend.

> `OrangeCompany/Learning/view/frontend/templates/widget/test.phtml`
> `ExampleCorp/Learning/view/frontend/templates/widget/test.phtml`

```php
<?php
/** \OrangeCompany\Learning\Block\Widget\Test $block */
/** \ExampleCorp\Learning\Block\Widget\Test $block */
?>
<h3><?= $block->escapeHtml($block->getData('title')) ?></h3>
<h3><?= $block->escapeHtml(__('Size:')) ?> <?= $block->escapeHtml($block->getData('size')) ?></h3>
Expand Down
6 changes: 3 additions & 3 deletions src/guides/v2.3/extension-dev-guide/build/di-xml-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,16 @@ If you want to override a public or protected method from a core class, utilize
Here is an example of overriding a method from a core file:

```xml
<!-- app/code/OrangeCompany/OverrideExample/etc/di.xml -->
<!-- app/code/ExampleCorp/OverrideExample/etc/di.xml -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Checkout\Block\Onepage\Success" type="OrangeCompany\OverrideExample\Block\Onepage\Success" />
<preference for="Magento\Checkout\Block\Onepage\Success" type="ExampleCorp\OverrideExample\Block\Onepage\Success" />
</config>
```

The example below overrides the `isVisible` method from the `Magento\Checkout\Block\Onepage\Success` block class.

```php
namespace OrangeCompany\OverrideExample\Block\Onepage;
namespace ExampleCorp\OverrideExample\Block\Onepage;

class Success extends \Magento\Checkout\Block\Onepage\Success
{
Expand Down
14 changes: 7 additions & 7 deletions src/guides/v2.3/extension-dev-guide/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ You can add a `before` or `after` parameter in the `module` entry to override or
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="customer">
<module name="OrangeCompany_RoutingExample" before="Magento_Customer" />
<module name="ExampleCorp_RoutingExample" before="Magento_Customer" />
</route>
</router>
</config>
```

This configuration tells the `FrontController` to look for actions in the `OrangeCompany_RoutingExample` module before searching in the `Magento_Customer` module.
If `app/code/OrangeCompany/RoutingExample/Controller/Account/Login.php` exists, it will use that file for processing the login route instead of the original class.
This configuration tells the `FrontController` to look for actions in the `ExampleCorp_RoutingExample` module before searching in the `Magento_Customer` module.
If `app/code/ExampleCorp/RoutingExample/Controller/Account/Login.php` exists, it will use that file for processing the login route instead of the original class.

## Action class

Expand Down Expand Up @@ -185,7 +185,7 @@ Declaring a new route:
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="routing" frontName="routing">
<module name="OrangeCompany_RoutingExample" />
<module name="ExampleCorp_RoutingExample" />
</route>
</router>
</config>
Expand Down Expand Up @@ -215,7 +215,7 @@ Defining a new custom router:
<arguments>
<argument name="routerList" xsi:type="array">
<item name="routingExample" xsi:type="array">
<item name="class" xsi:type="string">OrangeCompany\RoutingExample\Controller\Router</item>
<item name="class" xsi:type="string">ExampleCorp\RoutingExample\Controller\Router</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">40</item>
</item>
Expand All @@ -230,7 +230,7 @@ Creating the controller that will handle the `routing` route and will get the pa
<?php
declare(strict_types=1);

namespace OrangeCompany\RoutingExample\Controller\Index;
namespace ExampleCorp\RoutingExample\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
Expand Down Expand Up @@ -283,7 +283,7 @@ In the end, let's create the router class, that will match the custom route name
<?php
declare(strict_types=1);

namespace OrangeCompany\RoutingExample\Controller;
namespace ExampleCorp\RoutingExample\Controller;

use Magento\Framework\App\Action\Forward;
use Magento\Framework\App\ActionFactory;
Expand Down
12 changes: 6 additions & 6 deletions src/guides/v2.3/extension-dev-guide/view-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ The use of helpers in templates is discouraged. It is recommended to use view mo

## How to write view models

View models can be used by passing the view model class as an argument to a template's block in the page layout configuration file. In the following example snippet, `MyNewViewModel` is the view model class of the OrangeCompany_Catalog module passed as an argument to a block.
View models can be used by passing the view model class as an argument to a template's block in the page layout configuration file. In the following example snippet, `MyNewViewModel` is the view model class of the ExampleCorp_Catalog module passed as an argument to a block.

```xml
<block name="orangeco.new.viewmodel" template="OrangeCompany_Catalog::example.phtml">
<block name="examplecorp.new.viewmodel" template="ExampleCorp_Catalog::example.phtml">
<arguments>
<argument name="view_model" xsi:type="object">OrangeCompany\Catalog\ViewModel\MyNewViewModel</argument>
<argument name="view_model" xsi:type="object">ExampleCorp\Catalog\ViewModel\MyNewViewModel</argument>
</arguments>
</block>
```
Expand All @@ -34,15 +34,15 @@ In the following example, the same view model is used with an existing block in
```xml
<referenceBlock name="checkout.cart.item.renderers.default">
<arguments>
<argument name="view_model" xsi:type="object">OrangeCompany\Catalog\ViewModel\MyNewViewModel</argument>
<argument name="view_model" xsi:type="object">ExampleCorp\Catalog\ViewModel\MyNewViewModel</argument>
</arguments>
</referenceBlock>
```

The view model class must always implement the interface `\Magento\Framework\View\Element\Block\ArgumentInterface`. For example:

```php
namespace OrangeCompany\Catalog\ViewModel;
namespace ExampleCorp\Catalog\ViewModel;

class MyNewViewModel implements \Magento\Framework\View\Element\Block\ArgumentInterface
{
Expand All @@ -58,7 +58,7 @@ You can access the public methods for the view model class in the template:
```html
<?php

/** @var $viewModel \OrangeCompany\Catalog\ViewModel\MyNewViewModel */
/** @var $viewModel \ExampleCorp\Catalog\ViewModel\MyNewViewModel */

$viewModel = $block->getViewModel();

Expand Down
6 changes: 3 additions & 3 deletions src/guides/v2.3/frontend-dev-guide/css-topics/css-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ In the Blank theme, the buttons of the `.action.primary` class, so called *prima

![The default view of a product page, with the orange Add to Cart button]

OrangeCo wants to change the color of the primary buttons to orange. To achieve this, they do the following:
ExampleCorp wants to change the color of the primary buttons to orange. To achieve this, they do the following:

1. Create a new Orange theme, which inherits from the Blank [theme](https://glossary.magento.com/theme).
1. In the Orange theme directory add the overriding `app/design/frontend/OrangeCo/orange/web/css/source/_theme.less` file with the following code:
1. In the Orange theme directory add the overriding `app/design/frontend/ExampleCorp/orange/web/css/source/_theme.less` file with the following code:

```less
// Primary button
Expand All @@ -58,7 +58,7 @@ OrangeCo wants to change the color of the primary buttons to orange. To achieve
@button-primary__hover__border: 1px solid @color-orange-red2;
```

When OrangeCo [applies their theme]({{ page.baseurl }}/frontend-dev-guide/themes/theme-apply.html), the primary buttons will look like on the following image:
When ExampleCorp [applies their theme]({{ page.baseurl }}/frontend-dev-guide/themes/theme-apply.html), the primary buttons will look like on the following image:

![The customized view of a product page, with the grey Add to Cart button]

Expand Down
10 changes: 5 additions & 5 deletions src/guides/v2.3/frontend-dev-guide/css-topics/css-practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ This topic features a step-by-step illustration of how to change a theme's color

## Changing theme color scheme

OrangeCo created a custom theme that inherits from the Magento basic Blank theme.
ExampleCorp created a custom theme that inherits from the Magento basic Blank theme.
The following image illustrates how store pages look when the Blank theme is applied:

![product page when Blank applied]

In their Grey theme, OrangeCo wants to change the color scheme from white to grey.
In their Grey theme, ExampleCorp wants to change the color scheme from white to grey.

The Grey theme directory is `app/design/frontend/OrangeCo/grey`.
The Grey theme directory is `app/design/frontend/ExampleCorp/grey`.

OrangeCo decided to use the Magento UI library, so to change the color scheme, they need to define new values for certain default Less variables.
To do this, they added an overriding `_theme.less` file in the `app/design/frontend/OrangeCo/grey/web/css/source` directory, with the following content:
ExampleCorp decided to use the Magento UI library, so to change the color scheme, they need to define new values for certain default Less variables.
To do this, they added an overriding `_theme.less` file in the `app/design/frontend/ExampleCorp/grey/web/css/source` directory, with the following content:

```less
// Color nesting
Expand Down
18 changes: 9 additions & 9 deletions src/guides/v2.3/frontend-dev-guide/layouts/layout-practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This article features a step-by-step illustration of how a real-life layout cust

## Moving customer account links

In their Orange theme, OrangeCo wants to transform the header links block to a drop-down, the way it is done in the Magento Luma theme:
In their Orange theme, ExampleCorp wants to transform the header links block to a drop-down, the way it is done in the Magento Luma theme:

![layout transform]

Expand Down Expand Up @@ -72,7 +72,7 @@ The markup required for the drop-down is the following:

### Step 1: Define the layout blocks

OrangeCo [applies the Luma theme]({{ page.baseurl }}/frontend-dev-guide/themes/theme-apply.html). Using the approach described in [Locate templates, layouts, and styles]({{ page.baseurl }}/frontend-dev-guide/themes/debug-theme.html) they find out that the original block responsible for displaying the header links is defined in
ExampleCorp [applies the Luma theme]({{ page.baseurl }}/frontend-dev-guide/themes/theme-apply.html). Using the approach described in [Locate templates, layouts, and styles]({{ page.baseurl }}/frontend-dev-guide/themes/debug-theme.html) they find out that the original block responsible for displaying the header links is defined in

`<Magento_Theme_module_dir>/view/frontend/layout/default.xml`:

Expand Down Expand Up @@ -119,7 +119,7 @@ The links that should be in header, but outside the drop-down menu are added in

### Step 2: Define the templates

Similar to the way they defined the layout on the previous step, OrangeCo
Similar to the way they defined the layout on the previous step, ExampleCorp
defines the template which is used as the drop-down container : `<Magento_Customer_module_dir>/view/frontend/templates/account/customer.phtml`.

```php
Expand Down Expand Up @@ -166,11 +166,11 @@ See [app/code/Magento/Customer/view/frontend/templates/account/customer.phtml]({

### Step 3: Extend the base layout to add a block

OrangeCo needs to create a new block, say, `header.links`, in the `header.panel` container, to move the links there. As the links can be added to this list by different modules, it is better to add this block to the `default.xml` page configuration of the `Magento_Theme` module.
ExampleCorp needs to create a new block, say, `header.links`, in the `header.panel` container, to move the links there. As the links can be added to this list by different modules, it is better to add this block to the `default.xml` page configuration of the `Magento_Theme` module.

So the following [extending]({{ page.baseurl }}/frontend-dev-guide/layouts/layout-extend.html) layout is added in the Orange theme:

`app/design/frontend/OrangeCo/orange/Magento_Theme/layout/default.xml`
`app/design/frontend/ExampleCorp/orange/Magento_Theme/layout/default.xml`

```xml
<?xml version="1.0"?>
Expand All @@ -189,9 +189,9 @@ So the following [extending]({{ page.baseurl }}/frontend-dev-guide/layouts/layou

### Step 4: Move links

To move the links to the `header.links` block, OrangeCo adds an extending layout:
To move the links to the `header.links` block, ExampleCorp adds an extending layout:

`app/design/frontend/OrangeCo/orange/Magento_Customer/layout/default.xml`
`app/design/frontend/ExampleCorp/orange/Magento_Customer/layout/default.xml`

```xml
<?xml version="1.0"?>
Expand All @@ -214,12 +214,12 @@ Now the customer links look like following:

Clicking the **Change** button toggles the `active` CSS class:

To add quick basic styling and visual behavior to the "dropdown" menu, OrangeCo added [_extend.less]({{ page.baseurl }}/frontend-dev-guide/css-guide/css_quick_guide_approach.html#simple_extend) to their theme with the following customizations:
To add quick basic styling and visual behavior to the "dropdown" menu, ExampleCorp added [_extend.less]({{ page.baseurl }}/frontend-dev-guide/css-guide/css_quick_guide_approach.html#simple_extend) to their theme with the following customizations:

* Redundant elements are hidden with CSS.
* The `.lib-dropdown()` mixin from [Magento UI library]({{ page.baseurl }}/frontend-dev-guide/css-topics/theme-ui-lib.html) was applied to the corresponding element.

`app/design/frontend/OrangeCo/orange/web/css/source/_extend.less`
`app/design/frontend/ExampleCorp/orange/web/css/source/_extend.less`

```css
//
Expand Down
12 changes: 6 additions & 6 deletions src/guides/v2.3/frontend-dev-guide/layouts/xml-manage.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ This adds an IE conditional comment in the generated HTML, like in the following

```html
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" media="all" href="<your_store_web_address>/pub/static/frontend/OrangeCo/orange/en_US/css/ie-9.css" />
<link rel="stylesheet" type="text/css" media="all" href="<your_store_web_address>/pub/static/frontend/ExampleCorp/orange/en_US/css/ie-9.css" />
<![endif]-->
```

In this example, `orange` is a custom theme created by the OrangeCo vendor.
In this example, `orange` is a custom theme created by the ExampleCorp vendor.

## Remove static resources (JavaScript, CSS, fonts) {#layout_markup_css_remove}

Expand Down Expand Up @@ -482,7 +482,7 @@ In the Magento Blank theme these elements are located as follows:
![]({{site.baseurl}}/common/images/layout_image1.png)

Place the stock availability and SKU blocks after product price block on a product page, and move the review block out of the product-info-price container.
To do this, add the extending `catalog_product_view.xml` in the `app/design/frontend/OrangeCo/orange/Magento_Catalog/layout/` directory:
To do this, add the extending `catalog_product_view.xml` in the `app/design/frontend/ExampleCorp/orange/Magento_Catalog/layout/` directory:

```xml
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
Expand Down Expand Up @@ -560,17 +560,17 @@ Here is an example of how a css class can be added to `<body>` tag on product vi
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Helper\Product\View">
<plugin name="add_custom_body_class_to_product_page"
type="OrangeCompany\Learning\Plugin\AddBodyClassToProductPagePlugin"/>
type="ExampleCorp\Learning\Plugin\AddBodyClassToProductPagePlugin"/>
</type>
</config>
```

> `OrangeCompany/Learning/Plugin/AddBodyClassToProductPagePlugin.php`
> `ExampleCorp/Learning/Plugin/AddBodyClassToProductPagePlugin.php`

```php
<?php

namespace OrangeCompany\Learning\Plugin;
namespace ExampleCorp\Learning\Plugin;

use Magento\Catalog\Helper\Product\View as ProductViewHelper;
use Magento\Framework\View\Result\Page;
Expand Down
Loading