小编Dan*_*iel的帖子

Wordpress Woocommerce - 使用update_post_meta添加产品属性

我客户网站上的产品需要我通过产品 - > Wordpress管理中的属性添加的某些属性.在这个导入脚本我编码我需要使用该函数update_post_meta($post_id, $meta_key, $meta_value)导入适当的属性和值.

目前我有这样的功能:

update_post_meta( $post_id, '_product_attributes', array());
Run Code Online (Sandbox Code Playgroud)

但是我不确定如何正确传递属性及其值?

php wordpress woocommerce

9
推荐指数
2
解决办法
2万
查看次数

管理员登录页面上的Magento白色屏幕?

我试图让Magento从我正在使用的主题的adminHtml中加载核心文件,而不是默认的核心位置,并将以下代码添加到我的扩展中:

<stores>
<admin>
<!-- default admin design package and theme -->
    <design>
        <package>
            <name>fortis</name>
        </package>
        <theme>
            <default>default</default>
        </theme>
    </design>
</admin>
Run Code Online (Sandbox Code Playgroud)

现在,当我去网上商店/管理员时,我得到的只是一个白色屏幕.我甚至都不能登录了.当我从我的扩展配置文件中删除代码时,即使我禁用扩展程序,我得到的只是一个白色屏幕.

有人知道怎么修这个东西吗?

谢谢.

php themes config module magento

5
推荐指数
2
解决办法
8537
查看次数

Wordpress - 以编程方式添加不生成缩略图的产品

我正在为客户端创建自定义CSV导入程序并添加图片,但是缩略图未正确生成.使用像Regenerate Thumbnails这样的插件后,它们会正确显示.

这是我添加附件并将其链接到帖子的代码.

    $uploadDir = 'wp-content/uploads/importedproductimages/';
    $siteurl = get_option('siteurl');
    $thumbnail = 'importedproductimages/' . $name;
    $filename = 'importedproductimages/' . $name;
    $wp_filetype = wp_check_filetype($filename, null);
    $attachment = array(
                'post_author' => 1, 
                'post_date' => current_time('mysql'),
                'post_date_gmt' => current_time('mysql'),
            'post_mime_type' => $wp_filetype['type'],
            'post_title' => $filename,
                'comment_status' => 'closed',
                'ping_status' => 'closed',
            'post_content' => '',
            'post_status' => 'inherit',
                'post_modified' => current_time('mysql'),
                'post_modified_gmt' => current_time('mysql'),
                'post_parent' => $post_id,
                'post_type' => 'attachment',
                'guid' => $siteurl.'/'.$uploadDir.$name
    );

    $attach_id = wp_insert_attachment( $attachment, $filename, $post_id );
    $attach_data = wp_generate_attachment_metadata( $attach_id, …
Run Code Online (Sandbox Code Playgroud)

php wordpress woocommerce

4
推荐指数
1
解决办法
5556
查看次数

wp_user_create - 设置角色 - Wordpress

在我正在开发的这个自定义插件中,我使用函数wp_user_create(); 添加用户 我想设置一个指定的角色,因为现在它们都被添加为"订阅者".之后是否可以将新创建​​的用户用户角色设置为"编辑"或"作者"或任何自定义角色?

先感谢您.

php wordpress plugins roles

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

Magento - 无效的块类型

每当我使用 Buckaroo 的付款保证方法下订单时,我都会收到一条消息:您的付款未成功。请重试或选择其他付款方式。

然后,以下堆栈跟踪代码将添加到 exception.log 文件中:

   2014-03-07T14:10:26+00:00 ERR (3): 
    exception 'Mage_Core_Exception' with message 'Invalid blocktype: ' in /app/Mage.php:594
    Stack trace:
    #0 /app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid blockty...')
    #1 /app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
    #2 /app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'cart_sidebar')
    #3 /app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'cart_sidebar')
    #4 /app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
    #5 /app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
    #6 /app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
    #7 /app/code/core/Mage/Catalog/controllers/CategoryController.php(146): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
    #8 /app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_CategoryController->viewAction()
    #9 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
    #10 /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #11 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
    #12 /app/Mage.php(683): Mage_Core_Model_App->run(Array)
    #13 /index.php(87): Mage::run('', 'store')
    #14 {main}
Run Code Online (Sandbox Code Playgroud)

它说无效的块类型:并且似乎没有显示名称。

不认为这与在付款方式的 form.phtml 中创建块的这段代码有任何关系吗?

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('buckaroo3extended/paymentguarantee/termsAndConditions.phtml')->toHtml();?>
Run Code Online (Sandbox Code Playgroud)

php magento

2
推荐指数
1
解决办法
6593
查看次数

标签 统计

php ×5

wordpress ×3

magento ×2

woocommerce ×2

config ×1

module ×1

plugins ×1

roles ×1

themes ×1