标签: magento2

我已经成功安装了magento2,但是有很多js错误

我已经成功安装了magento2,但是有很多js错误.

当看到控制台登录firebug时,它显示了很多错误,还有其他任何东西可以配置magento css和js.

在此输入图像描述

magento magento2

7
推荐指数
2
解决办法
5238
查看次数

"setup"命名空间中没有定义命令:Magento 2

我安装了latest version of Megento 2,一切都工作正常前端,后端和功能.

我有一个bin/magento setup:upgrade命令问题 ,当我在终端运行此命令时,我得到以下异常.

[InvalidArgumentException]
"setup"命名空间中没有定义命令.

截图:

在此输入图像描述

我在安装过程中是否遗漏了任何东西,或者我需要安装一些软件包以使其正常工作?

magento magento2 magento-2.0

7
推荐指数
3
解决办法
1万
查看次数

在Magento 2中的Wysiwyg编辑器中允许PDF和/或ZIP文件

是否可以在Magento 2中的wysiwyg编辑器中上传和链接PDF/ZIP文件?我为Magento 1.x找到了很多解决方案,但没有为Magento 2找到解决方案.

magento magento2 magento2.0.2

7
推荐指数
1
解决办法
1262
查看次数

如何在管理网格Magento 2中使用UI组件使用默认过滤器

我想在使用UI组件的magento 2管理网格时对记录应用默认过滤器.

我知道使用块来渲染管理网格有一种方法,但我想要使用UI组件的方式.

magento2

7
推荐指数
1
解决办法
724
查看次数

Magento 2 - REST API PUT产品

当我尝试更新通过REST V1 API创建的产品时,只会为de default网站更新值.不幸的是,我找不到在te json中发送网站ID的任何可能性.以前有没有人经历过这个?

我发送更新到/ V1/products/123456的数据:

{"product":{"sku":"123456","name":"D4D0123299","price":21,"type_id":"simple","custom_attributes":[],"extension_attributes":{"stock_item":{"use_config_manage_stock":1}}}}"
Run Code Online (Sandbox Code Playgroud)

将产品链接到特定网站后,通过/ V1 /产品创建第二个请求到/ V1/products/123456 /网站(POST),使用此数据foreach网站:

"{"productWebsiteLink":{"sku":"D4D01232","websiteId":1}}"
"{"productWebsiteLink":{"sku":"D4D01232","websiteId":2}}"
Run Code Online (Sandbox Code Playgroud)

Magento的2版本是2.1.0

php rest magento magento2 magento-2.0

7
推荐指数
1
解决办法
2997
查看次数

如何在Magento2的customer表中添加自定义列?

我想在magento2的Customer表中添加一个自定义列(Telephone),并希望在客户注册时在该字段中添加值.

首先,我在customer_entity表中的DB中创建一个列(Telephone).当我在执行函数中调用Magento/Customer/Controller/Account/CreatePost.php中的 $ customer-> setTelephone('1234567890')时创建客户.它在Magento/Customer/Model/Data/Customer.php中给出了一个错误Undefine function setTelephone.但是我已经在这个模型中创建了这个函数.

Magento的/客户/控制器/帐号/ CreatePost.php

