Служба поддержки работает 24/7 — мы всегда на связи по вопросам хостинга и серверов.Открыт прием заявок на аренду выделенных серверов и размещение оборудования в дата-центре.Напоминаем: рекомендуем включить резервное копирование для дополнительной защиты данных.Доступна новая линейка VPS/VDS с NVMe-дисками и увеличенной производительностью.Технические работы на части серверов завершены. Все сервисы работают в штатном режиме.

MODULE FOR 1C-BITRIX

Dmitry Krotov

PHP condition in cart rules for implementing custom discount and markup conditions

The module adds a new 'PHP Condition' to shopping cart rules for flexible management of discounts and markups. This enables implementing custom logic for applying discounts at the PHP function level, determining exactly which customers, orders, or products qualify. You can place arbitrary PHP code in the condition field.

Technical details

Published
12.05.2022
Version
1.0.0
Installed
100 - 499 times
Adaptability
No
Composite support
No
Compatible with Sites24
No
Developer
Dmitry Krotov

What this solution does

The module adds a new 'PHP Condition' to shopping cart rules for flexible management of discounts and markups. This enables implementing custom logic for applying discounts at the PHP function level, determining exactly which customers, orders, or products qualify.

You can place arbitrary PHP code in the condition field. The execution result must be a boolean value: true (the discount or markup is applied) or false (application is denied). Note for developers: the code is executed via the eval() function within the standard discount handler of the sale module.

The most common use case involves passing a custom function. The variable $arOrder is automatically passed to it. If the calculation is for a specific product, the variable holds a temporary order for that item. If the calculation covers the entire cart, the variable contains the current order with the full list of products.

The 'PHP Condition' can be combined with other shopping cart rule parameters.

Examples of discount and markup scenarios implementable with this module:

The module allows setting arbitrary conditions for calculating discounts and markups in the shopping cart using PHP code. It supports implementing logic based on the traffic source or advertising campaign, setting different prices for various devices or geographic regions, and configuring progressive discount systems.

General iT can install and configure this module and check how it works on your website.

YOUR PROJECT INFRASTRUCTURE

A home for your website

BEFORE YOU ORDER

Let’s go through the details.

How do I purchase a solution?
Submit a request on the solution page. A manager will check your selection, confirm the terms and arrange the purchase. We can also help with installation and setup.
Is a 1C-Bitrix licence included?
The default price covers the solution itself. If the developer offers a bundle with a 1C-Bitrix licence, you can select it separately on the solution page.
Can I try a solution first?
Available online demos and trial periods are shown on the solution page. The trial length depends on the solution.
How much does renewal cost?
Renewal is calculated as 50% of the full solution price before discounts. A manager will confirm the renewal terms and period before you order.
Can you help implement the solution?
Yes. We can build a website or store based on a template, or install, configure and check a module for compatibility. The scope and cost of the work are agreed separately.

GENERAL iT

Let’s discuss your project

Получатель: ООО «Дженерал Ай Ти Рус»

1C-BITRIX

Install solution

Enter a domain with or without https://. The installer will open in your website control panel in a new tab.

Solution screenshots

Solution screenshot