Magento 1.9 – How to restrict Payment method in Observer?

I want to assign specific payment method only for selected one customer group, successfully get customer group, public function paymenter($Observer) { if(Mage::getSingleton(‘customer/session’)->isLoggedIn()) { // Get group Id $groupId = Mage::getSingleton(‘customer/session’)->getCustomerGroupId(); //Get customer Group name $group = Mage::getModel(‘customer/group’)->load($groupId); if($group->getCode() == ‘Tester’) { Mage::log(‘hello’,null,’filter.log’,true); } } } How to add payment method condition to my condition? workout…

How to create multiple Custom Options using programmatically in Magento 2?

I want to create some custom option by code, and my code is not working properly, I have an issue it, is creating only one option that is on the last index of options array and having all values of other options. Here is my code: In event.xml- <event name=”catalog_product_save_after”> <observer name=”add_product_custom_options” instance=”Custom\Addon\Observer\ProductOptions\ManualCreate” /> </event>…

upload image or files from custom module from frontend with ajax magento 2

I want to upload image from frontend custom module using ajax method. filepath : app/code/Chirag/Userform/view/frontend/templates/insert.phtml <?php $blockObj= $block->getLayout()->createBlock(‘Chirag\Userform\Block\Insert’); echo $blockObj->getEventsTxt(); ?> <form class=”” name=”eventform” id=”eventform” <?php /*action=”<?php echo $blockObj->getEventsPostURL();?>” */ ?> method=”post” accept-charset=”utf-8″ data-mage-init='{“validation”:{}}’> <table width=”60%”> <tr> <td colspan=”2″ align=”center”>User Form</td> </tr> <tr> <td><span><?php /* @escapeNotVerified */ echo __(‘User First Name :’); ?></span></td> <td><input type=”text”…

Magento 1.9 Observer – How do visible selected payment gateway only for specific customer group?

Following code return customer group, how to add condition if customer group “Tester” then only show selected payment gateway? app\etc\modules\Gta_FindPaymentGateway.xml <?xml version=”1.0″?> <config> <modules> <Gta_FindPaymentGateway> <codePool>local</codePool> <active>true</active> </Gta_FindPaymentGateway> </modules> </config> app\code\local\Gta\FindPaymentGateway\etc\config.xml <?xml version=”1.0″?> <config> <modules> <Gta_FindPaymentGateway> <version>1.0.0</version> </Gta_FindPaymentGateway> </modules> <global> <models> <gta_findpaymentgateway> <class>Gta_FindPaymentGateway_Model</class> </gta_findpaymentgateway> </models> <events> <checkout_cart_product_add_after> <observers> <Gta_FindPaymentGateway_Model_Observer> <type>singleton</type> <class>Gta_FindPaymentGateway_Model_Observer</class> <method>paymenter</method> </Gta_FindPaymentGateway_Model_Observer> </observers> </checkout_cart_product_add_after>…