Cloudscraper Software - Magento 2 development

How to use and develop the Cloudscraper system

Release 2.4.3-p1-100

TAG: R2.4.3-p1-100

branch: main

Release date: March 3, 2022

This release upgrades version R2.4.3-p1-C3.2

Contents

New in this version

This release only contains updates from the Cloudscraper development team. Magento 2.4.3 with security patch 1 is the base for this release.

Widgets on home pages

With the move to ElasticSearch, the widgets we use also apply ElasticSearch to find products in the data set. To enable the Featured Products Widget; first, the widget definition has been changed, and second, the product attribute is_featured options are adjusted such that you can use the attribute in searches, but also to make it visible in the product grid.

Typos on CMS pages

We have corrected several typos found in the CMS pages.

Sort order in Product List Widgets

We have added the possibility to define a product attribute to use to determine the sort order in a product list widget.

We defined an attribute, sort_order_featured, that you subsequently can use when you define the widget, such as on the home pages.

To define a product attribute through the menu:

Ensure that the attribute is available in the product grid by adding it to the column and the filter options.

To add a product attribute to an attribute set through the menu:

Add the attribute to all attribute sets used for products (e.g., the accessories attribute set).

When you define a widget in, for example, a CMS page, you have to enter the attribute you want to use for sorting purposes. The new attribute is (internally) called sort_order_featured. You use this name in the widget definition in the “Sort order featured product” field.

Essentially, we may define and use any attribute to sort a list of products that results from a widget.

We have added the new home page HTML code that includes the new widgets in the XML files used for importing blocks and pages.

Module implementing the functionality: bitpolar/sortcatalogwidget

Product attribute sets

In the backend you can define attribute sets that define the attributes for products or options. We have cleaned up the attribute sets: there were many, but they did not differ in attribute definitions.

We have created two new attribute sets (product and product option) that serve as the basis for a product, and a product option. We also have created the lists of attribute sets that can be used in the SQL-queries to assign and clean up.

We have created several SQL-queries to change the product attribute sets in a bulk action. Afterwards, the attribute sets need cleaning up: the groups that are connected to the attribute sets need to be removed as they will remain dangling (i.e., referring to no longer existing attribute sets).

Credit memo backend

We have changed the text in the credit memo entry page. It was unclear how exactly the credit works. With the change to the labels for the input fields, it now is clear. Unfortunately, the texts were also used in the credit memo email templates, so we have to recreate these as well.

To do so:

Restructuring styling scheme

We have restructured the scheme of styling files. The reason is to simplify the styling mechanism behind the application. We have corrected some styling in the blog and added user functionality in the comment section.

Patches from PHPStorm

With PHPStorm we can create patches from solution commits. The first example is the change of the PageSize parameter to allow the “webwinkelfacturen” coupling to work with the changed limits that have been introduced with Magento version 2.4.3 and 2.4.3-p1.

To apply the patch, put the patch file in the root directory of the magento store, and apply the patch:

cd ~/magento2
cp patches/PageSize_increased_to_1024_for_webwinkelfacturenkoppeling.patch .
git apply PageSize_increased_to_1024_for_webwinkelfacturenkoppeling.patch

Product URLs not all beautiful

For some odd reason, not all product URLs are what we call beautiful. They contain category and product ids in some cases. The solution is to recreate the URLs for all products in the categories.

See https://github.com/elgentos/regenerate-catalog-urls for the details on the module.

We have added this module to allow for programmatically changing the URL rewrites:

composer2 require elgentos/regenerate-catalog-urls --no-update
bin/magento setup:upgrade

Alternatively, use:

./myTools/afterUpdateMagento.sh -d debug

To use the tool:

Usage:
 regenerate:product:url [-s|--store="..."] [pids1] ... [pidsN]
 regenerate:category:url [-s]--store="..."] [cids1] ... [cidsN]
 regenerate:category:path [-s]--store="..."] [cids1] ... [cidsN]

Arguments:
 pids                  Products to regenerate
 cids                  Categories to regenerate

Options:
 --store (-s)          Use the specific Store View (default: 0)
 --help (-h)           Display this help message

So, for example:

# Regenerate url for all products and the global store
bin/magento regenerate:product:url

# Regenerate url for products with id (1, 2, 3, 4) for store 1
bin/magento regenerate:product:url -s1 1 2 3 4

PDF document creation

We have added a better layout of the PDF documents that you can generate for an order with this release. There are two templates available, Template1 and Template2, that you can use. The default in the configuration is set to Template1. We have selected the configuration such that the new module will work out of the box. You only have to add the two logo versions needed after installing the latest code version.

In addition, we have added options to access the PDF documents from the order grid and from the subviews when you select an order. Also, customers have access to these new PDF documents. When a customer logs in to their account, chooses the “My Orders” menu entry, and selects an order, the links to print the documents appear. Which document you can access depends on the context. For example, when you choose the Invoices, you can print the Invoice as a PDF document.

Pre Magento2 documents

We found that documents before the new system’s release (March 25, 2021) missed the products from the order. We have corrected the problem causing the behavior, and customers can now access all historical data we keep in our database for customers that have an account with us.

Also, the new PDF document styling will be used with the historical data we keep on orders, invoices, credit memos, and shipments. You can generate and download your (historical) information in PDF format.

Essentials for release

  1. After deployment, import the blocks and pages.
  2. Check the product attributes you need in searches for the correct optional settings.
  3. Define a product attribute sort_order_featured (Sort order featured product).
  4. Add the product attribute below the Is Featured? attribute for all attribute sets used for products.
  5. Add the sort order number for the products that are set as featured.
  6. Clean up the product attribute sets.
  7. Reinstall the email templates: delete, create and update.
  8. Add the logo’s for the PDF documents.
  9. Create new sitemaps in pub/sitemaps.

Goto the webstore release notes site

Home