Version Notes
Support for Magento 1.9
Download this release
Release Info
| Developer | Hardik Gajjar |
| Extension | HardikAjaxCart |
| Version | 2.1.0 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.1 to 2.1.0
app/code/local/Hardik/Ajaxcart/etc/config.xml
CHANGED
|
@@ -118,7 +118,7 @@
|
|
| 118 |
<ajaxcart>
|
| 119 |
<general>
|
| 120 |
<enable>1</enable>
|
| 121 |
-
<update_blocks>a:2:{s:2:"id";a:
|
| 122 |
</general>
|
| 123 |
</ajaxcart>
|
| 124 |
</default>
|
| 118 |
<ajaxcart>
|
| 119 |
<general>
|
| 120 |
<enable>1</enable>
|
| 121 |
+
<update_blocks>a:2:{s:2:"id";a:4:{i:0;s:17:".block.block-cart";i:1;s:14:".header .links";i:2;s:26:".checkout-cart-index .cart";i:3;s:16:".header-minicart";}s:3:"xml";a:4:{i:0;s:12:"cart_sidebar";i:1;s:9:"top.links";i:2;s:13:"checkout.cart";i:3;s:13:"minicart_head";}}</update_blocks>
|
| 122 |
</general>
|
| 123 |
</ajaxcart>
|
| 124 |
</default>
|
app/design/frontend/rwd/default/layout/ajaxcart.xml
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
<default>
|
| 4 |
+
<reference name="head">
|
| 5 |
+
<!--ajaxcart assets start-->
|
| 6 |
+
<action method="addItem">
|
| 7 |
+
<type>skin_js</type>
|
| 8 |
+
<name>ajaxcart/growler.js</name>
|
| 9 |
+
</action>
|
| 10 |
+
<action method="addCss">
|
| 11 |
+
<stylesheet>ajaxcart/growler.css</stylesheet>
|
| 12 |
+
</action>
|
| 13 |
+
<action method="addCss">
|
| 14 |
+
<stylesheet>ajaxcart/modalbox.css</stylesheet>
|
| 15 |
+
</action>
|
| 16 |
+
<action method="addItem">
|
| 17 |
+
<type>skin_js</type>
|
| 18 |
+
<name>ajaxcart/modalbox.js</name>
|
| 19 |
+
</action>
|
| 20 |
+
<action method="addItem">
|
| 21 |
+
<type>skin_js</type>
|
| 22 |
+
<name>ajaxcart/ajaxcart.js</name>
|
| 23 |
+
</action>
|
| 24 |
+
<!--ajaxcart assets end-->
|
| 25 |
+
|
| 26 |
+
<!-- product type assets start -->
|
| 27 |
+
<action method="addJs">
|
| 28 |
+
<script>varien/product.js</script>
|
| 29 |
+
</action>
|
| 30 |
+
<action method="addJs">
|
| 31 |
+
<script>varien/configurable.js</script>
|
| 32 |
+
</action>
|
| 33 |
+
<action method="addItem">
|
| 34 |
+
<type>skin_js</type>
|
| 35 |
+
<name>js/bundle.js</name>
|
| 36 |
+
</action>
|
| 37 |
+
|
| 38 |
+
<action method="addItem">
|
| 39 |
+
<type>js_css</type>
|
| 40 |
+
<name>calendar/calendar-win2k-1.css</name>
|
| 41 |
+
<params/>
|
| 42 |
+
<!--<if/><condition>can_load_calendar_js</condition>-->
|
| 43 |
+
</action>
|
| 44 |
+
<action method="addItem">
|
| 45 |
+
<type>js</type>
|
| 46 |
+
<name>calendar/calendar.js</name>
|
| 47 |
+
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
| 48 |
+
</action>
|
| 49 |
+
<action method="addItem">
|
| 50 |
+
<type>js</type>
|
| 51 |
+
<name>calendar/calendar-setup.js</name>
|
| 52 |
+
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
| 53 |
+
</action>
|
| 54 |
+
<!-- product type assets end -->
|
| 55 |
+
</reference>
|
| 56 |
+
</default>
|
| 57 |
+
<ajaxcart>
|
| 58 |
+
<reference name="content">
|
| 59 |
+
<block type="checkout/cart" name="checkout.cart">
|
| 60 |
+
<action method="setCartTemplate">
|
| 61 |
+
<value>checkout/cart.phtml</value>
|
| 62 |
+
</action>
|
| 63 |
+
<action method="setEmptyTemplate">
|
| 64 |
+
<value>checkout/cart/noItems.phtml</value>
|
| 65 |
+
</action>
|
| 66 |
+
<action method="chooseTemplate"/>
|
| 67 |
+
<action method="addItemRender">
|
| 68 |
+
<type>simple</type>
|
| 69 |
+
<block>checkout/cart_item_renderer</block>
|
| 70 |
+
<template>checkout/cart/item/default.phtml</template>
|
| 71 |
+
</action>
|
| 72 |
+
<action method="addItemRender">
|
| 73 |
+
<type>grouped</type>
|
| 74 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
| 75 |
+
<template>checkout/cart/item/default.phtml</template>
|
| 76 |
+
</action>
|
| 77 |
+
<action method="addItemRender">
|
| 78 |
+
<type>configurable</type>
|
| 79 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
| 80 |
+
<template>checkout/cart/item/default.phtml</template>
|
| 81 |
+
</action>
|
| 82 |
+
|
| 83 |
+
<block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label">
|
| 84 |
+
<label>Payment Methods Before Checkout Button</label>
|
| 85 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage"
|
| 86 |
+
template="checkout/onepage/link.phtml"/>
|
| 87 |
+
</block>
|
| 88 |
+
|
| 89 |
+
<block type="page/html_wrapper" name="checkout.cart.form.before" as="form_before" translate="label">
|
| 90 |
+
<label>Shopping Cart Form Before</label>
|
| 91 |
+
</block>
|
| 92 |
+
|
| 93 |
+
<block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
|
| 94 |
+
<label>Payment Methods After Checkout Button</label>
|
| 95 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage"
|
| 96 |
+
template="checkout/onepage/link.phtml"/>
|
| 97 |
+
<block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping"
|
| 98 |
+
template="checkout/multishipping/link.phtml"/>
|
| 99 |
+
</block>
|
| 100 |
+
|
| 101 |
+
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon"
|
| 102 |
+
template="checkout/cart/coupon.phtml"/>
|
| 103 |
+
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping"
|
| 104 |
+
template="checkout/cart/shipping.phtml"/>
|
| 105 |
+
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell"
|
| 106 |
+
template="checkout/cart/crosssell.phtml"/>
|
| 107 |
+
|
| 108 |
+
<block type="checkout/cart_totals" name="checkout.cart.totals" as="totals"
|
| 109 |
+
template="checkout/cart/totals.phtml"/>
|
| 110 |
+
</block>
|
| 111 |
+
</reference>
|
| 112 |
+
</ajaxcart>
|
| 113 |
+
<ajaxcart_configurable_options>
|
| 114 |
+
<reference name="content">
|
| 115 |
+
<block type="catalog/product_view" name="ajaxcart.configurable.options"
|
| 116 |
+
template="ajaxcart/configurable_options.phtml" as="ajaxcart.configurable.options">
|
| 117 |
+
<block type="core/template_facade" name="product.info.container1" as="container1">
|
| 118 |
+
<action method="setDataByKey">
|
| 119 |
+
<key>alias_in_layout</key>
|
| 120 |
+
<value>container1</value>
|
| 121 |
+
</action>
|
| 122 |
+
<action method="setDataByKeyFromRegistry">
|
| 123 |
+
<key>options_container</key>
|
| 124 |
+
<key_in_registry>product</key_in_registry>
|
| 125 |
+
</action>
|
| 126 |
+
<action method="append">
|
| 127 |
+
<block>product.info.options.wrapper</block>
|
| 128 |
+
</action>
|
| 129 |
+
<action method="append">
|
| 130 |
+
<block>product.info.options.wrapper.bottom</block>
|
| 131 |
+
</action>
|
| 132 |
+
</block>
|
| 133 |
+
</block>
|
| 134 |
+
</reference>
|
| 135 |
+
</ajaxcart_configurable_options>
|
| 136 |
+
<ajaxcart_bundle_options>
|
| 137 |
+
<reference name="content">
|
| 138 |
+
<block type="bundle/catalog_product_view_type_bundle" name="product.info.bundle" as="product_type_data" template="bundle/catalog/product/view/type/bundle.phtml">
|
| 139 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
| 140 |
+
<block type="bundle/catalog_product_price" name="bundle.prices" as="bundle_prices" template="bundle/catalog/product/view/price.phtml">
|
| 141 |
+
<action method="setMAPTemplate"><tmpl>catalog/product/price_msrp_item.phtml</tmpl></action>
|
| 142 |
+
</block>
|
| 143 |
+
</block>
|
| 144 |
+
</reference>
|
| 145 |
+
</ajaxcart_bundle_options>
|
| 146 |
+
<ajaxcart_grouped_options translate="label" module="catalog">
|
| 147 |
+
<reference name="content">
|
| 148 |
+
<block type="catalog/product_view" name="ajaxcart.grouped.options"
|
| 149 |
+
template="ajaxcart/grouped_options.phtml" as="ajaxcart.grouped.options">
|
| 150 |
+
<block type="catalog/product_view_type_grouped" name="grouped.options"
|
| 151 |
+
as="grouped.options" template="catalog/product/view/type/grouped.phtml">
|
| 152 |
+
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"
|
| 153 |
+
translate="label">
|
| 154 |
+
<label>Product Extra Info</label>
|
| 155 |
+
</block>
|
| 156 |
+
</block>
|
| 157 |
+
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
|
| 158 |
+
</block>
|
| 159 |
+
</reference>
|
| 160 |
+
</ajaxcart_grouped_options>
|
| 161 |
+
|
| 162 |
+
<!-- for magento 1.9 -->
|
| 163 |
+
<catalog_category_default translate="label">
|
| 164 |
+
<!-- Mage_Catalog -->
|
| 165 |
+
<reference name="product_list">
|
| 166 |
+
<action method="setTemplate"><template>ajaxcart/catalog/product/list.phtml</template></action>
|
| 167 |
+
</reference>
|
| 168 |
+
</catalog_category_default>
|
| 169 |
+
<catalog_category_layered translate="label">
|
| 170 |
+
<!-- Mage_Catalog -->
|
| 171 |
+
<reference name="product_list">
|
| 172 |
+
<action method="setTemplate"><template>ajaxcart/catalog/product/list.phtml</template></action>
|
| 173 |
+
</reference>
|
| 174 |
+
</catalog_category_layered>
|
| 175 |
+
|
| 176 |
+
</layout>
|
app/design/frontend/rwd/default/template/ajaxcart/catalog/product/list.phtml
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* DISCLAIMER
|
| 16 |
+
*
|
| 17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
+
* versions in the future. If you wish to customize Magento for your
|
| 19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
| 20 |
+
*
|
| 21 |
+
* @category design
|
| 22 |
+
* @package rwd_default
|
| 23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
| 24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
?>
|
| 27 |
+
<?php
|
| 28 |
+
/**
|
| 29 |
+
* Product list template
|
| 30 |
+
*
|
| 31 |
+
* @see Mage_Catalog_Block_Product_List
|
| 32 |
+
*/
|
| 33 |
+
/* @var $this Mage_Catalog_Block_Product_List */
|
| 34 |
+
?>
|
| 35 |
+
<?php
|
| 36 |
+
$_productCollection=$this->getLoadedProductCollection();
|
| 37 |
+
$_helper = $this->helper('catalog/output');
|
| 38 |
+
?>
|
| 39 |
+
<?php if(!$_productCollection->count()): ?>
|
| 40 |
+
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
|
| 41 |
+
<?php else: ?>
|
| 42 |
+
<div class="category-products">
|
| 43 |
+
<?php echo $this->getToolbarHtml() ?>
|
| 44 |
+
<?php // List mode ?>
|
| 45 |
+
<?php if($this->getMode()!='grid'): ?>
|
| 46 |
+
<?php $_iterator = 0; ?>
|
| 47 |
+
<ol class="products-list" id="products-list">
|
| 48 |
+
<?php foreach ($_productCollection as $_product): ?>
|
| 49 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
| 50 |
+
<?php // Product Image ?>
|
| 51 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
| 52 |
+
<?php /* Based on the native RWD styling, product images are displayed at a max of ~400px wide when viewed on a
|
| 53 |
+
one column page layout with four product columns from a 1280px viewport. For bandwidth reasons,
|
| 54 |
+
we are going to serve a 300px image, as it will look fine at 400px and most of the times, the image
|
| 55 |
+
will be displayed at a smaller size (eg, if two column are being used or viewport is smaller than 1280px).
|
| 56 |
+
This $_imgSize value could even be decreased further, based on the page layout
|
| 57 |
+
(one column, two column, three column) and number of product columns. */ ?>
|
| 58 |
+
<?php $_imgSize = 300; ?>
|
| 59 |
+
<img id="product-collection-image-<?php echo $_product->getId(); ?>"
|
| 60 |
+
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
|
| 61 |
+
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
|
| 62 |
+
</a>
|
| 63 |
+
<?php // Product description ?>
|
| 64 |
+
<div class="product-shop">
|
| 65 |
+
<div class="f-fix">
|
| 66 |
+
<div class="product-primary">
|
| 67 |
+
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
| 68 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
| 69 |
+
<?php if($_product->getRatingSummary()): ?>
|
| 70 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
| 71 |
+
<?php endif; ?>
|
| 72 |
+
|
| 73 |
+
<?php
|
| 74 |
+
$_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
|
| 75 |
+
foreach($_nameAfterChildren as $_nameAfterChildName):
|
| 76 |
+
$_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
|
| 77 |
+
$_nameAfterChild->setProduct($_product);
|
| 78 |
+
?>
|
| 79 |
+
<?php echo $_nameAfterChild->toHtml(); ?>
|
| 80 |
+
<?php endforeach; ?>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="product-secondary">
|
| 83 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
| 84 |
+
</div>
|
| 85 |
+
<div class="product-secondary">
|
| 86 |
+
<?php if($_product->isSaleable() /*&& !$_product->canConfigure()*/): ?>
|
| 87 |
+
<p class="action"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>?options=cart')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
| 88 |
+
<?php /*elseif($_product->isSaleable()): ?>
|
| 89 |
+
<p class="action"><a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
|
| 90 |
+
<?php */else: ?>
|
| 91 |
+
<p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
| 92 |
+
<?php endif; ?>
|
| 93 |
+
<ul class="add-to-links">
|
| 94 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
| 95 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
| 96 |
+
<?php endif; ?>
|
| 97 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
| 98 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
| 99 |
+
<?php endif; ?>
|
| 100 |
+
</ul>
|
| 101 |
+
</div>
|
| 102 |
+
<div class="desc std">
|
| 103 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
| 104 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</li>
|
| 109 |
+
<?php endforeach; ?>
|
| 110 |
+
</ol>
|
| 111 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
| 112 |
+
|
| 113 |
+
<?php else: ?>
|
| 114 |
+
|
| 115 |
+
<?php // Grid Mode ?>
|
| 116 |
+
|
| 117 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
| 118 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
| 119 |
+
<ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
|
| 120 |
+
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
| 121 |
+
<?php /*if ($i++%$_columnCount==0): ?>
|
| 122 |
+
<?php endif*/ ?>
|
| 123 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
| 124 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
|
| 125 |
+
<?php $_imgSize = 210; ?>
|
| 126 |
+
<img id="product-collection-image-<?php echo $_product->getId(); ?>"
|
| 127 |
+
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
|
| 128 |
+
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
|
| 129 |
+
</a>
|
| 130 |
+
<div class="product-info">
|
| 131 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
| 132 |
+
|
| 133 |
+
<?php
|
| 134 |
+
$_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
|
| 135 |
+
foreach($_nameAfterChildren as $_nameAfterChildName):
|
| 136 |
+
$_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
|
| 137 |
+
$_nameAfterChild->setProduct($_product);
|
| 138 |
+
?>
|
| 139 |
+
<?php echo $_nameAfterChild->toHtml(); ?>
|
| 140 |
+
<?php endforeach; ?>
|
| 141 |
+
|
| 142 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
| 143 |
+
<?php if($_product->getRatingSummary()): ?>
|
| 144 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
| 145 |
+
<?php endif; ?>
|
| 146 |
+
<div class="actions">
|
| 147 |
+
<?php if($_product->isSaleable() /*&& !$_product->canConfigure()*/): ?>
|
| 148 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>?options=cart')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
| 149 |
+
<?php /*elseif($_product->isSaleable()): ?>
|
| 150 |
+
<a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
|
| 151 |
+
<?php */else: ?>
|
| 152 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
| 153 |
+
<?php endif; ?>
|
| 154 |
+
<ul class="add-to-links">
|
| 155 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
| 156 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
| 157 |
+
<?php endif; ?>
|
| 158 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
| 159 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
| 160 |
+
<?php endif; ?>
|
| 161 |
+
</ul>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
</li>
|
| 165 |
+
<?php /*if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
| 166 |
+
<?php endif*/ ?>
|
| 167 |
+
<?php endforeach ?>
|
| 168 |
+
</ul>
|
| 169 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
| 170 |
+
<?php endif; ?>
|
| 171 |
+
|
| 172 |
+
<div class="toolbar-bottom">
|
| 173 |
+
<?php echo $this->getToolbarHtml() ?>
|
| 174 |
+
</div>
|
| 175 |
+
</div>
|
| 176 |
+
<?php endif; ?>
|
| 177 |
+
|
| 178 |
+
<?php
|
| 179 |
+
//set product collection on after blocks
|
| 180 |
+
$_afterChildren = $this->getChild('after')->getSortedChildren();
|
| 181 |
+
foreach($_afterChildren as $_afterChildName):
|
| 182 |
+
$_afterChild = $this->getChild('after')->getChild($_afterChildName);
|
| 183 |
+
$_afterChild->setProductCollection($_productCollection);
|
| 184 |
+
?>
|
| 185 |
+
<?php echo $_afterChild->toHtml(); ?>
|
| 186 |
+
<?php endforeach; ?>
|
package.xml
CHANGED
|
@@ -1,20 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>HardikAjaxCart</name>
|
| 4 |
-
<version>2.0
|
| 5 |
<stability>stable</stability>
|
| 6 |
-
<license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>provides ajax cart functionality. It is highly customizable.</summary>
|
| 10 |
<description>Now, it provides ajax add to cart functionality for configurable and group products too.</description>
|
| 11 |
-
<notes>
|
| 12 |
-

|
| 13 |
-
Also, fixed compare product stopped working issue.</notes>
|
| 14 |
<authors><author><name>Hardik Gajjar</name><user>hardik_krishinc</user><email>hardik.gajjar@krishinc.com</email></author></authors>
|
| 15 |
-
<date>
|
| 16 |
-
<time>
|
| 17 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Hardik_Ajaxcart.xml" hash="81451d4f81af3650b8151344bbc1e865"/></dir></target><target name="magelocal"><dir name="Hardik"><dir name="Ajaxcart"><dir name="Block"><dir name="Adminhtml"><file name="Info.php" hash="8fab3b7d0b1390dcc80a037c66b1ba7f"/><file name="Url.php" hash="ed7b1ff4b0f4ad33d45cfd301dba4227"/></dir></dir><dir name="Helper"><file name="Data.php" hash="773174c4f49cccc57be68acb1e0027e5"/></dir><dir name="Model"><file name="Observer.php" hash="13e2cb8fea9e79dc84593b1174d7ec5a"/><file name="Response.php" hash="b4508819058f7fd656a4e65fab9fe4c9"/></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="8e0e56d6627539bb6a342df80a80af9f"/></dir></dir><dir name="etc"><file name="config.xml" hash="
|
| 18 |
<compatible/>
|
| 19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 20 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>HardikAjaxCart</name>
|
| 4 |
+
<version>2.1.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
+
<license uri="http://creativecommons.org/licenses/by-nc/4.0/">Attribution-NonCommercial 4.0 International</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>provides ajax cart functionality. It is highly customizable.</summary>
|
| 10 |
<description>Now, it provides ajax add to cart functionality for configurable and group products too.</description>
|
| 11 |
+
<notes>Support for Magento 1.9</notes>
|
|
|
|
|
|
|
| 12 |
<authors><author><name>Hardik Gajjar</name><user>hardik_krishinc</user><email>hardik.gajjar@krishinc.com</email></author></authors>
|
| 13 |
+
<date>2014-07-31</date>
|
| 14 |
+
<time>06:48:23</time>
|
| 15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Hardik_Ajaxcart.xml" hash="81451d4f81af3650b8151344bbc1e865"/></dir></target><target name="magelocal"><dir name="Hardik"><dir name="Ajaxcart"><dir name="Block"><dir name="Adminhtml"><file name="Info.php" hash="8fab3b7d0b1390dcc80a037c66b1ba7f"/><file name="Url.php" hash="ed7b1ff4b0f4ad33d45cfd301dba4227"/></dir></dir><dir name="Helper"><file name="Data.php" hash="773174c4f49cccc57be68acb1e0027e5"/></dir><dir name="Model"><file name="Observer.php" hash="13e2cb8fea9e79dc84593b1174d7ec5a"/><file name="Response.php" hash="b4508819058f7fd656a4e65fab9fe4c9"/></dir><dir name="controllers"><dir name="Checkout"><file name="CartController.php" hash="8e0e56d6627539bb6a342df80a80af9f"/></dir></dir><dir name="etc"><file name="config.xml" hash="8722eb8a94bb093e231fb253633171ca"/><file name="system.xml" hash="70e92e5d3c03d7b462e72ba3a8eaca1f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ajaxcart.xml" hash="14885283aa1764dc7aba659ac16d73a3"/></dir><dir name="template"><dir name="ajaxcart"><file name="configurable_options.phtml" hash="c1d55b5cea9ba6fc2568251d99c3b789"/><file name="grouped_options.phtml" hash="7409b93efccff6dbabd5c4c8a19b0cda"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="ajaxcart.xml" hash="655561905b6d02a15c5dca6cba15992e"/></dir><dir name="template"><dir name="ajaxcart"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="b5673ebd5800779150b29517821e0b18"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="ajaxcart"><file name="ajaxcart.js" hash="781d0b4f81243ecf541840cb7329570c"/><file name="growler.css" hash="c13a01e28cb4eb98b1fbc4a419d906cf"/><file name="growler.js" hash="816d275972bbe9c048033643755fb194"/><file name="modalbox.css" hash="9dfad4d258cbfe5af951f1bc7f7f82c7"/><file name="modalbox.js" hash="7aa6bdceed4379c80f47788ae21f1464"/><file name="spinner.gif" hash="58625c045f515052999e13aed5059b07"/></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
skin/frontend/base/default/ajaxcart/ajaxcart.js
CHANGED
|
@@ -12,7 +12,7 @@ var ajaxcart = {
|
|
| 12 |
setLocation($(e).readAttribute('href'));
|
| 13 |
Event.stop(event);
|
| 14 |
});
|
| 15 |
-
});
|
| 16 |
},
|
| 17 |
ajaxCartSubmit: function (obj) {
|
| 18 |
var _this = this;
|
|
@@ -270,12 +270,13 @@ var ajaxcart = {
|
|
| 270 |
var dom_selector = block.key;
|
| 271 |
if($$(dom_selector)) {
|
| 272 |
$$(dom_selector).each(function(e){
|
| 273 |
-
$(e).
|
| 274 |
});
|
| 275 |
}
|
| 276 |
}
|
| 277 |
});
|
| 278 |
_this.bindEvents();
|
|
|
|
| 279 |
|
| 280 |
// show details tooltip
|
| 281 |
truncateOptions();
|
|
@@ -286,12 +287,65 @@ var ajaxcart = {
|
|
| 286 |
|
| 287 |
},
|
| 288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
showPopup: function(block) {
|
| 290 |
try {
|
| 291 |
var _this = this;
|
| 292 |
//$$('body')[0].insert({bottom: new Element('div', {id: 'modalboxOptions'}).update(block)});
|
| 293 |
var element = new Element('div', {
|
| 294 |
-
id: 'modalboxOptions'
|
|
|
|
| 295 |
}).update(block);
|
| 296 |
|
| 297 |
var viewport = document.viewport.getDimensions();
|
| 12 |
setLocation($(e).readAttribute('href'));
|
| 13 |
Event.stop(event);
|
| 14 |
});
|
| 15 |
+
});
|
| 16 |
},
|
| 17 |
ajaxCartSubmit: function (obj) {
|
| 18 |
var _this = this;
|
| 270 |
var dom_selector = block.key;
|
| 271 |
if($$(dom_selector)) {
|
| 272 |
$$(dom_selector).each(function(e){
|
| 273 |
+
$(e).update(block.value);
|
| 274 |
});
|
| 275 |
}
|
| 276 |
}
|
| 277 |
});
|
| 278 |
_this.bindEvents();
|
| 279 |
+
_this.bindNewEvents();
|
| 280 |
|
| 281 |
// show details tooltip
|
| 282 |
truncateOptions();
|
| 287 |
|
| 288 |
},
|
| 289 |
|
| 290 |
+
bindNewEvents: function() {
|
| 291 |
+
// =============================================
|
| 292 |
+
// Skip Links (for Magento 1.9)
|
| 293 |
+
// =============================================
|
| 294 |
+
|
| 295 |
+
// Avoid PrototypeJS conflicts, assign jQuery to $j instead of $
|
| 296 |
+
if (typeof(jQuery) != undefined) {
|
| 297 |
+
|
| 298 |
+
var $j = jQuery.noConflict();
|
| 299 |
+
var skipContents = $j('.skip-content');
|
| 300 |
+
var skipLinks = $j('.skip-link');
|
| 301 |
+
|
| 302 |
+
if (typeof(skipContents) != undefined && typeof(skipLinks) != undefined) {
|
| 303 |
+
|
| 304 |
+
skipLinks.on('click', function (e) {
|
| 305 |
+
e.preventDefault();
|
| 306 |
+
|
| 307 |
+
var self = $j(this);
|
| 308 |
+
var target = self.attr('href');
|
| 309 |
+
|
| 310 |
+
// Get target element
|
| 311 |
+
var elem = $j(target);
|
| 312 |
+
|
| 313 |
+
// Check if stub is open
|
| 314 |
+
var isSkipContentOpen = elem.hasClass('skip-active') ? 1 : 0;
|
| 315 |
+
|
| 316 |
+
// Hide all stubs
|
| 317 |
+
skipLinks.removeClass('skip-active');
|
| 318 |
+
skipContents.removeClass('skip-active');
|
| 319 |
+
|
| 320 |
+
// Toggle stubs
|
| 321 |
+
if (isSkipContentOpen) {
|
| 322 |
+
self.removeClass('skip-active');
|
| 323 |
+
} else {
|
| 324 |
+
self.addClass('skip-active');
|
| 325 |
+
elem.addClass('skip-active');
|
| 326 |
+
}
|
| 327 |
+
});
|
| 328 |
+
|
| 329 |
+
$j('#header-cart').on('click', '.skip-link-close', function(e) {
|
| 330 |
+
var parent = $j(this).parents('.skip-content');
|
| 331 |
+
var link = parent.siblings('.skip-link');
|
| 332 |
+
|
| 333 |
+
parent.removeClass('skip-active');
|
| 334 |
+
link.removeClass('skip-active');
|
| 335 |
+
|
| 336 |
+
e.preventDefault();
|
| 337 |
+
});
|
| 338 |
+
}
|
| 339 |
+
}
|
| 340 |
+
},
|
| 341 |
+
|
| 342 |
showPopup: function(block) {
|
| 343 |
try {
|
| 344 |
var _this = this;
|
| 345 |
//$$('body')[0].insert({bottom: new Element('div', {id: 'modalboxOptions'}).update(block)});
|
| 346 |
var element = new Element('div', {
|
| 347 |
+
id: 'modalboxOptions',
|
| 348 |
+
class: 'product-view'
|
| 349 |
}).update(block);
|
| 350 |
|
| 351 |
var viewport = document.viewport.getDimensions();
|