public function execute()
{
    /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
    $resultRedirect = $this->resultRedirectFactory->create();
    if ($this->session->isLoggedIn() || !$this->registration->isAllowed()) {
        $resultRedirect->setPath('*/*/');
        return $resultRedirect;
    }

    if (!$this->getRequest()->isPost()) {
        $url = $this->urlModel->getUrl('*/*/create', ['_secure' => true]);
        $resultRedirect->setUrl($this->_redirect->error($url));
        return $resultRedirect;
    }

    $this->session->regenerateId();

    try {
        $address = $this->extractAddress();
        $addresses = $address === null ? [] : [$address];

        $customer = $this->customerExtractor->extract('customer_account_create', $this->_request);
        $customer->setAddresses($addresses);

        //Here is I set the telephone and it …
Run Code Online (Sandbox Code Playgroud)

php mysql magento magento2

7
推荐指数
1
解决办法
4808
查看次数

在Magento 2中使用观察者应用自定义促销规则

我在Magento 2中创建了新表,用于存储自定义promorules,现在我已经为事件创建了观察者controller_action_predispatch_checkout_cart_couponPost,在观察者中我想检查用户是否输入了任何自定义规则,然后根据该规则应用折扣.

以下是我的代码:

<?php
namespace Webkul\Grid\Observer;

use Magento\Framework\Event\ObserverInterface;

class coupenAppliedAfter implements ObserverInterface
{
    /**
     * @var ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    /**
     * customer register event handler
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        // get enetered coupen code
        $controller = $observer->getControllerAction();
        $couponCode = $controller->getRequest()->getParam('coupon_code');

        $objectManager =   \Magento\Framework\App\ObjectManager::getInstance();
        $connection = $objectManager->get('Magento\Framework\App\ResourceConnection')->getConnection('\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION'); 
        // get list of …
Run Code Online (Sandbox Code Playgroud)

php observers magento2 cart-rules magento2.1

7
推荐指数
1
解决办法
551
查看次数

Magento 2分层导航没有结果

我对Magento 2的分层导航有一个问题,即在应用某些属性过滤器时它没有显示结果.显示结果的唯一过滤器是价格.

我通过赋值"Filterable(with results)"创建了4个其他属性(Lab,format,season等).我创建的这些属性在"分层导航"菜单中正确显示,并且还指示每个属性具有的产品数量.

分层导航菜单 -  Magento2

但是,当我点击其中任何一个时,我都会收到消息,说没有找到带有这些属性的产品.

分层导航结果为空

我试图清理缓存,重新索引并将magento模式更改为生产但没有任何作用

layered-navigation magento2

7
推荐指数
1
解决办法
525
查看次数

在localhost上Magento 2.3.0 CE上的空白管理页面

我在我的本地机器上安装了Magento 2.3,安装顺利.我可以访问我的商店localhost/magento.我试图访问我的管理页面,localhost/magento/admin_pogi但它给了我一个空白页面并重定向到网址http://localhost/magento/admin_pogi/admin/index/index/key/a062e79f617010c42b07d662103d5142cd9bbe86314fb54da3e4cb5542b11eee/.

我到目前为止尝试的是启用开发模式,我在管理页面上看到此错误:

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid 
template file: 'C:/xampp/htdocs/magento/vendor/magento/module- backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 
'Magento_Backend' block's name: 'require.js'

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp/htdocs/magento/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'
#0 C:\xampp\htdocs\magento\vendor\magento\framework\View\Element\Template.php(301): 
Magento\Framework\View\Element\Template->fetchView('C:/xampp/htdocs...')
#1 C:\xampp\htdocs\magento\vendor\magento\framework\View\Element\AbstractBlock.php(668): Magento\Framework\View\Element\Template->_toHtml()#2 
C:\xampp\htdocs\magento\vendor\magento\framework\View\Result\Page.php(249): 
Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 
C:\xampp\htdocs\magento\vendor\magento\framework\View\Result\Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 C:\xampp\htdocs\magento\generated\code\Magento\Backend\Model\View\Result\Page\Interceptor.php(193): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#5 C:\xampp\htdocs\magento\vendor\magento\framework\App\Http.php(139): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 C:\xampp\htdocs\magento\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#7 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#8 C:\xampp\htdocs\magento\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#9 {main}
Run Code Online (Sandbox Code Playgroud)

javascript php xampp magento magento2

7
推荐指数
1
解决办法
4640
查看次数

用管道(|)分隔限制值

我正在尝试找出如何用竖线(|)分隔限制器值的方法

理想情况下,最终结果将是:View | 48 | 120 | 全部,目前我已经能够查看:48 120 ALL

这是我到目前为止使用的:

<div class="field limiter">
    <label class="label" for="limiter">
        <span><?= /* @escapeNotVerified */ __('View:') ?></span>
    </label>
    <div class="control">
        <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
            <a data-role="limiter" href="#" data-value="<?php /* @escapeNotVerified */ echo $_key ?>"<?php if ($block->isLimitCurrent($_key)): ?>
                class="selected"<?php endif ?>>
                <?php /* @escapeNotVerified */ echo $_limit ?>
            </a>
        <?php endforeach; ?>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

categories magento2

7
推荐指数
1
解决办法
30
查看次数