Download the PHP package walkwizus/magento2-module-virtual-attribute-sales-rule without Composer

On this page you can find all versions of the php package walkwizus/magento2-module-virtual-attribute-sales-rule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-module-virtual-attribute-sales-rule

Walkwizus Virtual Attribute Sales Rule for Magento 2

Overview

The Virtual Attribute Sales Rule module for Magento 2 allows you to add virtual attributes to product and address conditions in Sales Rules. This module enhances the flexibility of your promotional rules by introducing custom, dynamic attributes that can be used in rule conditions.

Features

Requirements

Installation

Using Composer

  1. In your Magento 2 root directory, run the following command:

  2. Enable the module:

  3. Run the Magento setup upgrade:

Usage

After installation, the module will automatically add the configured virtual attributes to the list of available conditions when creating or editing a Sales Rule in the Magento admin panel.

To use a virtual attribute in a rule:

  1. Go to Marketing > Promotions > Cart Price Rules
  2. Create a new rule or edit an existing one
  3. In the Conditions / Actions tab, you will see the new virtual attributes available for selection

Adding Custom Virtual Attributes

To add your own virtual attributes:

  1. Create a new class that implements Walkwizus\VirtualAttributeSalesRule\Api\Data\VirtualAttributeInterface
  2. Implement the required methods: getLabel(), getType(), getValue(), and getOptionSource() (if applicable)
    • Note: The getOptionSource() method is only necessary for attributes of type 'select' or 'multiselect'
  3. Add your new attribute to the di.xml file:

    Or for address attributes:

Types returned by getType()

The following table illustrates the different types that should be returned by the getType() method:

Type Description
string A text value
numeric A number (integer or float)
date A date value
select A single selection from a list of options
boolean A true/false value
multiselect Multiple selections from a list of options

Note: For 'select' and 'multiselect' types, you must implement the getOptionSource() method to provide the list of available options.

Examples of Custom Virtual Attributes

Here are two examples of how to create custom virtual attributes:

  1. Product Virtual Attribute Example (with select type):

  2. Address Virtual Attribute Example (with boolean type):

In these examples, ProductCustomAttribute creates a custom select attribute for products and implements getOptionSource(), while AddressCustomAttribute creates a boolean attribute for addresses and doesn't need to implement getOptionSource(). You can customize these examples to fit your specific needs.

Support

If you encounter any issues or have questions, please open an issue on our GitHub repository.


All versions of magento2-module-virtual-attribute-sales-rule with dependencies

PHP Build Version
Package Version
Requires magento/framework Version ^103
php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package walkwizus/magento2-module-virtual-attribute-sales-rule contains the following files

Loading the files please wait ....