我只想了解其含义
<block type="page/html" name="root" output="toHtml" template="example/view.phtml">
Run Code Online (Sandbox Code Playgroud)
我从Google获得了许多参考资料,并了解了许多相关内容,但我仍然无法理解type="page/html"如何为我的自定义模块构建类型.
请解释
type="A/B"
Run Code Online (Sandbox Code Playgroud)
让我知道这个A和B来自哪里?
我怎么得到客户ID !! 这些都是我尝试过的东西!你能看出我做错了什么吗?
//include_once "app/Mage.php";
require_once '/home/ab71714/public_html/app/Mage.php';
//Mage::app("default");
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
$customerData = Mage::getModel('customer/customer')->load($customer->getId())->getData();
print_r($customerData);
echo $customerData->getId();
}
//$customerData = Mage::getModel('customer/customer');
//$customerID = $customerData -> getId();
//$userinfo = $customerData->_origData; // fetch users info
$customerID=$customer -> getId();
//$customerID = $customerData->getEntityId();
//$customerID = $customerData[entity_id];
Run Code Online (Sandbox Code Playgroud) 如何获取帖子变量的数据?就像我使用post方法发布表单然后我可以使用$ _REQUEST或$ _POST获取它.我怎么能在mgento做到这一点?
我想为一些自定义字段创建一个简单的url验证器.我尝试了默认的(添加类validate-url或 validate-clean-url输入) - 但这些不能像我希望的那样工作,所以我想写一些我自己的javascript,但与原型验证集成.
有没有人有任何想法我怎么能这样做?
我在搜索中没有找到任何有用的东西,而且我不是非常原型(主要使用jQuery).
我正在关注Ivan的教程(将订单属性添加到Magento 1.4.1中的订单网格)以向sales_order_grid表(Shipping Description文本)添加一个额外的列,并且它正在工作,除了它不会将sales_flat_order中的旧数据带到新列在sales_order_grid中.
我的SQL安装脚本正确地添加了列,因为我使用与sales_flat_order中相同的字段名称我认为我不需要观察者,但是将所有现有出货描述数据导入到shipping_description字段的代码不是运行.
我做错了什么?
我的SQL安装脚本:
<?php
/**
* Setup scripts, add new column and fulfills
* its values to existing rows
*
*/
/* @var $this Mage_Sales_Model_Mysql4_Setup */
$this->startSetup();
// Add column to grid table
$this->getConnection()->addColumn(
$this->getTable('sales/order_grid'),
'shipping_description',
"varchar(255) not null default ''"
);
// Add key to table for this field,
// it will improve the speed of searching & sorting by the field
$this->getConnection()->addKey(
$this->getTable('sales/order_grid'),
'shipping_description',
'shipping_description'
);
// fill existing rows with data
$select …Run Code Online (Sandbox Code Playgroud) 我想启用magento编译,但是当我启用它时,我看到跟随错误:
警告:include_once(.../includes/src/Mage_Core_functions.php)[function.include-once]:无法打开流:第36行的/ app/Mage.php中没有这样的文件或目录
警告:include_once ()[function.include]:无法打开'.../includes/src/Mage_Core_functions.php'以包含(include_path ='/ .../includes/src:.:/ usr/share/php')in.第36行的../app/Mage.php警告:include_once(.../includes/src/Varien_Autoload.php)[function.include-once]:无法打开流:第37行的/.../app/Mage.php中没有此类文件或目录
警告: include_once()[function.include]:无法打开'.../includes/src/Varien_Autoload.php'(include_path ='.../includes/src:.:/ usr/share/php')in.第37行的../app/Mage.php
致命错误:第53行的.../app/Mage.php中找不到"Varien_Autoload"类
任何人都可以帮我修理它们吗?我想要启用编译.在互联网上,关于这个问题的每个答案都禁用了编译.我想要启用编译.仅供参考,我的magento版本是1.7.0.0
我是php的初学者,我一直试图将一个父类别的子类别称为链接
我得到了这个,它提出了getName,但getUrl()根本没有返回任何URL ....
<?php
$children = Mage::getModel('catalog/category')->getCategories(3);
foreach ($children as $category):
echo '<li><a href="' . $category->getUrl() . '">' . $category->getName() . '</a></li>';
endforeach;
?>
Run Code Online (Sandbox Code Playgroud)
输出代码就是 <li><a href="">name of sub-cat</a></li>
有人有什么想法吗?请?
谢谢,凯拉
我创建了自定义模块,现在从编辑表单的管理员端我添加了额外的字段选择类型.我想用这个特定字段的onchange函数更改注释.请参阅下面的代码.
$eventElem = $fieldset->addField('banner_type', 'select', array(
'label' => Mage::helper('multibanners')->__('Banner Style'),
'required' => false,
'onchange' => 'checkSelectedItem(this.value)',
'name' => 'banner_type',
'values' => array(
array(
'value' => 'Banner 1',
'label' => 'AnySlider',
),
array(
'value' => 'Banner 2',
'label' => 'Content Slider',
),
));
$eventElem->setAfterElementHtml("<script type=\"text/javascript\">function checkSelectedItem(selectElement){}</script>");
Run Code Online (Sandbox Code Playgroud)
这是我的代码我警告价值,我得到了我的价值,但它无法在评论区显示.有人知道如何解决它?
谢谢
我正在尝试移动默认欢迎消息旁边的顶部链接中的"登录"链接.C:\ xampp\htdocs\myhealthzone\app\design\frontend\default\myhealth\template\page\html\header.phtml我把代码作为
<p class="welcome-msg">
<?php echo $this->__('Hi %s', Mage::getSingleton('customer/session')->getCustomer()->getFirstname()); ?>
<?php echo $this->getAdditionalHtml() ?>
</p>
Run Code Online (Sandbox Code Playgroud)
但这只适用于会话.请更新我如何在此处获取登录链接而不是会话.
我需要促销/优惠券按顺序改变哪个项目的信息以及折扣前这个项目的价格和这个项目的最终价格.我知道,这很复杂所以这是一个例子:
<order>
<items>
<item> <!-- This item have discount in order -->
<sku>1234</sku>
<promotion>
<promo_id>456</promo_id>
<discount_value>10</discount_value><!-- In % or $ -->
</promotion>
<final_price>25</final_price>
</item>
<item><!-- This item don't have discount in order -->
<sku>1234</sku>
<promotion/>
<final_price>35</final_price>
</item>
</items>
</order>
Run Code Online (Sandbox Code Playgroud)
我希望这是可以理解的解释.谢谢你的帮助.
编辑:我忘了一件事.所有我都有来自销售/订单模型的信息.这是一个接口,所以我无法访问会话数据,我从数据库获得验证的订单.
magento ×10
php ×3
block ×1
categories ×1
discount ×1
e-commerce ×1
orders ×1
parsing ×1
prototypejs ×1