forked from rszrama/drupalcommerce
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1029956 by rszrama: add an API function and Views integration for li…
…ne item titles and use the field in the default cart Views linked to the display path if it exists.
- Loading branch information
Showing
9 changed files
with
370 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
507 changes: 286 additions & 221 deletions
507
modules/cart/includes/views/commerce_cart.views_default.inc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* $Id$ */ | ||
|
||
.view-commerce-cart-block tr { | ||
vertical-align: top; | ||
} | ||
|
||
.view-commerce-cart-block .views-field-quantity { | ||
white-space: nowrap; | ||
} | ||
|
||
.view-commerce-cart-block td.price, | ||
.view-commerce-cart-form td.price, | ||
.view-commerce-cart-summary td.price { | ||
white-space: nowrap; | ||
} | ||
|
||
.view-commerce-cart-form tr, | ||
.view-commerce-cart-summary tr { | ||
vertical-align: top; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...es/line_item/includes/views/handlers/commerce_line_item_handler_field_line_item_title.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
// $Id$ | ||
|
||
/** | ||
* Field handler to return a line item's title. | ||
*/ | ||
class commerce_line_item_handler_field_line_item_title extends views_handler_field { | ||
function construct() { | ||
parent::construct(); | ||
|
||
$this->additional_fields['line_item_id'] = 'line_item_id'; | ||
} | ||
|
||
function query() { | ||
$this->ensure_my_table(); | ||
$this->add_additional_fields(); | ||
} | ||
|
||
function render($values) { | ||
// Load the line item and return its title. | ||
$line_item = commerce_line_item_load($values->{$this->aliases['line_item_id']}); | ||
return commerce_line_item_title($line_item); | ||
} | ||
} |