«magento2» 태그된 질문

부 버전에 국한되지 않은 Magento 2에 대한 일반적인 질문. 이 태그를 사용하여 Magento 1과 구별하십시오. 특정 버전에 문제가있는 경우 적절한 'Magento-2.x'태그를 대신 사용하십시오. Magento 2 부 버전의 기능은 다를 수 있습니다.


1
Magento 2는 녹아웃 JS 바인딩을 어떻게 적용합니까?
KnockoutJS 문서를 매우 꼼꼼하게 읽으면 매우 기본적인 Knockout 뷰를 초기화하는 것은 다음과 같습니다. // This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI function AppViewModel() { this.firstName = "Bert"; this.lastName = "Bertington"; } // Activates knockout.js ko.applyBindings(new AppViewModel()); 즉, 객체 생성자로 사용되는 자바 …

1
치명적 오류 magento 2에서 내 블록을 호출하는 동안 멤버 함수 dispatch () 호출
이것은 내 차단 파일입니다. <?php namespace ChennaiBox\Mymail\Block\Mail; class MailContent extends \Magento\Framework\View\Element\Template { protected $_objectManager; protected $customerSession; public function __construct( \Magento\Customer\Model\Session $customerSession, \Magento\Framework\ObjectManagerInterface $objectManager ) { $this->customerSession = $customerSession; $this->_objectManager = $objectManager; } public function mymailData() { try{ if ($this->customerSession->isLoggedIn()) { $cutomerEmail =(string)$this->customerSession->getCustomer()->getEmail(); echo $cutomerEmail; else{ $this->_redirect('customer/account/login/'); } }catch (Exception $e) …


4
phtml magento 2에서 루트 디렉토리 경로를 얻는 방법은 무엇입니까?
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $mediaPath = $fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath(); 미디어 경로를 반환합니다. phtml 페이지에서 프로젝트의 루트 경로를 얻는 방법은 무엇입니까?

1
Magento 2가`path` 대신 RequireJS`map`을 사용하는 이유
Magento 2의 RequireJS 구현에서 많은 핵심 모듈은 다음과 같은 구성을 사용합니다. map: { '*': { editTrigger: 'mage/edit-trigger', addClass: 'Magento_Translation/add-class' } } RequireJS에서 map구성 지시문을 통해 개발자는 RequireJS에 알릴 수 있습니다. 모듈 X를로드하고 모듈 Y를 사용하는 경우 모듈 Y를 모듈 Z로 교체하십시오 ( 단, 모듈 X에만 해당). 또는 코드에서 map: { …

2
본문에 CSS 클래스를 추가하는 방법 [Magento2]
본문 태그에 CSS 클래스를 추가하려고하는데 본문 태그가 렌더링되는 위치에서 파일을 찾을 수 없습니다. 다른 태그가 오는 것처럼 본문 태그에 하나의 CSS 클래스를 추가해야합니다.> page-with-filter page-products page-layout-2columns-left myclasshere 아래의 이전 버전에서는 본문에 클래스를 추가하는 xml 코드가있었습니다. <reference name="root"> <action method="addBodyClass"> <classname>my-profile</classname> </action> </reference> 나는 이것을 사용해 보았지만 효과가 없었다. page-layout-2columns-left템플릿만으로 하나의 …
19 magento2 

5
마 젠토 2 : 데이터베이스에서 고객 비밀번호를 재설정하는 방법
DB의 고객 비밀번호 해시입니다. 따라서 MD5 & Sha1이 작동하지 않습니다. UPDATE `customer_entity` SET `password` = MD5('test123') WHERE `email` = 'X@X.com'; 데이터베이스 쿼리를 사용하여 비밀번호를 업데이트하는 방법 아마도MD5(Sha1('test123')) ? Magento가 코드를 통해 수행하는 방식 이동vendor\magento\module-customer\Console\Command\UpgradeHashAlgorithmCommand.php protected function execute(InputInterface $input, OutputInterface $output) { $this->collection = $this->customerCollectionFactory->create(); $this->collection->addAttributeToSelect('*'); $customerCollection = $this->collection->getItems(); /** @var …

2
마 젠토 2 : 프로그래밍 방식으로 제품 이미지를 추가 / 삭제하는 모범 사례?
기존 제품에 이미지를 업로드하고 싶습니다. 이미지는입니다 import_dir. 그리고 카탈로그에 이미 존재하는 제품에 추가해야합니다. 나는 그것을하는 두 가지 방법 만 찾을 수 있습니다. 1. "나쁜 습관"방식-제품 모델 사용\Magento\Catalog\Model\Product::addImageToMediaGallery 1. Copy the images from `import_dir` to `pub/media/tmp` 2. Add the images to the product 3. Save product 암호 /* copy files from …

2
어려운 종속성과 부드러운 종속성은 무엇입니까?
Magento 2 (안정된 버전)에서는이 명령을 실행할 bin/magento info:dependencies:show-modules수 있으며 modules-dependencies.csv다음과 같은 모든 모듈 종속성으로 호출 되는 응용 프로그램의 루트에 csv 파일 이 있습니다. Hard 의존성은 무엇이며 Soft 의존성은 무엇입니까? 각각의 예가 도움이 될 것입니다.

3
체크 아웃 단계 변경 중에 특성에 Magento \ Quote \ Api \ Data \ AddressInterface 클래스에 해당 설정자가 없습니다.
1-customer_address에 eav 속성을 추가합니다 $attributesInfo = [ 'reference' => [ 'label' => 'Reference', 'type' => 'varchar', 'input' => 'text', 'position' => 100, 'visible' => true, 'required' => false, ], ]; foreach ($attributesInfo as $attributeCode => $attributeParams) { $customerSetup->addAttribute('customer_address', $attributeCode, $attributeParams); } 2-모듈에 확장 속성을 추가했습니다 <extension_attributes for="Magento\Quote\Api\Data\AddressInterface"> <attribute code="reference" type="string"/> …


2
마 젠토 2-DateTime UI 구성 요소를 추가하는 방법
새 페이지를 추가하는 동안 CMS 페이지 섹션에서 새 필드를 날짜 시간으로 추가하고 싶습니다 .magento가 UI 구성 요소를 사용하여 발견했기 때문에 파고 난 후에 아래 코드를 사용하여 날짜 필드를 추가 할 수 있지만 날짜 시간 필드를 추가 할 수는 없었습니다. 누구든지 도울 수 있습니다. 날짜 추가 필드 코드 : <field name="start_date"> …


5
이미지 선택기 매개 변수가있는 새 위젯 인 Magento 2는 사진을 저장하지 않습니다
새 위젯을 만들고 매개 변수 중 하나가 그림 선택기 입니다. 이 코드 만 사용 합니다. 모든 것이 잘 보입니다. 미디어 폴더를 열고 사용하려는 사진을 선택할 수 있습니다. 그림을 선택하면 양식의 그림 필드가이 값으로 채워집니다. http : //local.magento.com/admin/cms/wysiwyg/directive / ___ directive / e3ttZWRpYSB1cmw9Ind5c2l3eWcvcHVycGxlLmpwZyJ9fQ`` 그러나 양식 위젯 데이터를 저장할 때 그림 필드의 …

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.