magento2.0.2

Css not working after installation in Magento 2

偶尔善良 提交于 2019-12-12 18:35:04
问题 I have Installed Magento 2. Everything completed successfully but css is not loading. I tried these commands php bin/magento cache:flush php bin/magento indexer:reindex php bin/magento setup:static-content:deploy Please help me 回答1: You should Provide Some permissions run this command sudo find . -type d -exec chmod -R 777 {} \; && sudo find . -type f -exec chmod -R 777 {} \; && sudo chmod u+x bin/magento 回答2: Please, before doing anything go to magento2 basedir and do: nano vendor/magento

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,

Sort by price low to high and high to low in product listing magento2

天涯浪子 提交于 2019-12-06 12:23:18
问题 I am new in magento2. I am using Magento ver. 2.1.1 I want to add custom price low to high and price high to low in Sort By dropdown in product listing page. I didn't get toolbar.phtml page. Also I didn't get any stuff regarding this in google. If anyone have any idea, then please help me. Thanks! 回答1: Step 1: Create plugins in app/code/Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento

Sort by price low to high and high to low in product listing magento2

女生的网名这么多〃 提交于 2019-12-04 18:23:46
I am new in magento2. I am using Magento ver. 2.1.1 I want to add custom price low to high and price high to low in Sort By dropdown in product listing page. I didn't get toolbar.phtml page. Also I didn't get any stuff regarding this in google. If anyone have any idea, then please help me. Thanks! Step 1: Create plugins in app/code/Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Block\Product\ProductList\Toolbar"> <plugin