我有这个查询只返回我在表上的一些条目.我有超过10个帖子但这个查询只返回6.请帮助提出建议
$query = new WP_Query("year=2011&monthnum=09&post_status=publish&post_type=post&orderby=post_date&order=DESC");
while ($query->have_posts()):
$query->the_post();
$title=get_the_Title();
echo"<p><input type=\"checkbox\" name=\"MyArticle[]\" value=\"".get_the_ID()."\">".get_the_Title()."</p>";
endwhile;
wp_reset_query();
Run Code Online (Sandbox Code Playgroud) 我使用从xsd schema生成的DataSource.我需要从DataSource获取所有字段,也是嵌套的字段.我的问题与Smartclient论坛论坛中的这个主题一样,当我使用DataSource.getFields()它只返回第一级字段时.
有谁知道如何获得嵌套字段?
我正在尝试使用观察者来修改添加到购物车控制器操作的响应,但仅限于AJAX请求的上下文中.
我的观察者被调用,我的JS正在检索数据,我通过die()在我的观察者函数中放置一个cartAdd()并验证响应开发者控制台来验证这一点,我用它来查看我对Magento的响应结果.所以JS不是问题所在.
我的主要问题是我似乎无法通过正常功能修改响应.我用得到请求$observer->getEvent()->getControllerAction()->getResponse(),然后进行更改setHeader(),或者setBody(),或者修改响应的其他功能,但绝对是响应没有影响!
有没有人知道为什么我无法修改观察者的反应?
在/app/code/local/mynamespace/mymodule/etc/config.xml中:
<frontend>
....
<events>
<controller_action_predispatch_checkout_cart_add>
<observers>
<mymodule_cart_add>
<type>singleton</type>
<class>mymodule/observer</class>
<method>cartAdd</method>
</mymodule_cart_add>
</observers>
</controller_action_predispatch_checkout_cart_add>
</events>
</frontend>
Run Code Online (Sandbox Code Playgroud)
在/app/code/local/mynamespace/mymodule/Model/Observer.php中:
public function cartAdd(Varien_Event_Observer $observer)
{
$controllerAction = $observer->getEvent()->getControllerAction();
if($controllerAction->getRequest()->isAjax()) {
$response = $controllerAction->getResponse();
// I've even tried using:
// $response = Mage::app()->getResponse();
$response->setHeader('HTTP/1.1','403 Forbidden'); //using this because i will need it in my final code and it will make it immediatly obvious the response has been changed
$response->setHeader('Content-type', …Run Code Online (Sandbox Code Playgroud) 我一直在找,但找不到这样的东西.我需要创建一个产品页面,买方会在将产品添加到购物车之前填写一些文本字段.
像这个页面的东西:http://bitly.com/Sw4jzR
添加到购物车时,还需要保存字段.
有人在magento看到过这样的事吗?知道怎么做吗?
提前致谢.