Magento

Magento eコマースプラットフォームのユーザー向けのQ&A

1
Magento 2 ui_componentフォームで顧客属性を表示
ui_componentフォームを作成しました。 顧客の詳細を表示する必要がある場合は、顧客編集と同じです。 しかし、私はcustomer_entityテーブルから彼らのデータを表示することができます。 DataProvider.php public function getData() { if (isset($this->loadedData)) { return $this->loadedData; } // {Vendor}\{Module}\Model\GridFactory // Returns Customer Resource Model $items = $this->gridFactory->create()->getCollection(); $items->getSelect()->join('customer_entity_text as second', 'main_table.entity_id = second.entity_id'); //print_r($items->getData()); exit; foreach($items as $contact){ $this->loadedData[$contact->getEntityId()]['contact'] = $contact->getData(); } return $this->loadedData; } (顧客属性)customer_entity_textを表示するために、テーブルをファクトリに結合しましたstatus。 現在、My Second属性はfiletypeです。にありますcustomer_entity_varchar。まず、別の結合を追加することを考えましたが、それは良い方法ではないと思います。 それで、これに対する解決策はありますか?Customer Attributeフォームに両方を表示する必要があります。 ui_component <field name="value"> …

4
Magento 2はcron:run CLIコマンドなしで特定のCronを実行しますか?
長い話を短くすると、典型的なものを使用している場合、xdebugはcronファイルのブレークポイントで確実に停止しません。 php bin/magento cron:run Xdebugはすべて適切にセットアップされており、動作することもありますが、85%の時間で動作せず、phpstormで接続のリッスンをオフにするまでCLIでハングします。 どういうわけか1つのcronファイルを実行する方法はありますか?理想的ではないxdebugで適切にテストするには、cronファイルの内容を別のコンソールコマンドに実際にコピーして貼り付ける必要がありました。 Magento 1.xでは、AOEスケジューラを使用して、Xdebugでcronジョブをテストするために使用しました。管理者に移動し、目的のチェックボックスをオンにし、ドロップダウンから実行を選択すると正常に機能しました。 私は次のようなものを使用したいと考えています: php bin/magento modulename:cronjob スケジュールされていない場合でも、常にcronを実行する必要があります。
14 magento2  cron  cli  xdebug 

7
Magento 2のリダイレクトコントローラー
カスタマーダッシュボードに新しいカスタムタブを追加しました。カスタムフォームが正常に実行された場合、顧客のメインページにリダイレクトする必要がありますcustomer/account。これどうやってするの?

3
Magento 2-非米国ロケールの製品詳細ページでの製品価格の0.00への変更
Magento 2.0.4のインストール後、非常に奇妙な問題に直面しています。12ドルの価格で製品を作成し、バックエンドでMagento構成からロケールを変更しました。 以下は、リストページのスクリーンショットです。 詳細ページのスクリーンショットもご覧ください。 2つのスクリーンショットの違いに気づいたかもしれません。はい、商品詳細ページには0.00ドルの価格が表示されますが、リストページには追加した価格が保持されます。 製品の詳細ページでは、1〜2秒後に正しい価格が自動的に0ドルに更新されます(Javascriptの更新)。 以下のコードを見つけてください $('[data-price-type="' + priceCode + '"]', this.element).html(priceTemplate({data: price})); さらにコードをデバッグして、Magento 2価格ボックスウィジェットにパラメーターを渡す別のjavascriptコードを見つけます。 <script> require([ 'jquery', 'Magento_Catalog/js/price-box' ], function($){ var priceBoxes = $('[data-role=priceBox]'); priceBoxes = priceBoxes.filter(function(index, elem){ return !$(elem).find('.price-from').length; }); priceBoxes.priceBox({'priceConfig': <?php /* @escapeNotVerified */ echo $block->getJsonConfig() ?>}); }); </script> これでgetJsonConfig()メソッドをチェックしました。 $product = $this->getProduct(); if (!$this->hasOptions()) { …




4
チェックアウトの概要Magento 2にカスタム製品属性を追加する
Magento 2のチェックアウトの概要セクションにあるアイテムのリストにカスタム製品属性を追加しようとしています。テンプレートファイルがMagento_Checkout/web/template/summary/item/details.htmlあり、製品名の前にカスタム属性の値を表示しようとしています。この値がkoテンプレートにどのように追加されるかについてのアイデアはありますか?ここに別の質問があるようですが、答えがありませんでした。

2
Magento 2:catalog_attributes.xmlファイルとは何ですか?
Magento 2 catalog_attributes.xmlの次のフォルダーにいくつかのファイルが含まれていることに気付きました。 app/code/Magento/Bundle/etc app/code/Magento/Catalog/etc app/code/Magento/CatalogSearch/etc app/code/Magento/CatalogUrlRewrite/etc app/code/Magento/Downloadable/etc app/code/Magento/GiftMessage/etc app/code/Magento/Msrp/etc app/code/Magento/Sales/etc app/code/Magento/Tax/etc app/code/Magento/Wishlist/etc これらのファイルは次のようになりSalesます(ファイルの例): <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="quote_item"> <attribute name="sku"/> <attribute name="type_id"/> <attribute name="name"/> <attribute name="status"/> <attribute name="visibility"/> <attribute name="price"/> <attribute name="weight"/> <attribute name="url_path"/> <attribute name="url_key"/> <attribute name="thumbnail"/> <attribute name="small_image"/> <attribute name="tax_class_id"/> <attribute name="special_from_date"/> <attribute name="special_to_date"/> <attribute name="special_price"/> <attribute …

1
Magento 2のデフォルトのヘッダーテンプレートの上書き
テーマを拡張して独自のテーマを作成しましたMagento/Blank。 今、デフォルトのヘッダーテンプレートファイル上書きしたいlink.phtml、topmenu.phtml、header.phtmlに位置していますvendor/module-theme/view/frontend/templates私のテーマに。 私のテーマは app/design/frontend/MyModule/MyTheme オーバーライド方法とその構造を教えてください。

6
magento 2で複数の配送方法がある場合、デフォルトの配送方法を設定するにはどうすればよいですか?
配送方法は2つあり、デフォルトでは誰も選択されていないため、ユーザーは手動で選択する必要があります。その結果、配送と表示されます(未定義-未定義)。何も選択されていない場合は、最初の項目が自動的に選択されるようにしたい

8
販売可能数量が製品グリッドmagento 2でゼロを示していますか?
実際、私の場合、販売可能数量は製品グリッドMagento 2.3でゼロを示しています。 この問題のため、製品はフロントエンドに表示されません。誰かアイデアがあれば教えてください。 このため、インデックスの再作成も行われますが、それでも販売可能な数量はゼロ(0)を示しています。 プログラムで数量を追加および更新しますが、販売可能な数量はゼロと表示されます。

2
Magento 2:カスタム製品割引を適用した後、レイヤードナビゲーション価格フィルターが機能しない
製品割引モジュールに取り組んでいます。私はプラグインとオブザーバーでそれをしました。製品ページとリストページで正常に機能しています。ただし、更新された製品価格に応じて価格フィルターは機能しません。 価格をカスタマイズするために使用しているコードは次のとおりです。 VendorName / ModuleName / etc / di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Pricing\Price\FinalPrice"> <plugin name="custom_discount_catalog_pricing_price_finalprice" type="VendorName\ModuleName\Plugin\FinalPrice" /> </type> </config> VendorName / ModuleName / etc / events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <event name='catalog_product_get_final_price'> <observer name='customdiscount_finalprice' instance='VendorName\ModuleName\Observer\ProcessFinalPrice'/> </event> </config> VendorName / ModuleName / Observer / ProcessFinalPrice.php <?php namespace VendorName\ModuleName\Observer; use …

1
複数選択UIコンポーネントのデフォルト値を設定する
magento 2のインストールにカスタムエンティティがあります。 また、このエンティティのフィールドの1つはmultiselectタイプで、すべての国のリストが含まれています。 管理フォームにUIコンポーネントを使用しています。 選択には約200のレコードがあるので、複数選択フィールドは使いにくいため、複数選択フィールドは使いたくありません。 そのため、製品管理の追加/編集セクションのカテゴリフィールドに似た派手な複数選択の1つを作成しました。 見た目は良くなっていますが、デフォルト値を設定できません。 ここに私の設定があります(default設定項目に注意してください): <field name="affected_countries" formElement="select" component="Magento_Ui/js/form/element/ui-select" sortOrder="100"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="source" xsi:type="string">article</item> <item name="filterOptions" xsi:type="boolean">true</item> <item name="chipsEnabled" xsi:type="boolean">true</item> <item name="disableLabel" xsi:type="boolean">true</item> <item name="default" xsi:type="string">RO,MD</item> </item> </argument> <settings> <elementTmpl>ui/grid/filters/elements/ui-select</elementTmpl> <dataType>text</dataType> <label translate="true">Affected Countries</label> <dataScope>affected_countries</dataScope> <componentType>field</componentType> </settings> <formElements> <select> <settings> <options class="Magento\Config\Model\Config\Source\Locale\Country"/> …


弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.