Arbitrary PHP condition of basket rules

Arbitrary PHP condition of basket rules

Suitable editions 1C-Bitrix:

small business


corporate portal


1C-Bitrix24: Online store + CRM

Bitrix24 in a box - Corporate portal

Bitrix24 in a box - Enterprise

4 000 rub.

The module is used to apply / cancel discounts in the shopping cart or order form.

1C-Bitrix provides a very powerful tool for implementing discounts on the site. Products participating in the promotion can be limited by various parameters: by category, by color, by name, and many other fields and properties. But, unfortunately, it is not always possible to implement the plan, relying on standard features.

phpcondition-new opportunities.png

Our module adds another additional condition to the list of possible additional rules for working with the bucketan arbitrary PHP condition. The value of this condition must be a Boolean expression that returns true or false.

Of course, this module is not from the category of "came, saw, won", but it is not necessary. It is rather "a semi-finished product that must be thoroughly warmed up and consumed". It is intended to simplify the activities of developers, and is not intended to solve any narrow limited range of tasks. In the right hands, you can use it to solve a huge variety of non-standard marketing programs.

The principle of operation is simple:

  • the standard rule for working with the basket is prepared;

  • if necessary, specify the standard conditions and restrictions;

  • in additional conditions, an arbitrary PHP expression is specified. We recommend that you prepare a function, because it is more convenient to describe your logic, your algorithm of application, and less likely to make mistakes. The result of this function must be true or false.
For example, in init.php prescribe a function:
function __sc_check() 
   if (conditions of use)
   {       return true;    }    else    {       return false;    } }
The name of your function and specify it in the PHP condition, in our case it is __sc_check().

In our practice, we have met with a large number of problems that are well solved with this module.

phpcondition-profit growth.png

For example:

1) On the basis of this module, we have developed another circulation module – Buy more – Pay less, which has already helped many people to implement their interesting, not quite standard ideas. These are such promotions as:

  • three for the price of two;

  • every second product at a discount;

  • discount on the cheapest product and much more.

With the help of PHP conditions and ingenuity, many other tasks are also implemented:

2) Different discounts for one coupon. To provide a different value discount based on the cost of all items in the cart, based on the number of goods, including the availability of any goods or properties, all in one coupon.

3) One-time reusable coupon. Restrict the use of the coupon by the same user many times, while not prohibiting others from using the same promo code.

4) Application of discounts / extra charges when selecting pick-up points in the order form.

5) Cancel the application of discounts if a coupon has already been applied.

6) Individual discount for each customer.

7) Discounts based on date, holiday, and more…


1) Uniqueness.

2) Information support:


feature articles.

3) Technical support: communication directly with developers, without managers.

Any other questions? Then contact us in any convenient way.

+7 (987) 700-54-78

Back to the list