cancel
Showing results for 
Search instead for 
Did you mean: 

Migration from Magento 1.x to Magento 2.x

Migration from Magento 1.x to Magento 2.x

Hi,

 

I am new to Magento, and i need to update payment plugin from version magento 1.9 to magento 2.

 

I am working very hard to get this done but I am reaching no where, Can anyone please help me in this regards? 

 

I changed some of the files and managed to see backend part of my module.  Now I am changing Block, .phtml,controller and Model to display our payment module to frontend on checkout page, but I am not seeing anything there. 

Could you please guide me what needs to be changed and why I am getting error?

 

And also whenever I change anything in files it doesn't reflect in front end. Every time I need to reinstall magento with updated changes in my module. What needs to be done there.

 

Your help will be really appreciated.

 

Thanks in advance,

Namita kapoor

8 REPLIES 8

Re: Migration from Magento 1.x to Magento 2.x

please check

1) Add a custom payment method to checkout (http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_payment.html ).

2) sample payment gateway module (https://github.com/magento/magento2-samples/tree/master/sample-module-payment-gateway). It will help you .

Re: Migration from Magento 1.x to Magento 2.x

Hi All,

 

Can anyone please help me? 

 

Thanks,

Namita

Re: Migration from Magento 1.x to Magento 2.x

Hi Namita( @WorldNet TPS)

 

Magento 2 is new for every user (for me too). You may face issues while learning it gradually you will learn it.

Did you try to create some sample custom modules before working on your extension work?

 

I suggest you to develop some sample modules according to your requirement. Like working with controllers, plugins, Observers etc in Magento 2. Once you are confident then again start to work on your extension.

 

I suggest you to go through following resources which may be helpful for you.

1) Magento 2 Developer Documentation

2) Magento 2 Developer’s Cookbook: Useful Code Snippets, Tips, and Note

3)The Ultimate Magento 2 Tutorial

4) http://www.coolryan.com/magento-2/

For Magento 2 some good books are also available. You can use those for learning purpose.

 

For specific errors you should post separately so people may be able to answer those.

 

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Migration from Magento 1.x to Magento 2.x

Hi,

 

Thank you so much for your responses and help. I tried to make sample Payment Module but I am not able to see my module on checkout page. My module is located in app/code/Mage/Worldnet. Below are my files to render the payment method on checkout page,

checkout-index_index.xml

 <?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
//other items tags here
<!-- merge payment method renders here -->
<item name="children" xsi:type="array">
<item name="worldnet-payments" xsi:type="array">
<item name="component" xsi:type="string">Mage_Worldnet/js/view/payment/worldnet</item>
<item name="methods" xsi:type="array">
<item name="worldnet" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
**//closing items tags here
</argument>
</arguments>
</referenceBlock>
</body>
</page>

 

**app/code/Mage/Worldnet/view/frontend/web/js/view/payment/worldnet.js


define(
[
'uiComponent',
'Magento_Checkout/js/model/payment/renderer-list'
],
function (
Component,
rendererList
) {
'use strict';
rendererList.push(
{
type: 'worldnet_standard',
component: 'Mage_Worldnet/js/view/payment/method-renderer/worldnet-standard'
}
);
/** Add view logic here if needed */
return Component.extend({});
}
);

 

**app/code/Mage/Worldnet/view/frontend/web/js/view/payment/method-renderer/worldnet-standard.js

define(
[ 'jquery',
'Magento_Checkout/js/view/payment/default',
'Magento_Checkout/js/action/set-payment-information',
'Magento_Checkout/js/model/payment/additional-validators',
'Magento_Checkout/js/model/full-screen-loader'
],
function ($, Component, setPaymentInformationAction, additionalValidators, fullScreenLoader) {
'use strict';

return Component.extend({
defaults: {
template: 'Mage_Worldnet/payment/worldnet-standard'
},
placeOrderHandler: null,
validateHandler: null,

setPlaceOrderHandler: function(handler) {
this.placeOrderHandler = handler;
},

setValidateHandler: function(handler) {
this.validateHandler = handler;
},

context: function() {
return this;
},

isShowLegend: function() {
return true;
},

getCode: function() {
return 'worldnet_standard';
},

isActive: function() {
return true;
},

/**
* @override
*/
placeOrder: function () {
var self = this;
this.selectPaymentMethod(); // save selected payment method in Quote
setPaymentMethodAction(this.messageContainer);
return false;

}
});
}
);

 

**app/code/Mage/Worldnet/view/frontend/web/templates/worldnet-standard.html

 


<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
<div class="payment-method-title field choice">
<input type="radio"
name="payment[method]"
class="radio"
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
<label data-bind="attr: {'for': getCode()}" class="label"><span data-bind="text: getTitle()"></span></label>
</div>
<div class="payment-method-content">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>

<form class="form" data-bind="attr: {'id': getCode() + '-form'}">
<!-- ko template: 'Magento_Payment/payment/cc-form' --><!-- /ko -->
</form>

<div class="checkout-agreements-block">
<!-- ko foreach: $parent.getRegion('before-place-order') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<div class="actions-toolbar">
<div class="primary">
<button class="action primary checkout"
type="submit"
data-bind="
click: placeOrder,
attr: {title: $t('Place Order')},
css: {disabled: !isPlaceOrderActionAllowed()},
enable: (getCode() == isChecked())
"
disabled>
<span data-bind="text: $t('Place Order')"></span>
</button>
</div>
</div>
</div>
</div>

 

 

Please let me know what I am missing here. I am tired of searching this, please help me.

Thanks,

Namita

Re: Migration from Magento 1.x to Magento 2.x

Hi,

 

Please help me with above query, also I want to know is there any other file which is responsible for rendering payment method on checkout page. Like model or controller di.xml

 

Thanks,

Namita

Re: Migration from Magento 1.x to Magento 2.x

Hi Namita @WorldNet TPS

 

Following links may be helpful for you.(Magento 2 is also new to me so can not provide much help)

 

Add a custom payment method to checkout

 

Implementing payment gateway in Magento 2

 

Magento 2 Payment Gateway API

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Migration from Magento 1.x to Magento 2.x

Hey,

 

Thank you so much for you prompt response and information provided. I think we are on the same boat Smiley Happy .

I am already using this sites for reference.  But still on the same situation.  I think I am missing something with composer part. I didn't install my extension or module using composer. I am just putting my module in app/code folder and expecting results. 

 

If you have any further knowledge on this regards  please let me know. I am really grateful for your help.

 

Thanks,

Namita.

 

Re: Migration from Magento 1.x to Magento 2.x

Hi @WorldNet TPS

 

I suggest you to post your question on http://magento.stackexchange.com/ also. You may get your answer there.

If you get answer there please update your post on forum also.

---
Problem Solved Click Accept as Solution!:Magento Community India Forum