Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function transform( \Aimeos\MShop\Attribute\Item\Iface $item ) : string |
||
31 | { |
||
32 | if( $priceItem = $item->getRefItems( 'price', 'default', 'default' )->first() ) |
||
33 | { |
||
34 | /// Configurable product attribute name (%1$s) with sign (%4$s, +/-), price value (%2$s) and currency (%3$s) |
||
35 | $str = $this->translate( 'client', '%1$s (%4$s%2$s%3$s)' ); |
||
36 | $value = $priceItem->getValue() + $priceItem->getCosts(); |
||
37 | $view = $this->view(); |
||
38 | |||
39 | return sprintf( $str, $item->getName(), |
||
40 | $view->number( abs( $value ), $priceItem->getPrecision() ), |
||
41 | $view->translate( 'currency', $priceItem->getCurrencyId() ), |
||
42 | ( $value < 0 ? '−' : '+' ) |
||
43 | ); |
||
44 | } |
||
45 | |||
46 | return $item->getName(); |
||
47 | } |
||
49 |