Skip to content

Commit daf09dc

Browse files
author
calvinpy
committed
cart widget, release 0.0.7
1 parent 930df37 commit daf09dc

File tree

6 files changed

+40
-7
lines changed

6 files changed

+40
-7
lines changed

HISTORY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Change Log
22

3+
#### [v0.0.7](https://github.com/aplazame/woocommerce/tree/v0.0.7) (2016-02-17)
4+
5+
[Full Changelog v0.0.7](https://github.com/aplazame/woocommerce/compare/v0.0.6...v0.0.7)
6+
7+
* Cart widget
8+
39
#### [v0.0.6](https://github.com/aplazame/woocommerce/tree/v0.0.6) (2015-12-15)
410

511
[Full Changelog v0.0.6](https://github.com/aplazame/woocommerce/compare/v0.0.5...v0.0.6)

README.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ Of course, simply select an *"Aplazame refund"* in the product detail.
108108

109109
== Changelog ==
110110

111+
#### [v0.0.7] (2016-02-17)
112+
113+
[view on Github](https://github.com/aplazame/woocommerce/tree/v0.0.7)
114+
115+
* Cart Widget
116+
111117
#### [v0.0.6] (2015-12-15)
112118

113119
[view on Github](https://github.com/aplazame/woocommerce/tree/v0.0.6)

aplazame.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Plugin Name: Aplazame
44
* Plugin URI: https://github.com/aplazame/woocommerce
5-
* Version: 0.0.6
5+
* Version: 0.0.7
66
* Description: Aplazame offers a payment method to receive funding for the purchases.
77
* Author: calvin
88
*
@@ -17,7 +17,7 @@
1717

1818
class WC_Aplazame
1919
{
20-
const VERSION = '0.0.6';
20+
const VERSION = '0.0.7';
2121
const METHOD_ID = 'aplazame';
2222
const METHOD_TITLE = 'Aplazame';
2323

@@ -58,7 +58,10 @@ public function __construct()
5858

5959
# Widgets
6060
add_action('woocommerce_single_product_summary', array(
61-
$this, 'simulator'), 100);
61+
$this, 'product_widget'), 100);
62+
63+
add_action('woocommerce_after_cart_totals', array(
64+
$this, 'cart_widget'), 100);
6265

6366
# Handlers
6467
add_action('woocommerce_order_status_cancelled', array(
@@ -187,9 +190,14 @@ public function history()
187190
}
188191

189192
# Widgets
190-
public function simulator()
193+
public function product_widget()
194+
{
195+
Aplazame_Helpers::render_to_template('widgets/product.php');
196+
}
197+
198+
public function cart_widget()
191199
{
192-
Aplazame_Helpers::render_to_template('widgets/simulator.php');
200+
Aplazame_Helpers::render_to_template('widgets/cart.php');
193201
}
194202

195203
# Handlers (no return)

l10n/es/default.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: Aplazame v0.0.6\n"
9+
"Project-Id-Version: Aplazame v0.0.7\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2015-09-12 01:59+0200\n"
12-
"PO-Revision-Date: 2015-09-25 00:00+0200\n"
12+
"PO-Revision-Date: 2016-02-17 00:00+0200\n"
1313
"Last-Translator: Aplazame <[email protected]>\n"
1414
"Language-Team: Aplazame <[email protected]>\n"
1515
"Language: es_ES\n"

templates/widgets/cart.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
if (!defined('ABSPATH')) {
4+
exit;
5+
}
6+
7+
?>
8+
9+
<div
10+
data-aplazame-simulator=""
11+
data-amount="<?php echo Aplazame_Filters::decimals(WC()->cart->total); ?>"
12+
data-currency="<?php echo get_woocommerce_currency(); ?>">
13+
</div>

0 commit comments

Comments
 (0)