背景:
我的网站是magento开源电子商务解决方案,在顶部(标题)它有一个购物车图标.在dekstop上,当用户将鼠标悬停在该图标上时,它会显示购物车中的内容(项目).但是点击该图标,用户可以访问购物车页面.
我想要:
我希望只有触摸设备才有能力,当用户单击图标时,它应该只显示内容,但是当双击图标时,它应该将它们带到购物车页面.
HTML代码:
<div id="mini-cart" class="dropdown is-not-empty">
<!-- This below div is always visible and on tap of this or either of it's any elements, required behaviour is expected -->
<div class="dropdown-toggle cover" title="View Bag">
<div class="feature-icon-hover">
<a href="example.com/checkout/cart/" title="Shopping Bag">
<span class="first close-to-text icon i-cart-wb force-no-bg-color"> </span>
<div class="hide-below-960">My Bag</div>
</a>
<div class="label amount">
<a href="example.com/checkout/cart/" title="Shopping Bag">(1)</a>
</div>
<a class="summary" href="example.com/checkout/cart/" title="Shopping Bag">
<span class="subtotal">
<span class="price">$28</span>
</span>
</a>
<span class="caret"> </span>
</div> <!-- end: dropdown-toggle > div …Run Code Online (Sandbox Code Playgroud) 我在单页上有三个旋转木马滑块,我希望它们同时移动其中两个.我们都应该同时更改滑块图像.两者都有相同数量的图像/幻灯片.这是我正在使用的代码:
jQuery('#carousel-example-generic1, #carousel-example-generic2').carousel({
interval: 4000
});
Run Code Online (Sandbox Code Playgroud)
我也试过以下代码:
jQuery('.carousel').carousel({
pause:'false'
});
jQuery('#carousel-example-generic1').on('slide', function(){
jQuery('#carousel-example-generic2').carousel('next');
});
Run Code Online (Sandbox Code Playgroud)
但左右滑块在更换幻灯片时几乎没有延迟.这种延迟继续增加.这类问题有哪些已知问题?链接到该网站是这样的.
JSFiddle:链接
jquery carousel css-transitions twitter-bootstrap twitter-bootstrap-3
我使用以下代码登录并重定向到帐户页面:
<?php
include('store/app/Mage.php');
Mage::app();
if($_POST && $_POST['login']['username'] && $_POST['login']['password']){
$email = $_POST['login']['username'];
$password = $_POST['login']['password'];
$session = Mage::getSingleton('customer/session');
try {
$log = $session->login($email, $password);
$session->setCustomerAsLoggedIn($session->getCustomer());
$customer_id = $session->getCustomerId();
$send_data["success"] = true;
$send_data["message"] = "Login Success";
$send_data["customer_id"] = $customer_id;
Mage::getSingleton('customer/session')->loginById($customer_id);
Mage_Core_Model_Session_Abstract_Varien::start();
}catch (Exception $ex) {
$send_data["success"] = false;
$send_data["message"] = $ex->getMessage();
}
}else {
$send_data["success"]=false;
$send_data["message"]="Enter both Email and Password";
}
echo json_encode($send_data);
?>
Run Code Online (Sandbox Code Playgroud)
然后在我发出ajax请求的文件中,我正在使用此代码:
if(data.success){
window.location = "http://domain.com/store/customer/account/"
}
Run Code Online (Sandbox Code Playgroud)
但它始终显示用户注销,但我确实获得了正确的客户ID以及成功.
如何获得两个日期之间的所有产品,如上个月的产品,本月产品,上周产品和本周产品等
我试过这个:
// current day to start with
$start = mktime(0,0,0,date('m'), date('d'), date('Y'));;
// calculate the first day of last month
$first = date('YYYY-MM-DD',mktime(0,0,0,date('m',$start) - 1,1,date('Y',$start)));
// calculate the last day of last month
$last = date('YYYY-MM-DD',mktime(0, 0, 0, date('m') -1 + 1, 0, date('Y',$start)));
if($filter == "lastmonth"){
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToFilter('updated_at', array('gteq' =>$first));
$collection->addAttributeToFilter('updated_at', array('lteq' => $last));
}
Run Code Online (Sandbox Code Playgroud)
但我无法得到结果:(任何帮助?
丹尼尔回应后修改了!
我创建了一个名为" by_item " 的自定义下拉属性,并添加了一些选项,如"套房,新娘,牛仔裤"等.
<?php // get all products
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');
//filter codition
$collection->addFieldToFilter(array(
array('attribute'=>'by_item','eq'=>"Suite"),
));
foreach ($collection as $product) {
var_dump($product->getData());
}
?>
Run Code Online (Sandbox Code Playgroud)
它什么都没有:(
但是当我这样做时:
<?php
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');
//filter codition
//$collection->addFieldToFilter(array(
// array('attribute'=>'by_item','eq'=>"Suite"),
// ));
foreach ($collection as $product) {
echo $product->getName() . "<br />";
}
?>
Run Code Online (Sandbox Code Playgroud)
它给了我所有产品的名称.我访问了很多文章,但没有遇到任何问题:(
我正在尝试获取所有启用和禁用的产品,我正在使用此代码:
/*$categoryId = 3; // a category id that you can get from admin
$category = Mage::getModel('catalog/category')->load($categoryId);
$collection = Mage::getModel('catalog/product')
->getCollection()
->addCategoryFilter($category)
->addAttributeToSelect('*')
->addAttributeToFilter('status', array('gt' => 0))
->load();
$categoryId = 3; // a category id that you can get from admin
$category = Mage::getModel('catalog/category')->load($categoryId);*/
Run Code Online (Sandbox Code Playgroud)
以上代码仅提供启用的产品.
通过评论状态过滤器,它仍然会带来相同的结果,即仅启用产品.
/*$collection = Mage::getModel('catalog/product')
->getCollection()
->addCategoryFilter($category)
->addAttributeToSelect('*')
//->addAttributeToFilter('status', array('gt' => 0))
->load();*/
Run Code Online (Sandbox Code Playgroud)
它仍然只带来Enabled产品.但当我评论类别检查比它带来n所有产品 :(任何人都可以帮助PLZ?
注意:
对于那些不清楚这个查询的人,让我告诉你Status Enabled = 1和Status Disabled = 2.
所以大于零的状态应该给我带来启用和禁用的产品,但它没有这样做.所以任何想法???
我编辑代码和它
$collection = Mage::getModel('catalog/category')->load(3)
->getProductCollection()
->addAttributeToSelect('*')
->addAttributeToSort('entity_id', …Run Code Online (Sandbox Code Playgroud) 每当我尝试从表“调查”中删除调查时,如下所示:
DELETE FROM surveys WHERE survey_id = 77
它提示我一个错误,如下所示:
#1451 - 无法删除或更新父行:外键约束失败('user_surveys_archive',CONSTRAINT 'user_surveys_archive_ibfk_6' FOREIGN KEY ('user_access_level_id') REFERENCES 'user_surveys' ('user_access_level_id') ON DELETE NO ACTION)
第一件事:我没有任何名为“user_surveys_archive_ibfk_6”的此类表
第二件事:其他表中没有此调查的记录。
知道如何删除此记录来解决此问题吗?
编辑
这是我导出表调查的约束时发现的行
ALTER TABLE `surveys`
ADD CONSTRAINT `surveys_ibfk_1` FOREIGN KEY (`survey_type_id`) REFERENCES `survey_types` (`survey_type_id`) ON DELETE CASCADE ON UPDATE NO ACTION;`
Run Code Online (Sandbox Code Playgroud) 这些是我遵循的步骤:
输出:
数据上传成功的产品
但
没有找到相关图像,而我可以看到上传到媒体/目录/产品.....文件夹中的图像
我访问过很多博客论坛,花了不少时间,但徒劳无功.所以最后我发布在这里.
如果有人可以使用示例Csv文件在整个过程中发布并且还告诉我们字段ib brief的必填字段和值,我将不胜感激.
而导出的产品csv文件从后端Magento管理面板,它会提示我下面的错误,当我点击继续生成CSV文件.
"无效的实体模型"
我使用的是magento 1.6.2 CE.
**编辑**
我使用magento默认导出/导入服务意味着从管理系统 - >配置 - >导出/导入.....
如果还不清楚,请问我任何问题.
magento ×7
jquery ×2
magento-1.4 ×2
magento-1.5 ×2
magento-1.6 ×2
carousel ×1
javascript ×1
mysql ×1
prototypejs ×1
sql ×1