Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alexforap

    (@alexforap)

    Решение нашлось.

    Вдруг кому-то пригодится.

    \core\src\YandexApi\Resources\PriceChecker.php

    public function calculate(array $items, array $points): CheckPriceResult
        {
            $result = $this->call('check-price', Client::API_V1, [
                'json' => [
                    'items' => $this->prepareItems($items),
                    'route_points' => $this->preparePoints($points),
                    'requirements'=>[
                        'taxi_class'=>'express',
                        'cargo_options'=>['thermobag']
                    ]
                ],
            ]);
    
            return $this->mapResult($result);
        }

    Добавили requirements в запрос. Цена по нужному тарифу считается в корзине.

    Broke with this error. In the plugin file (quickly) replaced the. This is not a complete solution, in which it would be better to introduce an attribute check.

    Lines from +-206 replace:

    $caption = ‘function( instance, item ) {return “”;}’;
    /*
    $caption = ‘function( instance, item ) {‘ .
    ‘var testing = jQuery(this).context.title;’ .
    ‘var caption = jQuery(this).data(\’caption\’) || \’\’;’ .
    ‘if ( item.type === \’image\’ && testing.length ) {‘ .
    ‘caption = (caption.length ? caption + \'<br />\’ : \’\’) + \'<p class=”caption-title”>\’+testing+\'</p>\’ ;’ .
    ‘}’ .
    ‘return caption;’ .
    ‘}’;*/

Viewing 2 replies - 1 through 2 (of 2 total)