Documentation

Shopping cart update events

Shopping cart update events

  • OnBeforeBasketAdd: fired prior to adding an item to a shopping cart. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    &arFields An array of fields containing information about a current shopping cart. You can use it to modify the shopping cart or product item data.
  • OnBasketAdd - fired after an item was added to a shopping cart.
    Parameters
    ParameterDescription
    ID The ID of a new shopping cart item.
    arFields An array of fields containing information about a current shopping cart.
  • OnBeforeBasketUpdate - fired before a shopping cart item is modified. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The shopping cart item ID.
    &arFields An array of fields containing information about a current shopping cart.
  • OnBasketUpdate - fired after a shopping cart item was modified.
    Parameters
    ParameterDescription
    ID The shopping cart item ID.
    arFields An array of fields containing information about a current shopping cart.
  • OnBeforeBasketDelete - fired before an item is removed from a shopping cart. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The shopping cart item ID.
  • OnBasketDelete - fired after an item is removed from a shopping cart.
    Parameters
    ParameterDescription
    ID The shopping cart item ID.

Order related events

  • OnBeforeOrderAdd - fired before adding a new order to the system. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    &arFields An array of fields containing information about an order.
  • OnOrderAdd - fired after a new order was added to the system.
    Parameters
    ParameterDescription
    ID The ID of a new order.
    arFields An array of fields containing information about an order.
  • OnBeforeOrderUpdate - fired before changing an order. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order ID.
    &arFields An array of fields containing information about an order.
  • OnOrderUpdate - fired after an order was amended.
    Parameters
    ParameterDescription
    ID The order ID.
    arFields An array of fields containing information about an order.
  • OnBeforeOrderDelete - fired before an order is removed. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order ID.
  • OnOrderDelete - fired after an order is removed.
    Parameters
    ParameterDescription
    ID The order ID.

Order status events

  • OnSaleBeforePayOrder - fired before the order payment flag is set to true (CSaleOrder::PayOrder). The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order ID.
    val Specifies the new payment status value:
    • Y : the order status is being changed to "paid";
    • N : the order status is being changed to "unpaid". If this kind of transaction is applied to an order that had been paid for, the appropriate amount will be charged back to the customer's internal account. Note that if the handler returns false, the order status will not be changed to unpaid nor chargeback will occur.
    bWithdraw If true, the value of val affects the customer's internal account. If false, only the flag value is changed to val.
    bPay In combination with bWithdraw, this parameter specifies the kind and mode of financial transaction that have occurred before the event was fired, or will occur after the handler returns.
    • If bWithdraw and bPay are both true, the amount required to pay an order have been transferred by a customer (via payment system etc.) to the internal account which will be debited to finalize payment.
    • If bWithdraw is true but bPay is false, only the customer's internal account will be debited; no additional payment was required to pay an order.
    • If bWithdraw is false, no financial transaction have been or will occur and the value of bPay is irrelevant.
    recurringID This parameter must be 0.
    arAdditionalFields An array containing any additional fields (the most common use is the payment order number and date).
  • OnSalePayOrder - fired after the order payment flag is changed.
    Parameters
    ParameterDescription
    ID The order ID.
    val Specifies the new payment status value:
    • Y : the order status is now "paid";
    • N : the order status is now "unpaid". If this kind of transaction was applied to a paid order, the appropriate amount had been charged back to the customer's internal account before calling the event handler.
  • OnSaleBeforeDeliveryOrder - fired before the order delivery flag is changed (CSaleOrder::DeliverOrder). The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order ID.
    val The value specifying the order shipment status: Y - the order can be shipped out; N - the order cannot be shipped out.
    recurringID This parameter must be 0.
    arAdditionalFields An array containing any additional fields (the most common use is the waybill number and date).
  • OnSaleDeliveryOrder - fired after the order delivery flag is changed .
    Parameters
    ParameterDescription
    ID The order ID.
    val The value specifying the order shipment status: Y - the order can be shipped out; N - the order cannot be shipped out.
  • OnSaleBeforeCancelOrder - fired before the order is cancelled (CSaleOrder::CancelOrder). The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order ID.
    val The value specifying the order cancellation status: Y - the order is being cancelled; N - the order is changed back to not cancelled.
  • OnSaleCancelOrder - fired after the order is cancelled.
    Parameters
    ParameterDescription
    ID The order ID.
    val The value specifying the order cancellation status: Y - the order was cancelled; N - the order was changed back to not cancelled.
  • OnSaleBeforeStatusOrder - fired before the order status is changed (CSaleOrder::StatusOrder). The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order ID.
    val The status ID.
  • OnSaleStatusOrder - fired after the order status is changed.
    Parameters
    ParameterDescription
    ID The order ID.
    val The status ID.

Payer type management events

  • OnBeforePersonTypeAdd - fired before adding a new payer type. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    &arFields An array of fields containing information about a payer type. You can use it to modify the payer type data.
  • OnPersonTypeAdd - fired after adding a new payer type.
    Parameters
    ParameterDescription
    ID The payer type ID.
    arFields An array of fields containing information about a payer type.
  • OnBeforePersonTypeUpdate - fired before a payer type is modified. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The payer type ID.
    &arFields An array of fields containing information about a payer type. You can use it to modify the payer type data.
  • OnPersonTypeUpdate - fired after a payer type is modified.
    Parameters
    ParameterDescription
    ID The payer type ID.
    arFields An array of fields containing information about a payer type.
  • OnBeforePersonTypeDelete - fired before a payer type is deleted. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The payer type ID.
  • OnPersonTypeDelete - fired after a payer type is deleted.
    Parameters
    ParameterDescription
    ID The payer type ID.

