1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Namespace Vendor\Magento\Block;
verwenden Sie Magento\Checkout\Model\Session;
Die Klasse ShippingRate implementiert ConfigProviderInterface
{
protected $checkoutSession;
protected $quote;
öffentliche Funktion __construct(
Sitzung $checkoutSession,
)
{
$this->checkoutSession = $checkoutSession;
$this->quote = $checkoutSession->getQuote();
}
öffentliche Funktion getShippingRate()
{
$shippingAmount = $this->quote->getShippingAddress()->getShippingAmount();
}
}