magento2

Magento site not working after upgrading extensions

99封情书 提交于 2019-12-11 13:41:50
问题 I upgraded all the extensions that were showing in Magento Connect. I am new guy in Magento. Before upgrdation site was working perfectly. I am using it on Linux server. My admin panel and website both are unble to load. It is available here http://130.211.244.103/ . I did a lot of googling , edited my index.php , increased the memory limit ini_set('display_errors', 1); ini_set('memory_limit', '1024M'); umask(0); Kindly suggest me solution to this issue. Edit : I checked my system and replace

Magento 2 Add a custom input field on chackout forrm and save it

岁酱吖の 提交于 2019-12-11 12:08:14
问题 I am actually working on customization of the checkout form. I need to add a custom input field such as Fiscal Code inside the form. Via Plugin I added the field, but after Placing Order the reference to this field disappear, how i can save and display it in Sales Order? This is the code i used Module.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Lutech_CheckoutAdditionalField" setup

How to get product information from product id in magento2 or magento2.0?

≡放荡痞女 提交于 2019-12-11 10:08:57
问题 How to get all product details by product id in magento2? I want to display a single product detail with the image on the homepage. Any help would be appreciated. 回答1: For this purpose, it's better to use Service Layer in Magento 2. protected $_productRepository; public function __construct( ... ... \Magento\Catalog\Model\ProductRepository $productRepository, ... ) { $this->_productRepository = $productRepository; ... ... } public function getProductById($id) { return $this->

In magento 2 How to call phtml file in static block

强颜欢笑 提交于 2019-12-11 03:24:10
问题 I have created extension in magento 2 and i want to call content.phtml file from static block (from admin panel). My content template file location is C:\xampp\htdocs\Magento2\app/code\Surya\Slider\view\frontend\templates\content.phtml where, magento2 is my project folder, Surya is vendor and Slider is my extension name. I want to call content.phtml file on homepage through static block. For that I have created one static block called as "slider". Also, i have created widget. But i want to

Magento2 Out of Stock Assosiated Products not showing in the dropdown options for Configurable Products

对着背影说爱祢 提交于 2019-12-11 02:25:50
问题 I am facing an issue with Magento2 and I am not sure whether it's a bug or not. I want to show Out of Stock Assosiated Products in the Configurable Product Dropdown. In the admin settings, Stores -> Configuration -> Catalog -> Inventory -> Display out of stock products, this is already set to "Yes" but no luck. I have tried several modules with integrating plugins and did a lot of research on this but could not find any solution for this. Lets take an example - I have a Configurable Product

How to add Custom file upload function in magento 2

拈花ヽ惹草 提交于 2019-12-11 02:07:10
问题 Am created file upload functionality through custom module in Magento 2 category tab.i don't know how to save the file in database.please can any one tell me how to do that? 回答1: add use Magento\Framework\UrlInterface; add use Magento\Framework\Filesystem; ... $imageName = $this->uploadFileAndGetName('input_name', $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA)->getAbsolutePath($subdir_of_your_choice.'/image')); $your_model->setImage($imageName); 回答2: You don't save the file in DB,

Magento 2 REST API Customer Custom Attribute

旧时模样 提交于 2019-12-10 19:22:01
问题 The Magento 2 REST API Documentation explains a way to set custom_attributes on a customer when updating or creating it. http://devdocs.magento.com/swagger/index_20.html#/ Unfortunately I couldn't get this to work... My POST and PUT JSON request data is : { "customer": { "custom_attributes": [ { "attribute_code": "firstname", "value": "TEST" } ], "email": "someone@exaxmple.com", "extension_attributes": [], "firstname": "Someone", "gender": null, "lastname": "Else", "middlename": null, "taxvat

unable to get jsonEncode in magento2

北战南征 提交于 2019-12-10 17:31:07
问题 Magento has its own json encode and decode functions: Mage::helper('core')->jsonEncode($array); Above code in depreciated in Magento 2. So how to use jsonEncode, what I have to extend to use json Encode? 回答1: Magento 2 way is pass Magento\Framework\Json\Helper\Data using DI functionality (see blow). Don't use $this->helper() and objectManager . This functionality will be deprecated soon. /** * @var \Magento\Framework\Json\Helper\Data */ protected $jsonHelper; /** * Constructor. * * @param

How to save data using Model in Magento2

不羁的心 提交于 2019-12-10 17:22:37
问题 I have a basic module ready with controller and view working perfectly. Now, I am trying to initiate model in order to save data using custom model in table containing attributes (question Title, Question). Basically, what steps I should proceed in order to save data through model in a custom table ? How should I do it, any help would be greatly appreacited. I have below code in my action file : class Post extends \Magento\Framework\App\Action\Action { protected $_objectManager; public

Magento 2 Design Theme tab is missing

。_饼干妹妹 提交于 2019-12-10 15:17:53
问题 Hi, I am trying magento 2 and struggling to install the new theme. Because Design Theme is not showing under Stores > Configuration > Design. 回答1: It has been moved to Content/Design/Configuration 回答2: Yes It has been moved to Content/Design/Configuration. check screenshot for more clarification Then you can select specific store if you have multi store. click edit action and in new window you can find search engine robots setting. 回答3: In Magento 2.0.x, you can configure the theme in Stores