How to get rule id with respect to customer group id

class CouponCode extends \Magento\Framework\View\Element\Template { protected $_customerSession; protected $_customerGroupCollection; public function __construct( \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Group $customerGroupCollection, \Magento\Framework\View\Element\Template\Context $context) { $this->_customerSession = $customerSession; $this->_customerGroupCollection = $customerGroupCollection; parent::__construct($context); } public function getCouponCodes() { $currentGroupId = $this->_customerSession->getCustomer()->getGroupId(); //Get customer group Id , you have already this so directly get name $collection = $this->_customerGroupCollection->load($currentGroupId); return $collection->getCustomerGroupCode();//Get group name }

Add extra cost to shipping method itself in woocommerce

I found the following code from this link: https://stackoverflow.com/questions/52138784/add-a-fee-based-on-shipping-method-and-payment-method-in-woocommerce The code works great if you want to add an extra fee if the “cash on delivery” payment method selected. My question is how to add the extra cost to the shipping method itself when “cash on delivery” method is selected, not show it as another…

How to override arguments in layout file?

module-sales/view/frontend/layout/sales_order_view.xml <referenceContainer name=”content”> <block class=”Magento\Sales\Block\Order\View” name=”order.comments” template=”Magento_Sales::order/order_comments.phtml” before=”sales.order.info.links”/> <block class=”Magento\Sales\Block\Order\View” name=”sales.order.view” cacheable=”false” after=”sales.order.info.links”> <block class=”Magento\Sales\Block\Order\Items” name=”order_items” template=”Magento_Sales::order/items.phtml”> <block class=”Magento\Framework\View\Element\RendererList” name=”sales.order.items.renderers” as=”renderer.list”/> <block class=”Magento\Theme\Block\Html\Pager” name=”sales_order_item_pager”/> <block class=”Magento\Sales\Block\Order\Totals” name=”order_totals” template=”Magento_Sales::order/totals.phtml”> <arguments> <argument name=”label_properties” xsi:type=”string”>colspan=”4″ class=”mark”</argument> <argument name=”value_properties” xsi:type=”string”>class=”amount”</argument> </arguments> <block class=”Magento\Tax\Block\Sales\Order\Tax” name=”tax” template=”Magento_Tax::order/tax.phtml”/> </block> </block> </block> <block class=”Magento\Sales\Block\Order\Info” as=”info” name=”sales.order.info” after=”sales.order.view”/> </referenceContainer> I want to change only…