E-commerce Platforms
Magento2 Form Validation
in this wiki we will provide a simple form with Validation that we can use in Magento2, hope this will be helpful for all readers
you can use the below code in phtml file
Magento 2 REST API - Add Order Comment
To add a new comment to existing order and change the order status you can use this endpoint
/rest/V1/orders/{order_id}/comments
and the json data is
{ "statusHistory": { "comment": "Your Comment Here", "created_at": "2018-06-05 15:22:04", "parent_id": {order_id}, "is_customer_notified": 0, "is_visible_on_front": 1, "status": "pending" } }
How to apply the Magento 2 patches?
Most of Magento developer want to know exactly how they should apply the security patches on their websites
in this article we are going to talk about *.patch files
There are two ways to do this
1- using git command
git apply patch_filename.patch
or
2- using patch command
patch -p1 < patch_filename.patch
I hope this will be useful for you
Use Redis for session storage
with standard parameters, you can use this command after you are in Command line (SSH)
bin/magento setup:config:set --session-save=redis --session-save-redis-host=127.0.0.1 --session-save-redis-log-level=3 --session-save-redis-db=2
References
Backing up Magento2 using command line
To backup your store using the command line please login to your root magento server (SSH), then execute this command
magento setup:backup --code --media --db
restore canceled order in Magento2
Imagine that some of your team cancel an order in Magento by mistake, What is the solution?
By the below code you can restore the cancelation, hope it will help you
How to create invoice when order created programmatically in magento1
You can create an invoice programmatically for an order by using the below code
Magento1 how to change magento order status programatically?
Some time we need to change the Order status programmatically , the below code will allow us to do this
Magento 2: How to get customer collection
<?php
protected $_customerFactory;
public function __construct(
...
\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerFactory
...
Create Invoice Via REST API for Magento2 for Bundle Product
To create an invoice for an order that contain bundle product you have to prepare the good json.
Basically Magento has two different types of bundle products: dynamic and fixed. That's why I need to add clarification for Expected Result:
I) Bundle dynamic product: