我怎么得到客户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) 我正在关注此帖子更改Magento版本1.7/1.12中的仪表板图表,以允许销售"处理"订单显示在仪表板图表上.我的文件位于正确的目录下方,并且在config> advanced中显示为活动状态.我还重新编制了索引,刷新了缓存,并刷新了生命周期统计信息.我发现日志中没有错误.你能看出什么问题吗?我有firegento并已启用日志记录,但这也不起作用.
编辑:仪表板上的收入总计似乎是正确的,但它没有反映在时间线图上.例如,上午10点可能有30美元的净30项订单,但它没有显示在时间图上.赏金给谁能修复下面的脚本以反映我的时间表!
CaitlinHavener /仪表板的/ etc/config.xml文件:
<?xml version="1.0"?>
<config>
<modules>
<CaitlinHavener_Dashboard>
<version>1.0</version>
</CaitlinHavener_Dashboard>
</modules>
<global>
<models>
<CaitlinHavener_Dashboard>
<class>CaitlinHavener_Dashboard_Model</class>
</CaitlinHavener_Dashboard>
<reports_resource>
<rewrite>
<order_collection>CaitlinHavener_Dashboard_Model_Reports_Resource_Order_Collection</order_collection>
</rewrite>
</reports_resource>
</models>
</global>
</config>
Run Code Online (Sandbox Code Playgroud)
CaitlinHavener /仪表板/型号/报告/资源/订单/ Collection.php
<?php
/**
* Show all orders, not only the invoiced one
*/
class CaitlinHavener_Dashboard_Model_Reports_Resource_Order_Collection extends Mage_Reports_Model_Resource_Order_Collection
{
protected function _prepareSummaryLive($range, $customStart, $customEnd, $isFilter = 0)
{
$this->setMainTable('sales/order');
$adapter = $this->getConnection();
/**
* Reset all columns, because result will group only by 'created_at' field
*/
$this->getSelect()->reset(Zend_Db_Select::COLUMNS);
/* $expression = …Run Code Online (Sandbox Code Playgroud) 我的工作在产品页面,而不是正常的可配置选项上,有一些配置选项,然后查询数据库,看是否特定厂商进行产品的项目.然后它通过javascript显示供应商列表,如下所示.

我希望添加到购物车块显示在每个供应商旁边.因为这都是动态创建的,所以我必须将供应商ID传递给我创建的"添加到购物车"脚本.我把原来的应用程序/设计/前端/基/默认/模板/目录/产品/浏览/ addtocart.phtml并提出我自己的,如下图所示.以下php文件是通过ajax调用的.最初的addtocart.phtml有一堆$ this变量.我需要模拟$ this(无论模型,它所指的帮助器),以便这个块工作.我没有太大的成功.有人可以看到我做错了什么或我能做些什么不同?非常感谢!
<?php
require_once('/var/www/Staging/public_html/app/Mage.php');
umask(0);
Mage::app();
//ensure that the value is legitimate
if($_POST && is_numeric($_POST['value'])){
$value = $_POST['value'];
}
//pass this in your ajax call for the add button
if($_POST && is_numeric($_POST['product_id'])){
$product_id = $_POST['product_id'];
}
$helper = Mage::helper('core'); //for translation
$block = new Mage_Catalog_Blockproduct_View(); // not best practice, but neither are standalones
$product = Mage::getModel('catalog/product')->load($product_id); // no need to use the _ here, it's not protected/private; additonally Mage::registry won't work because you're technically not on a …Run Code Online (Sandbox Code Playgroud) 我无法找到如何在创建网站时禁用默认窗口小部件。我的意思是,当我在Wordpress多站点网络中创建站点时,它不会自动创建侧栏小部件,例如“元”。
我看到两年多来没有更新过的插件可能对此有所帮助,但是我不想下载任何旧版本。
有谁知道如何做到这一点?
我是使用WSDL的新手.我之前使用过REST而不是这个.我正在尝试运行UPS开发人员站点上包含的示例代码文件.本指南的第23页是我正在使用的API.您可以下载的文件包括我已经阅读过的十个指南,但我最初想要弄清楚如何填写下面的顶部配置部分(我使用的是php示例代码文件SoapRateClient.php).我为WSDL做了什么?我为终点网址添加了什么?你在他们网站上下载的文件有几个wsdl文件,我不确定我应该选择哪一个.指导赞赏.
<?php
//Configuration
$access = "secret";//I have this no problem
$userid = "";//I have this as well
$passwd = "";//I have this
$wsdl = " Add Wsdl File Here ";//What the heck do I put here!?
$operation = "ProcessRate";
$endpointurl = ' Add URL Here';//Also what do I put here?
$outputFileName = "XOLTResult.xml";
Run Code Online (Sandbox Code Playgroud) 我完全按照本教程的步骤2进行了操作.实际上我将所有文件(可以下载的设计目录中的文件除外)放到我的app目录中.巧合的是,我也试图添加"学校"属性,所以到目前为止我还没有改变一件事.我在eav_attribute表中看到"school".该模块在系统>配置>高级>模块输出中列为已启用.我已经重新编制索引并刷新缓存,登录和注销.当我尝试编辑客户时,我仍然看不到"学校"属性.我使用vs 1.7.是否应在客户的"帐户信息"标签中找到此字段?这个教程有什么过时的吗?
这都是代码下载,但供参考(他错过了php标签的关闭,所以我也添加了这些):controllers/IndexController.php
<?php
class Excellence_Profile_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
?>
Run Code Online (Sandbox Code Playgroud)
等/ config.xml中
<?xml version="1.0"?>
<config>
<modules>
<Excellence_Profile>
<version>0.1.0</version>
</Excellence_Profile>
</modules>
<frontend>
<routers>
<profile>
<use>standard</use>
<args>
<module>Excellence_Profile</module>
<frontName>profile</frontName>
</args>
</profile>
</routers>
<layout>
<updates>
<profile>
<file>profile.xml</file>
</profile>
</updates>
</layout>
</frontend>
<admin>
<routers>
<profile>
<use>admin</use>
<args>
<module>Excellence_Profile</module>
<frontName>profile</frontName>
</args>
</profile>
</routers>
</admin>
<global>
<fieldsets>
<checkout_onepage_quote>
<customer_school>
<to_customer>school</to_customer>
</customer_school>
</checkout_onepage_quote>
<customer_account>
<school>
<to_quote>customer_school</to_quote>
</school>
</customer_account>
</fieldsets>
</global>
<global>
<fieldsets>
<customer_account>
<school><create>1</create><update>1</update><name>1</name></school>
</customer_account>
</fieldsets>
</global> …Run Code Online (Sandbox Code Playgroud) 我正在使用添加打印订单按钮打印客户的订单(而不是发票),我无法弄清楚如何将徽标显示在pdf上.以下是扩展中的代码,但我找不到操作它的功能,我不明白为什么它没有拉动我在配置中的徽标.请指教.:)
$this->insertLogo($page, $order->getStore());
Run Code Online (Sandbox Code Playgroud) 我需要将国家/地区代码从Javascript转换为其名称.我找到了一个国家代码的php数组,但我需要将一个javascript变量传递到php数组中以获取国家/地区代码.有什么方法可以做以下的事情吗?这当然是错误的.
function getCountry(code)
{
<?php echo $code=?> code;
return <?php echo $countries[$code] ?>
}
Run Code Online (Sandbox Code Playgroud)