Magento

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

3
更新されない製品数の表示
製品の閲覧数を保存する3つの異なるテーブルがあります report_viewed_product_aggregated_daily report_viewed_product_aggregated_monthly report_viewed_product_aggregated_yearly 製品の現在の閲覧数を取得したい場合は、これらのテーブルのいずれかから取得できます。しかし、問題は、フロントエンドで製品を開くたびに、これらのテーブルのいずれにもその製品に関連する結果が表示されないことです。 Magentoの組み込みの問題ですか? ユーザーが製品を開いたときにMagento cronがこれらのテーブルを即座に更新するように設定する必要があると思いましたが、それも私にとっては機能しませんでした。

4
請求書メールテンプレートの商品画像
請求書メールテンプレートの製品画像を取得しようとしています。以下のコードを使用しました。しかし、メールテンプレートでMagentoプレースホルダー画像しか取得できません。 <td> <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product_id = $_item->getOrderItem()->getProduct(); $product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id); $_imagehelper = $objectManager->get('Magento\Catalog\Helper\Image'); $image_url = $_imagehelper->init($product, 'cart_page_product_thumbnail')->getUrl(); ?> <img src="<?php echo $image_url; ?>" alt="<?php echo $product->getName(); ?>" /> </td>

1
Magento Enterprise 2.2.0のadminhtml顧客アカウントフォームに顧客属性が表示されない
モジュール「Wgac_Subscription」を作成しました。カスタムの顧客属性を作成したい。下の画像に示すように、管理画面に表示されますが、お客様の管理画面には表示されません。 Wgac / Subscription / Setup / InstallData.php <?php namespace Wgac\Subscription\Setup; use Magento\Eav\Setup\EavSetup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Customer\Model\Customer; use Magento\Customer\Setup\CustomerSetupFactory; use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet; use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class InstallData implements InstallDataInterface { private $eavSetupFactory; /** * @var CustomerSetupFactory */ protected $customerSetupFactory; /** * @var …

1
Magento 2.2:definition.map.xmlファイルとは何ですか?
Magento 2.2では、新しいファイルdefinition.map.xmlが導入されました。 このファイルの目的と目的は何ですか?これはでのschemaMapプロパティの構築に関連しているようですMagento\Ui\Config\Converterが、GitHubのメモには、このファイルの意図や、その内容が伝えることを実際に説明しているものはありません。 一般的な好奇心以外に、私の主な関心はM2.2で壊れたチュートリアルモジュールにパッチを当てることです。

1
Magento2で静的メソッドをオーバーライドする方法
プラグインインターセプターおよび優先設定によるオーバーライドは、静的メソッドでは機能しません。 カスタム可視性を返すには、Magento \ Catalog \ Model \ Product \ VisibilityのgetOptionArrayメソッドをオーバーライドする必要があります /** * Retrieve option array * * @return array */ public static function getOptionArray() { return [ self::VISIBILITY_NOT_VISIBLE => __('Not Visible Individually'), self::VISIBILITY_IN_CATALOG => __('Catalog'), self::VISIBILITY_IN_SEARCH => __('Search'), self::VISIBILITY_BOTH => __('Catalog, Search') ]; } これを達成できる他の方法はありますか?

2
Magento2-ローカル/ステージング/プロダクションデプロイメント&gitignore
これは質問というよりも一種の議論かもしれません。 Magento2とローカル > ステージング > 本番環境で従うデプロイメントポリシーを知りたい 何度か試した後、最善の(または、少なくとも最も確実な)アプローチは、git内のベンダーフォルダーを含むこのgitignoreファイルになると判断しました。 .DS_Store /.buildpath /.cache /.metadata /.project /.settings atlassian* /nbproject /sitemap /sitemap.xml /.idea /.gitattributes /app/config_sandbox /app/etc/config.php /app/etc/env.php /app/code/Magento/TestModule* /lib/internal/flex/uploader/.actionScriptProperties /lib/internal/flex/uploader/.flexProperties /lib/internal/flex/uploader/.project /lib/internal/flex/uploader/.settings /lib/internal/flex/varien/.actionScriptProperties /lib/internal/flex/varien/.flexLibProperties /lib/internal/flex/varien/.project /lib/internal/flex/varien/.settings /node_modules /.grunt /pestle.phar /pub/media/*.* !/pub/media/.htaccess /pub/media/catalog/* !/pub/media/catalog/.htaccess /pub/media/customer/* !/pub/media/customer/.htaccess /pub/media/downloadable/* !/pub/media/downloadable/.htaccess /pub/media/import/* !/pub/media/import/.htaccess /pub/media/theme/* /pub/media/theme_customization/* !/pub/media/theme_customization/.htaccess /pub/media/wysiwyg/* !/pub/media/wysiwyg/.htaccess /pub/media/tmp/* …



1
Magento 2のURLで予約語を使用する
Magento 2で、標準のルーティングを使用して、次の形式のURLに応答するモジュールを作成することは可能ですか? http://magento.example.com/namespace_module/return/index つまり、2番目のパラメーターがPHPの予約済みキーワードであるURL です。上記の問題は、PHPコントローラークラス名を作成することです。 Namespace\Module\Controller\Return\Index そしてReturn名前空間にいることは違法なPHPです。URLの最後のパラメーター(伝統的にアクションと呼ばれていました)が予約済みのキーワードだったかどうか http://magento.example.com/namespace_module/foo/return Magentoでは、次の名前のコントローラークラスを作成できます。 Namespace\Module\Controller\Foo\ReturnAction ただし、これは2番目のパラメーターに対しては機能しません。 標準のMagento 2ルーティング技術を使用してこれを行う方法はありますか? そうでない場合、この動作を実現するためにカスタムルーターオブジェクトを挿入するための一般的に考えられるベストプラクティス、またはこれを回避できる他のいくつかの手法はありますか?(afterプラグインMagento\Framework\App\Router\ActionList?)

1
Magento 1.9.3:カートとチェックアウトページにカスタムオプションの価格を(個別に)表示する方法
カートとチェックアウトページにカスタムオプション価格を表示したい。 私は、このURLが、その表示エラー続く:「非オブジェクトのメンバ関数のgetValue()の呼び出し致命的なエラー」に app / design / frontend / default / theme / template / checkout / cart / item / default.phtml $optionId = $_option['option_id']; $product = $_item->getProduct(); $option = $product->getOptionById($optionId); $itemOption = $_item->getOptionByCode('option_' . $option->getId()); $price = false; foreach ($option->getValues() as $values) { if ($values->getId() == $itemOption['value']) { $price = …


1
コメント付きのコードを削除すると、Magentoサイトの速度が上がりますか?
ほとんどの(すべてではない)Magentoファイルには、コメント付きの免責事項があります。 /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE_AFL.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you …
11 magento-1.9  code 



1
Magento 2.x PHPのmemory_limit要件
Magento 2.1のマニュアルがで推奨さmemory_limit=2Gれphp.iniていることに気づきました。これは非常に大量のメモリです。そのメモリはHTTPリクエストごとに許可されていませんか?PHPスクリプトにその量のメモリを提供し、Magentoを共有ホスティングに利用できないようにするホスティングプロバイダーはないでしょう。 それはおそらくセットアップと移行のための量ですか?その量は本当に生産に必要ですか? 私もドキュメントで見つけました: Set the PHP memory limit. Our detailed recommendations are: Compiling code or deploying static assets, 756M Installing and updating Magento components from Magento Marketplace, 2G Testing, 2G 生産に関する推奨事項については触れていません。生産には何が推奨されますか?

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