0

Hello everyone i am using Magento 2.x.x , and i want to add a new field to product description "Date to ship" to let the customer chose a specific date like the quantity, and also i want to display that value with his equivalent row on admin sales grid can anyone help me to do this please i am new on Magento ?

enter image description here

3 Answers 3

0

In order to have the info on admin sales grid it must be set on the order. You must add an extra checkout field.

Please check the following question as it will surelly suit your case: How to Add Custom fields to Checkout page in Magento2

0

You may create a UI component just like you would in the case of adding custom fields for any page.

For reference have a look at this: https://www.mageplaza.com/devdocs/how-to-add-custom-fields-in-product-edit-pages-in-magento-2.html

1
  • is this applicable for the front or just adminhtml because iw an to add it in the front , see my picture above
    – magNif
    Sep 30, 2021 at 20:55
0

You can add block file catalog_product_view.xml

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.main">            
            <block class="Module\Name\Block\Catalog\ProductView" name="product.info.custom_block" template="Module_Name::custom_block.phtml" after="product.info.price"/>           
        </referenceBlock>
    </body>
</page>

Block file

<?php
namespace Module\Name\Block\Catalog\Product;
use Magento\Catalog\Block\Product\AbstractProduct;
class View extends AbstractProduct
{

}

custom_block.phtml

Dat to ship

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.