Skip to content

Commit

Permalink
Merge pull request #42 from pagantis/improvements
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
pgarcess authored Mar 4, 2020
2 parents 3cd1d2b + 9592cb9 commit 7daf520
Show file tree
Hide file tree
Showing 14 changed files with 244 additions and 160 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:7.2-apache

ENV WORDPRESS_VERSION=5.2.2
ENV WOOCOMMERCE_VERSION=3.6.2
ENV WORDPRESS_VERSION=5.3.2
ENV WOOCOMMERCE_VERSION=3.9.2

RUN cd /tmp \
&& curl https://es.wordpress.org/wordpress-$WORDPRESS_VERSION-es_ES.tar.gz -o $WORDPRESS_VERSION-es_ES.tar.gz \
Expand Down
2 changes: 2 additions & 0 deletions Documentation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Here you have a complete list of configurations you can change and it's explanat
| PAGANTIS_URL_OK | Location where user will be redirected after a successful payment. This string will be concatenated to the base url to build the full url
| PAGANTIS_URL_KO | Location where user will be redirected after a wrong payment. This string will be concatenated to the base url to build the full url
| PAGANTIS_ALLOWED_COUNTRIES | Array of country codes where the method can be used
| PAGANTIS_SIMULATOR_DISPLAY_SITUATION | Place to move the text simulator. To disable set to: "default"
| PAGANTIS_SIMULATOR_SELECTOR_VARIATION | Selector to use for products with variations. To disable set to: "default"

##### Edit using database
1 - Open your database management (Frequently Cpanel->phpmyadmin)
Expand Down
21 changes: 17 additions & 4 deletions WC_Pagantis.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pagantis
* Plugin URI: http://www.pagantis.com/
* Description: Financiar con Pagantis
* Version: 8.3.0
* Version: 8.3.2
* Author: Pagantis
*/

Expand Down Expand Up @@ -51,7 +51,9 @@ class WcPagantis
'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}',
'PAGANTIS_PROMOTION_EXTRA' => '<p>Finance this product <span class="pg-no-interest">without interest!</span></p>',
'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.',
'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ','
'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',',
'PAGANTIS_SIMULATOR_DISPLAY_SITUATION' => 'default',
'PAGANTIS_SIMULATOR_SELECTOR_VARIATION' => 'default'
);

/** @var Array $extraConfig */
Expand Down Expand Up @@ -247,6 +249,15 @@ public function pagantisActivation()
$wpdb->insert($tableName, array('config' => 'PAGANTIS_DISPLAY_MAX_AMOUNT', 'value' => '0'), array('%s', '%s'));
}

//Adding new selector < v8.3.2
$tableName = $wpdb->prefix.self::CONFIG_TABLE;
$query = "select * from $tableName where config='PAGANTIS_SIMULATOR_DISPLAY_SITUATION'";
$results = $wpdb->get_results($query, ARRAY_A);
if (count($results) == 0) {
$wpdb->insert($tableName, array('config' => 'PAGANTIS_SIMULATOR_DISPLAY_SITUATION', 'value' => 'default'), array('%s', '%s'));
$wpdb->insert($tableName, array('config' => 'PAGANTIS_SIMULATOR_SELECTOR_VARIATION', 'value' => 'default'), array('%s', '%s'));
}

$dbConfigs = $wpdb->get_results("select * from $tableName", ARRAY_A);

// Convert a multimple dimension array for SQL insert statements into a simple key/value
Expand Down Expand Up @@ -299,7 +310,7 @@ public function pagantisAddProductSimulator()

$post_id = $product->get_id();
$template_fields = array(
'total' => is_numeric($product->price) ? $product->price : 0,
'total' => is_numeric($product->get_price()) ? $product->get_price() : 0,
'public_key' => $cfg['pagantis_public_key'],
'simulator_type' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'],
'positionSelector' => $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'],
Expand All @@ -315,7 +326,9 @@ public function pagantisAddProductSimulator()
'pagantisQuotesStart' => $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'],
'pagantisSimulatorSkin' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'],
'pagantisSimulatorPosition' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'],
'separator' => __('ó', 'pagantis')
'separator' => __('ó', 'pagantis'),
'finalDestination' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SITUATION'],
'variationSelector' => $this->extraConfig['PAGANTIS_SIMULATOR_SELECTOR_VARIATION']
);
wc_get_template('product_simulator.php', $template_fields, '', $this->template_path);
}
Expand Down
Binary file modified assets/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7daf520

Please sign in to comment.