是否有一个JavaScript库,它允许我执行像(所有的REST操作GET,POST,PUT和DELETE超过HTTP或HTTPS)?
I have tried lots of option in magento2 to find the media path URL
How can i find the media path URL in template.
I have try
$object_manager = Magento\Core\Model\ObjectManager::getInstance();
$dir = $object_manager->get('Magento\App\Dir');
$mediaUrl = $dir->getDir(\Magento\App\Dir::MEDIA);
Run Code Online (Sandbox Code Playgroud)
But it give me error class not found. I have search and found the one solution to create function in block file but there are so many places i want to use the media path in my design
Thanks in advance.
嗨,我有以下代码来获取WooCommerce的送货方式.
global $woocommerce;
$cart = wc()->cart->get_shipping_packages();
$sm = wc()->shipping->calculate_shipping_for_package($cart);
return $sm;
Run Code Online (Sandbox Code Playgroud)
结果将返回一个这样的数组:
如何从速率数组中获取数据?我想要的值是id,label和method_id?
的print_r($ SM); 出口;
Array
(
[0] => Array
(
[contents] => Array
(
)
[contents_cost] => 0
[applied_coupons] => Array
(
)
[user] => Array
(
[ID] => 1
)
[destination] => Array
(
[country] => SG
[state] =>
[postcode] =>
[city] =>
[address] =>
[address_2] =>
)
)
[rates] => Array
(
[international_delivery] => WC_Shipping_Rate Object
(
[id] => international_delivery
[label] => International Flat Rate
[cost] …Run Code Online (Sandbox Code Playgroud) php ×2
arrays ×1
javascript ×1
jquery ×1
magento-2.0 ×1
magento2 ×1
object ×1
rest ×1
wordpress ×1