Closed (fixed)
Project:
Commerce Ajax Add to Cart
Version:
7.x-1.0-beta2
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Apr 2013 at 16:51 UTC
Updated:
7 Aug 2014 at 16:00 UTC
Jump to comment: Most recent
Comments
Comment #1
ibuildit commentedI fixed it. Unfortunately I have never made a patch and I am swamped in work and don't have the time to create one now.
This is what I did (new lines marked with "+")
/**
* Implements hook_block_view().
*/
function dc_ajax_add_cart_block_view($delta = '') {
+$commerce_cart = dc_ajax_add_cart_get_commerce_cart_details();
+$line_items = $commerce_cart['wrapper']->commerce_line_items;
+$quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());
$block = array();
switch ($delta) {
case 'ajax_shopping_cart':
+ if($commerce_cart['order'] && $quantity != 0){
$block['subject'] = t('Shopping cart');
$block['content'] = dc_ajax_add_cart_get_shopping_cart();
+ }
break;
case 'ajax_shopping_cart_teaser':
$block['content'] = dc_ajax_add_cart_get_shopping_cart_teaser();
break;
}
return $block;
}
Now I would love to be able to update the block with AJAX so it hides when you delete an item from the cart.
Comment #2
subhojit777Hi Jakob,
Thanks for testing this module. This is a feature request, I guess we should implement this feature once the module is a "full-project". Right now I am concentrating on bug fixes and its full-project access (its been an year since the module is in sandbox, didnot get time to fix its issues :p ). I would be happy to get more feature requests for this module :)
Comment #3
subhojit777Comment #5
subhojit777