标签: magento2

在magento2中以编程方式创建简单产品

Magento的-2:

如何从magento-2外部以编程方式创建一个简单的产品

magento magento2

6
推荐指数
1
解决办法
2943
查看次数

PHP7中的分段错误

我们遇到过PHP 7.0这个奇怪的问题.我们在PHP 7.0上运行Magento2的索引器,并且在不同的环境中有不同的结果.如果我们使用CentOS,并从Remi的RepoWebtatic Repo获得PHP 7.0 ,我们会得到如下的分段错误:

Program received signal SIGSEGV, Segmentation fault.
zend_mm_alloc_small (size=<optimized out>, bin_num=<optimized out>, heap=<optimized out>) at /usr/src/debug/php-7.0.1RC1/Zend/zend_alloc.c:1291
1291                    heap->free_slot[bin_num] = p->next_free_slot;
Missing separate debuginfos, use: debuginfo-install openssl-libs-1.0.1e-51.el7_2.1.x86_64
(gdb) backtrace
#0  zend_mm_alloc_small (size=<optimized out>, bin_num=<optimized out>, heap=<optimized out>) at /usr/src/debug/php-7.0.1RC1/Zend/zend_alloc.c:1291
#1  zend_mm_alloc_heap (size=<optimized out>, heap=<optimized out>) at /usr/src/debug/php-7.0.1RC1/Zend/zend_alloc.c:1358
#2  _emalloc (size=3, size@entry=32) at /usr/src/debug/php-7.0.1RC1/Zend/zend_alloc.c:2442
#3  0x0000555555666840 in zend_string_alloc (persistent=0, len=4) at /usr/src/debug/php-7.0.1RC1/Zend/zend_string.h:121
#4  php_pcre_replace_impl (pce=pce@entry=0x555555e76e40, subject_str=subject_str@entry=0x7fffd72fec68, subject=subject@entry=0x7fffd72fec80 "TypeId", subject_len=subject_len@entry=6, replace_val=replace_val@entry=0x7fffd2a393b0,
    is_callable_replace=is_callable_replace@entry=0, …
Run Code Online (Sandbox Code Playgroud)

magento2 php-7 magento-2.0

6
推荐指数
1
解决办法
1774
查看次数

Magento 2改变了Js和CSS

我是magento 2的新手,我正在为它创建扩展.

但是我无法看到任何js和css的变化.

当我检查我的源代码我的js文件custom.js和css文件custom.css正确加载但我无法看到我的任何更改.

我试图清除缓存,但没有得到任何结果.

我也从备份和手动清除了缓存,并禁用了所有缓存.

请帮助我.

caching magento magento2 magento-2.0

6
推荐指数
1
解决办法
6197
查看次数

覆盖自定义模块中的html文件 - magento2

我正在为magento2中的支付方式开发自定义模块.目前我正在使用来自供应商目录的cc-form.html和模块工作正常.见下面的路径.

供应商/的magento /模块付款/视图/前端/网络/模板/支付/ CC-form.html

有没有办法覆盖html文件?

任何帮助,将不胜感激.谢谢!

magento2 magento-2.0 magento2.0.2

6
推荐指数
1
解决办法
4727
查看次数

如何获得mageinferno/magento2-docker-compose设置来安装扩展?

这里使用docker compose playbook ,我无法想象如何使用管理面板来安装扩展.

我们将auth.json文件存在于用户的~/.compose/auth.json文件中,并按照README的建议安装在适当的容器中.但是,如何在M2SETUP_USE_ARCHIVEenv变量设置为false的情况下运行安装容器并不清楚.这样做总是失败.

到目前为止,我们唯一能够工作的是Magento 2.1实例,但是Admin面板似乎缺少功能(例如,系统选项卡中缺少组件管理器).

如何使设置正常工作?拥有支持扩展支持的干净Magento实例的最佳方法是什么?

magento magento2

6
推荐指数
0
解决办法
285
查看次数

在选择中的更改事件与淘汰赛

我有一个问题如何调用onchanges敲js到我的选择选项,我已经有一个函数和HTML,但当我选择选择选项,没有任何变化

<select data-bind="event:{change:setSelectedStation() },
                   options: seedData,
                   optionsText: 'text',
                   optionsValue: 'value'">
</select>
Run Code Online (Sandbox Code Playgroud)

这是我的功能

