magento2

Magento 2 - Migration tool - Destination fields are not mapped

偶尔善良 提交于 2019-12-06 11:14:23
I'm trying to use the Data Migration Tool to migrate a site from 1.9.2.2 to 2.0.5. I was able to solve numerous 'Source fields not mapped' errors editing the map.xml file, but can't shift the error; Destination fields are not mapped. Document: sales_creditmemo. Fields: base_shipping_hidden_tax_amnt Error screenshot I've tried adding; <ignore> <document>sales_creditmemo.base_shipping_hidden_tax_amnt</document> </ignore> Within destination> document_rules> and <ignore> <field>sales_creditmemo.base_shipping_hidden_tax_amnt</field> </ignore> Within field_rules > source>. But it won't go away. I'm

Error in Draw image on PDF using Zend Framework in Magento2

给你一囗甜甜゛ 提交于 2019-12-06 08:33:52
I am working on create a catalog PDF in Magento-2 using Zend Framework. My code is here to print catalog image on PDF. foreach ($collection as $product) { $image = $product->getImage(); $path = $mediaUrl."catalog/product".$image; $imagef = Zend_Pdf_Image::imageWithPath($path); // write image to page $page->drawImage($imagef, 50, 50, 400, 400); } But it did not work for me. 来源: https://stackoverflow.com/questions/48800875/error-in-draw-image-on-pdf-using-zend-framework-in-magento2

Magento 2 - Go directly to the checkout page when adding a product to the cart

心不动则不痛 提交于 2019-12-06 04:58:32
问题 I am writing an extension which allows to go directly to the checkout page when clicking on the add-to-cart button on the product page. I found a solution for Magento 1 here and I tried to adapt it to Magento 2. Here are my files: File etc/frontend/events.xml: <?xml version="1.0" encoding="utf-8" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_cart_add_product_complete">

Set package and theme at run time in magento2

随声附和 提交于 2019-12-05 15:16:56
My package name is 'company' and my theme name is 'web', and I have another package named 'system' whose theme is named 'component'. Run time is from the Block file but I want to set that theme and package from the front-end side in magento2. If you want to Set package and theme at run time in magento simply use this code snippet. create one function ex. changeTheme('Theme-name'); and run this function with your requirement add this function in your head.phtml after php start. function changeTheme($themeName) { Mage::getDesign()->setArea('frontend') //Area (frontend|adminhtml) ->setPackageName

Composer - how to ignore some map files?

拜拜、爱过 提交于 2019-12-05 13:41:25
I'm using composer in my PHP project. There is a module which maps lots of files into to root directory. This includes files like README.md and CHANGELOG.md and the generation autolod files throws an error: [ErrorException] Target ./README.md already exists (set extra.magento-force to override) Is there a option to ignore a list of files from the mapping and don't use the override option? I works like this, for example if you want to prevent the pub/.htaccess from being overwritten. Add this to the composter.json "extra": { "magento-force": "override", "magento-deploy-ignore": { "*": [ "/pub/

Magento 2 can't find css and js files

送分小仙女□ 提交于 2019-12-04 21:09:33
thanks in advance for help! I moved my site based on Magento 2 from hosting to my localhost. I cleared cache, adjusted(secure and unsecure) urls in core_config, run static content deploy() using cli. Checked all permitions for "folder". Magento runs but with no css and js files. In console I can see the following: Please give some advice, what should I do to remove this issue? Thanks in advance! P.S: Win 10 Open Sever (PHP7x64, MySQL5,7x64, Apache-PHP7-x64+Nginx1.10) No external caching P.P.S Before I copied site from host I tried to setup magento with sample data using cli and I received the

Magento - 2 or more observer on same event

若如初见. 提交于 2019-12-04 19:34:46
问题 2 of my observer are observing same sales_order_shipment_save_before event. ModuleA was the one i created first and then i created ModuleB Now only ModuleB 's observer is called and not ModuleA . Please let me know how can i resolve this and both of observers are called. ModuleA <?xml version="1.0"?> <config> <global> <models> <shipmentsave> <class>My_Shipmentsave_Model</class> </shipmentsave> </models> </global> <adminhtml> <events> <sales_order_shipment_save_before> <observers>

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

Magento2 checkout form: How to display placeholder attribute value in fields?

不羁的心 提交于 2019-12-04 05:56:31
Goodmorning Stackoverflow, I'm customizing the checkout onepage in Magento 2. Now I'm trying to display placeholders instead of labels in the shipping-address form, but no success till now. I hope someone can help me out Cheers, Jorge UPDATE: In the console i can see a variable is giving to the attribute placeholder of the element input. <input class="input-text" type="text" data-bind=" value: value, valueUpdate: 'keyup', hasFocus: focused, attr: { name: inputName, placeholder: placeholder, // <<<< right here 'aria-describedby': noticeId, id: uid, disabled: disabled }" name="street[0]"

Add/remove image programmatically to product Magento2

£可爱£侵袭症+ 提交于 2019-12-03 08:46:26
I am facing problem to add/remove image to product programmatically. Datta Yadav Use following code to add/remove image from product in Magento2. // Instance of object manager $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); *Remove Images From Product*/ $productId = ; // Id of product $product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId); $productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); $existingMediaGalleryEntries = $product->getMediaGalleryEntries(); foreach ($existingMediaGalleryEntries as