Order status update events

  • OnBeforeStatusAdd - fired before a new order status is added. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    &arFields An array of fields containing information about an order status. You can use it to modify the status data.
  • OnStatusAdd - fired after an order status was added.
    Parameters
    ParameterDescription
    ID The order status ID.
    arFields An array of fields containing information about an order status.
  • OnBeforeStatusUpdate - fired before an order status is modified. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order status ID.
    &arFields An array of fields containing information about an order status. You can use it to modify the status data.
  • OnStatusUpdate - fired after an order status is modified.
    Parameters
    ParameterDescription
    ID The order status ID.
    arFields An array of fields containing information about an order status.
  • OnBeforeStatusDelete - fired before an order status is removed. The event handler may return false to cancel the user action.
    Parameters
    ParameterDescription
    ID The order status ID.
  • OnStatusDelete - fired after an order status is removed.
    Parameters
    ParameterDescription
    ID The order status ID.

Component related events

  • OnSaleComponentOrderOneStepPersonType - called by bitrix:sale.order.ajax after a list of available payer types is created.
    Parameters
    ParameterDescription
    &arResult The arResult array passed to a component.
    &arUserResult The arUserResult array containing user data produced by a component. You can use it to modify the component return value.
  • OnSaleComponentOrderOneStepOrderProps - called by bitrix:sale.order.ajax after a component has created a list of available order properties.
    Parameters
    ParameterDescription
    &arResult The arResult array passed to a component.
    &arUserResult The arUserResult array containing user data produced by a component. You can use it to modify the component return value.
  • OnSaleComponentOrderOneStepDelivery - caleld by bitrix:sale.order.ajax after a component has created a list of available delivery services.
    Parameters
    ParameterDescription
    &arResult The arResult array passed to a component.
    &arUserResult The arUserResult array containing user data produced by a component. You can use it to modify the component return value.
  • OnSaleComponentOrderOneStepPaySystem - called by bitrix:sale.order.ajax after a component has created a list of available payment systems.
    Parameters
    ParameterDescription
    &arResult The arResult array passed to a component.
    &arUserResult The arUserResult array containing user data produced by a component. You can use it to modify the component return value.
  • OnSaleComponentOrderOneStepProcess - called by bitrix:sale.order.ajax after a component has finished generating requisites based on the order form submitted by a customer.
    Parameters
    ParameterDescription
    &arResult The arResult array passed to a component.
    &arUserResult The arUserResult array containing user data produced by a component. You can use it to modify the component return value.
  • OnSaleComponentOrderOneStepComplete - called by bitrix:sale.order.ajax after a component has created an order in the system but prior to redirecting a customer to the order-successful page.
    Parameters
    ParameterDescription
    ID The order ID.
    arOrder An array of fields containing information about an order.
  • OnSaleComponentOrderOneStepFinal - called by bitrix:sale.order.ajax after a component has created an order and sent an order confirmation message but prior to redirecting a customer to the order-successful page.
    Parameters
    ParameterDescription
    ID The order ID.
    arOrder An array of fields containing information about an order.
  • OnSaleComponentOrderComplete - called by bitrix:sale.order.full after an order has been successfully completed.
    Parameters
    ParameterDescription
    ID The order ID.
    arOrder An array of fields containing information about an order.

Ordering process e-mail events

  • OnOrderNewSendEmail - fired before sending an order confirmation message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
  • OnOrderDeliverSendEmail - fired before sending an "order shipped" message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
  • OnOrderPaySendEmail - fired before sending an "order paid" message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
  • OnOrderCancelSendEmail - fired before sending an "order is being cancelled" message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
  • OnSaleStatusEMail - called when a "order status changed" message is being generated. If required, the handler may override the default message text by returning the new text. Otherwise, it returns null.
    Parameters
    ParameterDescription
    ID The order ID.
    val The order status ID.
  • OnOrderStatusSendEmail - fired before sending an "order status changed" message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
    val The order status ID.
  • OnOrderRemindSendEmail - fired before sending a payment reminder message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
  • OnOrderRecurringSendEmail - fired before sending a subscription renewal message. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.
  • OnOrderRecurringCancelSendEmail - fired before sending a message notifying a customer that a subscription renewal is being cancelled. The event handler may return false to not send the message.
    Parameters
    ParameterDescription
    ID The order ID.
    &eventName The name of an e-mail event type used for sending the message.
    &arFields An array containing data that will be used when creating an actual e-mail message from a template. You can use it to modify the text or data supplied by the array fields and change the e-mail event type ID.

Other events

  • OnOrderListFilter - called when creating the order filter in Control Panel. If a handler modifies the filter entries, it should return the whole modified arFilter array.
    Parameters
    ParameterDescription
    arFilter An array containing the default filter entries.
  • OnProductSearchFormIBlock - called when creating the product filter visible to a customer. If a handler modifies the filter entries, it should return the whole modified arFilter array.
    Parameters
    ParameterDescription
    arFilter An array containing the default filter entries.
  • OnProductSearchForm - called for each product item in the product search form. The return value is a JScript array containing new parameters for a product identified by the ID. Use this event if one or more of the product parameters in an order need to be different than those specified in the catalog.
    Parameters
    ParameterDescription
    ID The product ID.
    arParams A JScript array containing the current parameters.
  • OnAffiliateGetSections - called by CSaleAffiliate::CalculateAffiliate if the module to which a product belongs is not the Catalog module. Use this handler to define sections for a product intended for affiliates.
    Parameters
    ParameterDescription
    MODULE The ID of the module to which a product item belongs.
    PRODUCT_ID The product ID.
  • OnSaleUserDelete - called when a web store customer is being deleted.
    Parameters
    ParameterDescription
    ID The customer ID.
© «Bitrix24», 2001-2024
Up