1. clean function in controller :
//clecn all products in compare list public function cleanajaxAction() { $items = Mage::getResourceModel('catalog/product_compare_item_collection'); if (Mage::getSingleton('customer/session')->isLoggedIn()) { $items->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId()); } elseif ($this->_customerId) { $items->setCustomerId($this->_customerId); } else { $items->setVisitorId(Mage::getSingleton('log/visitor')->getId()); } /** @var $session Mage_Catalog_Model_Session */ $session = Mage::getSingleton('catalog/session'); try { $items->clear(); Mage::helper('catalog/product_compare')->calculate(); echo json_encode(array('status'=>'1','msg'=>'clean compare products successed!')); return; } catch (Exception $e){ //do nothing echo json_encode(array('status'=>'2','msg'=>$this->__($e->getMessage()))); return; } }
2. jquery call it by ajax
//clean all ajax (function($){ $('#clean-link').click(function(){ var ajax_url = $(this).attr('to_url'); $.ajax({ url: ajax_url, type: "POST", dataType:"json", success: function(json_obj) { if(json_obj.status == 1) { $(".compare-a").removeClass("compared"); $(".clean-compare-box").hide(); } else { alert(json_obj.msg); } } }); }) })(jQuery);
3. html node:
<div class="clean-compare-box"> <a to_url="<?php echo $this->getUrl('catalog/product_compare/cleanajax');?>" id="clean-link" class="clean-compare-link" style="color: #000000; cursor:pointer;"><?php echo $this->__('clear all');?></a> </div>
相关推荐
Ajax-magento2-catalog-infinite-scroll.zip,免费的Magento 2扩展,为目录添加无限滚动功能(通过AJAX实现)编码教程,ajax代表异步javascript和xml。它是多种web技术的集合,包括html、css、json、xml和javascript。...
Ajax-magento2-ajax-layered-navigation.zip,ajax分层导航magento 2提供了一个过滤器列表,帮助您的客户以最短的方式搜索和获得他们最喜欢的产品。这个扩展应用了现代ajax技术来增强过滤系统,以提高用户对页面上每...
Ajax-magento2-module-ajax.zip,用于ajax请求的magento 2模块,ajax代表异步javascript和xml。它是多种web技术的集合,包括html、css、json、xml和javascript。它用于创建动态网页,其中网页的小部分在不重新加载网页...
magento ajax购物车,更多插件请留意wangdz.cn
Ajax-magento2-ajax-cart-quick.zip,magento 2 ajax购物车扩展插件提供舒适的购物体验。客户可以很容易地选择可配置的选项并在弹出窗口中编辑项目,而不会浪费重新加载页面的时间。,ajax代表异步javascript和xml。它...
magento ajax 根据产品名称,产品描述进行搜索
Ajax-magento2-ajax-cart.zip,ajax add to cart for extension magento 2提供了通过ajax弹出窗口将产品添加到购物车的主要功能。它通过允许客户从产品列表页面将任何产品类型添加到购物车,显著改善了用户体验。,...
Ajax-Magento-ajax-add-to-cart.zip,[模块magento 1]magento ajax添加到购物车-ajoter vos produits au panier en ajax/感谢ajax将您的产品添加到购物车,ajax代表异步javascript和xml。它是多种web技术的集合,包括...
修改你的list.phtml图片部分或者使用czettner_ajax/list.phtml(已经配置,见czettner_ajax.xml) 隐藏 CSS 中的按钮(感谢 lawrencetaur): .product-image .ajax{ display:none;} .product-image .ajax:hover{ ...
Magetop的Magento 2 Ajax购物车扩展Magetop开发的Magento 2 Ajax购物车扩展程序具有通过AJAX弹出窗口向购物车添加产品的主要功能。 通过允许客户直接从产品列表页面将任何产品类型添加到购物车,它可以显着改善用户...
As a Magento specialist he has achieved all the Magento certifications. He is an active member of the community and has been recognized as a Magento Master for 2017. He is the Chief Operating Officer...
演示地址:http://olegnax.com/product/athlete-responsive-magento-theme/livepreview/ Athlete Magento主题,兼容Magento 1.9.x, 1.8.x, 1.7.x ,特点:完全自适应(响应式布局),自定义子主题,无限颜色,完全...
NULL 博文链接:https://justcoding.iteye.com/blog/2100394
magento2-ajax分层导航:Ajax分层导航Magento 2带来了一系列过滤器,可帮助您的客户以最短的方式搜索并获得他们最喜欢的产品。 此扩展应用了现代AJAX技术来增强过滤系统,以提高客户对页面上所有过滤操作的满意度
Chapter 3, Enabling Performance in Magento 2, explains how to configure different types of caching options. In Magento 2, the Full Page Cache (FPC) can be handled by Varnish to give your store a ...
magento数据结构分析 magento数据字典
magento 购物车预览cartview
magik shoes magento 模板, magento 1.7 模板
magento2-example-cataloglist cd bin ./magento session:catalog:list --attributes "type_id,name,sku,price" --inventory_fields "qty,use_config_backorders" website --type "configurable" --type "simple" -...
magento的SMTP插件magento的SMTP插件magento的SMTP插件