magento2

Magento 2 - Migration tool - Destination fields are not mapped

孤者浪人 提交于 2019-12-08 02:48:14
问题 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

Error in Draw image on PDF using Zend Framework in Magento2

大兔子大兔子 提交于 2019-12-07 22:14:37
问题 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

How to get all time zones lists as array in Magento 2

…衆ロ難τιáo~ 提交于 2019-12-07 14:33:41
问题 I have to add one form field in custom admin module that enables the users to select the timezone. So how to get the timezone lists? This code snippet gives timezones list in Magento 1. But how to get same thing in Magento 2? $timezones = Mage::getModel('core/locale')->getOptionTimezones(); 回答1: You should use the \Magento\Config\Model\Config\Source\Locale\Timezone::toOptionArray() like this: /** * @param \Magento\Config\Model\Config\Source\Locale\Timezone $timezone */ public function _

Creating shipment does not update items shipped quantity and order is not complete

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 10:15:54
问题 I'm developing a procedure that has to programatically create shipment for orders that are already paid and invoiced. The problem is that even after creating the shipment, the order status remains to 'processing' instead of going to 'complete'. This does not happen if I manually Ship from the backend. I found that the problem is that the quantity shipped for the order items is not updated, but remains 0 after saving the shipment and the order. This is the procedure i'm using. No exception is

Composer - how to ignore some map files?

流过昼夜 提交于 2019-12-07 09:38:51
问题 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? 回答1: I works like this, for example if you want to prevent the pub/.htaccess from being overwritten. Add

Css changes reflect only after deploy command in magento2

こ雲淡風輕ζ 提交于 2019-12-07 09:00:40
问题 Now i have created custom theme in magento2.Every time i wrote css it doesn't reflect immediately.I have changed mode to "developer".And also disable cache in backend.I have given the following commands to reflect my custom css. rm -f var/* -R rm -f pub/static -R php bin/magento setup:static-content:deploy chmod 0777 var -R chmod 0777 pub/static -R It takes too much time to do my design work.So please anyone help on this. 回答1: The solution suggested by Emizen Tech works fine and helps me out

Magento 2 - No redirect to external payment provder

淺唱寂寞╮ 提交于 2019-12-06 22:48:38
Today I started working on a payment module for Magento 2. After a lot of try and errors I now have a payment module that can be configured and has restrictions. Now, the next step would be to start a transaction request after placing the order. Within Magento 1 I would use getOrderPlaceRedirectUrl() to return an url where the consumer would be redirected to. When I try this with Magento 2 then the function is called but no redirect is done to the return url. Does anyone know if this has changed within Magento 2 or what I'm doing wrong? The function looks like: public function

magento 2 rest api : get cart items with images

浪尽此生 提交于 2019-12-06 16:48:05
In rest api, I am using "/rest/V1/guest-carts/e3e1fd447e0e315dd761942cf949ce5d/items" method to get the magento cart items. It works well and the result is [ { "item_id": 100, "sku": "abc-1", "qty": 1, "name": "Product one", "price": 19, "product_type": "simple", "quote_id": "e3e1fd447e0e315dd761942cf949ce5d" }, { "item_id": 101, "sku": "abc-2", "qty": 1, "name": "Product two", "price": 54, "product_type": "simple", "quote_id": "e3e1fd447e0e315dd761942cf949ce5d" } ] Now I want get the images of each products in the list(Possibily a thumbnail image). Is there any way to achieve this result?

How to remove empty attributes “N/A” in Magento 2?

跟風遠走 提交于 2019-12-06 15:36:50
I am using Magento 2 with Porto theme, I recently updated theme and magento now in product information I am also seeing empty attributes that are unrelated to the current products as N/A . how can I hide them? I saw people discussing here this in Magento 1. but it doesn't work for 2.0. please help if you know how to do it. thanks Magento_Catalog/templates/product/view/attributes.phtml if(strpos($_data['value'],"N/A")===false):?> <tr> <th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th> <td class="col data" data-th="<?php echo $block->escapeHtml(__($_data

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