Kien Wiliam

About Kien Wiliam

Magento Ecommerce Developer

How to install Magento 2 via Archive file, Composer or GitHub

When installing Magento 2 on your machine you should ask yourself: Do I need more problems in my life? If the answer is Yes, continue reading. I’ll be installing Magento 2 on my dev machine – Linux Ubuntu 16.04 with Php 7.0.7 Mysql 5.7.12 Composer 1.1.2 Before continuing, make sure you have all the prerequisites, required […]

Read More >

Magento : Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url

MAGENTO 1 : Get Url in phtml files

Get Url in cms pages or static blocks

MAGENTO 2 : Below is a block class of my custom module. I have injected object of StoreManagerInterface & UrlInterface in the constructor of my module’s block class. Both of them can be used to fetch base and current URL. In […]

Read More >

How to add tracking url in shipment email for customer in magento 2

You can copy vendor/magento/module-sales/view/frontend/email/shipment_new.html to your theme and edit line 56 (here you can change block for which display track information), you can change it like this

After that you need create this block

Then copy template vendor/magento/module-sales/view/frontend/templates/email/shipment/track.phtml to your theme and change line 25 to

You also may need copy vendor/magento/module-sales/view/frontend/email/shipment_new_guest.html […]

Read More >

How to Solve error (Uncaught Error: Cannot instantiate interface CopyConstructorInterface)

Creating an upgrade script for cloning a product with \Magento\Catalog\Model\Product\Copier has a bug.

Then have error when use product Copier function :

Simple try the our solution below : Create di.xml file in frontend folder with the content below :

See image : This solution also applied for magento 2 issue 7056 […]

Read More >

How to show error when checkout with magento 2 (An error occurred on the server. Please try again)

Go to the file : vendor/magento/module-checkout/Model/PaymentInformationManagement.php vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php Change function savePaymentInformationAndPlaceOrder() from

To

Check log and see result ! Thank for reading this post, Hope it helps.

Read More >

How to import and export a database via SSH or cPanel

You can easily import/export your database using phpMyAdmin menu in cPanel. To do so, it allows processing only the databases that do not exceed 50Mb. If your database is bigger, you will need to use SSH commands. Note that before performing an export or import, you will need to assign a database to a user. You can do it in cPanel […]

Read More >