setSelectedStation: function(element, KioskId){
     this.getPopUp().closeModal();
     $('.selected-station').html(element);
     $('[name="popstation_detail"]').val(element);
     $('[name="popstation_address"]').val(KioskId);

     $('[name="popstation_text"]').val(element);
     // console.log($('[name="popstation_text"]').val());
     this.isSelectedStationVisible(true);
},
Run Code Online (Sandbox Code Playgroud)

javascript jquery onselect knockout.js magento2

6
推荐指数
1
解决办法
8979
查看次数

Magento 2.2.0 - 无法添加捆绑产品

我试图添加产品与捆绑类型,时间得到如下错误.

无法保存孩子:"未知的实体类型:Magento\Bundle\Model\Selection\Interceptor required"

magento2

6
推荐指数
1
解决办法
447
查看次数

Magento2; 通过 REST API 更新库存

我已经使用示例数据设置了本地 Magento 2.1.2 环境。我正在尝试通过 REST api(catalogInventoryStockRegistryV1 - Put)找到更新股票的正确代码。

这是我到目前为止所得到的:

<?php

$adminUrl = 'http://www.localurl.pro/rest/V1/integration/admin/token/';
$ch = curl_init();
$data = array("username" => "admin", "password" => "66sRz97CZt7N[GdqFU");

$data_string = json_encode($data);
$ch = curl_init($adminUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Content-Length: ' . strlen($data_string))
);
$token = curl_exec($ch);
$token=  json_decode($token);

$headers = array("Authorization: Bearer $token");

$requestUrl='http://www.localurl.pro/rest/V1/products/24-MB01/stockItems/1';
// Sample SKU

$sampleProductData = array(
        "qty" => 100
);
$productData = json_encode(array('stockItem' => $sampleProductData));
// Prints: {"stockItem":{"qty":100}}

$ch = …
Run Code Online (Sandbox Code Playgroud)

api rest stock magento2

5
推荐指数
1
解决办法
5540
查看次数

Android:Magento 2电子商务网站不在android Webview中工作

当我试图在Android中加载Magento 2 电子商务网站时WebView,我收到以下错误消息:

"无法发送cookie.将超出最大cookie数量."

这个错误的原因是什么?我怎样才能解决这个问题.?任何人都可以帮助我吗?

Android代码

WebView webView=(WebView) findViewById(R.id.disp);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setLoadsImagesAutomatically(true);
        webView.getSettings().setLoadWithOverviewMode(true);
        webView.getSettings().setAppCacheEnabled(false);
        webView.getSettings().setAllowContentAccess(true);
        webView.getSettings().setAllowFileAccess(true);
        webView.setWebViewClient(new MyViewClient());
        try {
            webView.loadUrl("https://sweetroomksa.com/");
        }catch (Exception e){


        }
Run Code Online (Sandbox Code Playgroud)

android webview magento2

5
推荐指数
1
解决办法
494
查看次数

Magento 2 自定义模块和 Web 服务返回空白数组

我是 magento 2x 的新手。但是,我尝试创建一个自定义模块和一个网络服务来检查客户电子邮件是否存在。但结果我得到的只是一个空白数组。这是我到目前为止所做的:

1. app/code/Test/Customers/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
        \Magento\Framework\Component\ComponentRegistrar::MODULE,
        'Test_Customers',
        __DIR__
    );
Run Code Online (Sandbox Code Playgroud)

2. app/code/Test/Customers/etc/module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"><module name="Test_Customers" setup_version="1.0.0"></module></config>
Run Code Online (Sandbox Code Playgroud)

3. app/code/Test/Customers/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"><preference for="Test\Customers\Api\AccountInterface" type="Test\Customers\Model\Account"/></config>
Run Code Online (Sandbox Code Playgroud)

4. app/code/Test/Customers/etc/webapi.xml

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"><route url="/V1/customers/isEmailExist/" method="POST"><service class="Test\Customers\Api\AccountInterface" method="isEmailExist"/><resources><resource ref="anonymous"/></resources></route></routes>
Run Code Online (Sandbox Code Playgroud)

5. app/code/Test/Customers/Api/AccountInterface.php

    namespace Test\Customers\Api;
/**
 * Account interface.
 * @api
 */

interface AccountInterface
{
    /**
     * Check if given email is associated with a customer account in given website.
     * @api
     * @param string $customerEmail
     * @return \Test\Customers\Api\AccountInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function isEmailExist($customerEmail); …
Run Code Online (Sandbox Code Playgroud)

php xml web-services magento magento2

5
推荐指数
0
解决办法
660
查看次数