Universal Setting Plugin for Advanced Shipping for Magento 2
€120.00
In stock
SKU
magento2-module-adv-ship-universal-setting-addon
What is Universal Setting Plugin?
Universal Setting is a plugin for Advanced Shipping for Magento 2.
This plugin allows you to hide or change price of any shipping method regardless of the shipping modules used.
The configuration can use the same variables and functions as Advanced Shipping for Magento 2.
Examples
Hide shipping method if the package weight is lower than 10 kg:
if ($request->package_weight < 10) { hide('flatrate/flatrate'); }
Hide all shipping methods of a carrier:
hide('flatrate/*');
Set the method price to the sum of product’s attribute 'shipping_fees':
setPrice('tablerate/bestway', array_sum( array_map( function ($item) { return $item->product->shipping_fees; }, $request->all_items ) ));
Add a fixed amount to a shipping method:
if ($rate = getRate('tablerate/bestway')) { $originalPrice = $rate->getPrice(); $rate->setPrice($originalPrice + 2.0); }
Add a fixed amount to each UPS shipping method:
foreach (getRates('ups/*') as $rate) { $originalPrice = $rate->getPrice(); $rate->setPrice($originalPrice + 2.0); }
Documentation
Platform | Magento 2 |
---|---|
Category | Shipping |
Summary | Hide or change price of methods regardless the shipping module |