dc-ajax-shopping-cart-teaser.tpl.php in Commerce Ajax Add to Cart 7.2
Same filename and directory in other branches
Ajax shopping cart teaser block template file.
If you want to change the structure of Cart Teaser then copy this file to your theme's templates directory and make your changes. DO NOT change this file.
Available variables:
- $order: Order object for the current user.
- $quantity: Number of items present in the cart.
- $total: Array containing the total amount and default currency code used in the site.
Other variables:
- $total_amount: A formatted string that consists of the total amount and currency setting of AJAX Add to Cart. Placement of currency code or symbol is based on the Drupal currency setting.
- $cart_icon: Cart icon.
- $configuration['empty_cart_teaser_message']: Message to show if the cart is empty.
- $cart_link: Link in teaser block that takes you to cart page. is empty.
4 theme calls to dc-ajax-shopping-cart-teaser.tpl.php
- dc_ajax_add_cart_ajax_cart_form in ./
dc_ajax_add_cart.module - AJAX-ify the product add to cart.
- dc_ajax_add_cart_block_view in ./
dc_ajax_add_cart.module - Implements hook_block_view().
- dc_ajax_add_cart_remove_commerce_line_item in ./
dc_ajax_add_cart.module - Menu callback: Removes the product item from cart.
- dc_ajax_add_cart_update_quantity_refresh in ./
dc_ajax_add_cart.module - Callback that will update the quantity of line item.
File
templates/dc-ajax-shopping-cart-teaser.tpl.phpView source
<?php
/**
* @file
* Ajax shopping cart teaser block template file.
*
* If you want to change the structure of Cart Teaser then copy this file to
* your theme's templates directory and make your changes. DO NOT change this
* file.
*
* Available variables:
* - $order: Order object for the current user.
* - $quantity: Number of items present in the cart.
* - $total: Array containing the total amount and default currency code used
* in the site.
* Other variables:
* - $total_amount: A formatted string that consists of the total amount and
* currency setting of AJAX Add to Cart. Placement of currency code or
* symbol is based on the Drupal currency setting.
* - $cart_icon: Cart icon.
* - $configuration['empty_cart_teaser_message']: Message to show if the cart
* is empty.
* - $cart_link: Link in teaser block that takes you to cart page.
* is empty.
*/
if ($order && $quantity != 0) {
?>
<div class="cart-image"><?php
print $cart_icon;
?></div>
<div class="cart-product-quantity"><?php
print $cart_link;
?></div>
<div class="cart-product-total">
<p class="total-amount"><?php
print $total_amount;
?></p>
</div>
<?php
}
elseif ($quantity == 0 || !$order) {
?>
<div class="cart-image"><?php
print $cart_icon;
?></div>
<div class="cart-product-quantity">
<p class="empty-cart"><?php
print $configuration['empty_cart_teaser_message'];
?></p>
</div>
<div class="cart-product-total">
<p class="total-amount"><?php
print $total_amount;
?></p>
</div>
<?php
}