Skip to content

Instantly share code, notes, and snippets.

@Sentinel-7
Sentinel-7 / msOrder
Created March 3, 2020 07:49 — forked from grachov/msOrder
Простой способ для пересчета стоимости заказа после его изменения
<?php
class msOrder extends xPDOSimpleObject
{
public function updateProducts()
{
$originalContext = $this->xpdo->context->get('key');
$this->xpdo->switchContext($this->get('context'));
$originalMiniShop = isset($this->xpdo->services['minishop2']) ? $this->xpdo->services['minishop2'] : null;
$cart = array();
foreach ($this->getMany('Products') as $product) {