Skip to content

Commit

Permalink
Merge pull request #65 from Eoxia/2.3.2
Browse files Browse the repository at this point in the history
2.3.2
  • Loading branch information
nicolas-eoxia authored Nov 23, 2020
2 parents c4efd53 + 70f77f9 commit 6a48626
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 21 deletions.
2 changes: 1 addition & 1 deletion core/asset/js/backend.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions modules/dolibarr/doli-products/class/class-doli-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function doli_to_wp( $doli_product, $wp_product, $save = true, &$notices
$wp_product->data['price_ttc'] = $doli_product->price_ttc;
$wp_product->data['tva_amount'] = $doli_product->price_ttc - $doli_product->price;
$wp_product->data['tva_tx'] = $doli_product->tva_tx;
$wp_product->data['stock'] = (int) $doli_product->stock_reel;
$wp_product->data['barcode'] = $doli_product->barcode;
$wp_product->data['fk_product_type'] = (int) $doli_product->type; // Product 0 or Service 1.
$wp_product->data['status'] = $doli_product->array_options->options__wps_status;
Expand All @@ -72,6 +73,7 @@ public function doli_to_wp( $doli_product, $wp_product, $save = true, &$notices
$data_sha['price'] = $doli_product->price;
$data_sha['price_ttc'] = $doli_product->price_ttc;
$data_sha['tva_tx'] = $doli_product->tva_tx;
$data_sha['stock'] = $doli_product->stock_reel;
$data_sha['status'] = $wp_product->data['status'];

$wp_product->data['sync_sha_256'] = hash( 'sha256', implode( ',', $data_sha ) );
Expand Down
6 changes: 3 additions & 3 deletions modules/dolibarr/doli-sync/class/class-doli-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ public function check_status( $id, $type ) {
if ( Settings::g()->debug_mode() ) {
//Start
echo '<pre>';
print_r(266 );
print_r('L266' );
print_r($response);
print_r('check dolibarr');
print_r(4);
print_r('check dolibarr sync');
print_r('4');
echo '</pre>';
//exit;
//End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function build_sha_product( $response, $wp_id ) {
$data_sha['price'] = $response->price;
$data_sha['price_ttc'] = $response->price_ttc;
$data_sha['tva_tx'] = $response->tva_tx;
$data_sha['stock'] = $response->stock_reel;
$data_sha['status'] = $response->array_options->options__wps_status;

if ( $response->array_options->options__wps_status == 1 || $response->array_options->options__wps_status == 'publish' ) {
Expand Down
17 changes: 12 additions & 5 deletions modules/products/asset/js/product.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ window.eoxiaJS.wpshop.product.init = function() {
* @version 2.0.0
*/
window.eoxiaJS.wpshop.product.event = function() {
jQuery( document ).on( 'wps-change-toggle', '.stock-field .toggle', window.eoxiaJS.wpshop.product.displayBlockStock );
jQuery( document ).on( 'click', '.stock-field .toggle', window.eoxiaJS.wpshop.product.displayBlockStock );
jQuery( document ).on( 'click', '.wps-list-product .table-header input[type="checkbox"]', window.eoxiaJS.wpshop.product.checkAll );
jQuery( document ).on( 'click', '.button-apply', window.eoxiaJS.wpshop.product.apply );
jQuery( document ).ready( window.eoxiaJS.wpshop.product.autoSynchro );
Expand Down Expand Up @@ -69,12 +69,19 @@ window.eoxiaJS.wpshop.product.event = function() {
* @param {ClickEvent} event [displayBlockStock].
* @param {toggleState} L'état du toggle.
*/
window.eoxiaJS.wpshop.product.displayBlockStock = function( event, toggleState ) {
if ( toggleState ) {
jQuery( '.stock-block' ).fadeIn();
} else {
window.eoxiaJS.wpshop.product.displayBlockStock = function() {
var toggleON = jQuery( this ).hasClass( 'fa-toggle-on' );
var nextStep = '';
if ( toggleON ) {
nextStep = 'false';
jQuery( this ).removeClass( "fa-toggle-on" ).addClass( "fa-toggle-off" );
jQuery( '.stock-block' ).fadeOut();
} else {
nextStep = 'true';
jQuery( this ).removeClass( "fa-toggle-off" ).addClass( "fa-toggle-on" );
jQuery( '.stock-block' ).fadeIn();
}
jQuery( this ).closest( '.wpeo-form' ).find( '.manage_stock' ).attr( 'value' , nextStep );
};

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/products/view/metabox/configuration.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="form-element stock-block" style="<?php echo $product->data['manage_stock'] ? '' : 'display: none;'; ?>">
<span class="form-label"><?php esc_html_e( 'Stock', 'wpshop' ); ?></span>
<label class="form-field-container">
<input type="text" class="form-field" name="product_data[stock]" value="<?php echo esc_attr( $product->data['stock'] ); ?>" />
<input type="text" class="form-field" name="product_data[stock]" value="<?php echo esc_attr( $product->data['stock'] ); ?>" readonly/>
</label>
</div>

Expand Down
1 change: 0 additions & 1 deletion modules/settings/asset/js/settings.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ window.eoxiaJS.wpshop.settings.event = function() {
* @return {void}
*/
window.eoxiaJS.wpshop.settings.buttonToggle = function( event ) {
console.log( 'test');
var toggleON = jQuery( this ).hasClass( 'fa-toggle-on' );
var nextStep = '';
if (toggleON) {
Expand Down
3 changes: 1 addition & 2 deletions modules/stripe/class/class-stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace wpshop;

use eoxia\Singleton_Util;
use Stripe\Checkout\Session;

defined( 'ABSPATH' ) || exit;

Expand Down Expand Up @@ -51,7 +50,7 @@ public function process_payment( $order ) {
'currency' => 'eur',
);

$session = Session::create( array(
$session = Stripe\Checkout\Session::create( array(
'success_url' => Pages::g()->get_checkout_link() . '/received/order/' . $order->data['external_id'],
'cancel_url' => site_url(),
'payment_method_types' => array( 'card' ),
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Donate link: https://www.wpshop.fr/
Requires at least: 4.4
Tested up to: 5.5.3
Requires PHP: 7.0
Stable tag: 2.3.1
Stable tag: 2.3.2
License: GPLv3 or later
License URI: https://spdx.org/licenses/GPL-3.0-or-later.html

Expand All @@ -29,7 +29,7 @@ WPshop vous propose également des [thèmes wordpress eCommerce](https://shop.eo

== Installation ==

Consultez notre [documentation en ligne](http://www.wpshop.fr/documentations/presentation-wpshop "documentation wpshop").
Consultez notre [documentation en ligne](http://www.wpshop.fr/documentation/ "documentation wpshop").
L'installation du plugin peut se faire de 2 façons :

* Méthode 1
Expand Down Expand Up @@ -65,6 +65,13 @@ Il n'est pas possible de migrer les données vers la version WPShop 2.X.X.

== Changelog ==

= Version 2.3.2 =

* Add - Add stock to product synchronisation.

* Fix - Stripe API request error.
* Fix - Media.

= Version 2.3.1 =

* Add - Mode debug.
Expand Down
2 changes: 1 addition & 1 deletion wpshop.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "WPshop",
"slug": "wpshop",
"since": "2.0.0",
"version": "2.3.1",
"version": "2.3.2",
"description": "L'application WPshop 2",
"externals": [],
"modules": [
Expand Down
4 changes: 2 additions & 2 deletions wpshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WPshop 2
* Plugin URI: https://wpshop.fr/
* Description: Simple, fast, efficient it will transform your WordPress into an internet sales site
* Version: 2.3.1
* Version: 2.3.2
* Author: Eoxia <[email protected]>
* Author URI: http://www.eoxia.com/
* License: GPLv3
Expand All @@ -30,7 +30,7 @@
}

// Include composer component.
// require_once 'vendor/autoload.php';
require_once 'vendor/autoload.php';

// Boot your plugin.
Init_Util::g()->exec( PLUGIN_WPSHOP_PATH, basename( __FILE__, '.php' ) );
Expand Down

0 comments on commit 6a48626

Please sign in to comment.