1
0
mirror of synced 2025-01-18 00:41:43 +03:00

Adding loyalty program coupon entry to form by click (#343)

This commit is contained in:
Kocmonavtik 2024-09-12 09:40:05 +03:00 committed by GitHub
parent 78fd206c0c
commit dac3c9f6f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,6 @@
## 2024-09-11 4.8.3
* Added loyalty program coupon entry in the form by click
## 2024-08-26 4.8.2
* Fixed base file customization issue
* Added a hook to update the list of meta fields

View File

@ -1 +1 @@
4.8.2
4.8.3

View File

@ -0,0 +1,6 @@
function inputLoyaltyCode() {
let couponInput = document.getElementById('coupon_code');
let couponCode = document.getElementById('input_loyalty_code');
couponInput.value = couponCode.innerText;
}

View File

@ -747,6 +747,13 @@ if (!class_exists('WC_Retailcrm_Base')) {
if ($result) {
echo $result;
}
$jsScriptPath = plugins_url() . self::ASSETS_DIR . '/js/retailcrm-loyalty-cart.js';
$wpAdminUrl = ['url' => get_admin_url()];
wp_register_script('retailcrm-loyalty-cart', $jsScriptPath, false, '0.1');
wp_enqueue_script('retailcrm-loyalty-cart', $jsScriptPath, '', '', true);
wp_localize_script('retailcrm-loyalty-cart', 'AdminUrl', $wpAdminUrl);
} catch (Throwable $exception) {
writeBaseLogs($exception->getMessage());
}

View File

@ -254,7 +254,7 @@ if (!class_exists('WC_Retailcrm_Loyalty')) :
}
$resultString .= ' <div style="text-align: left; line-height: 3"><b>' . __('It is possible to write off', 'retailcrm') . ' ' . $lpDiscountSum . ' ' . __('bonuses', 'retailcrm') . '</b></div>';
return $resultString. '<div style="text-align: left;"><b>' . __('Use coupon:', 'retailcrm') . ' <u><i>' . $coupon->get_code() . '</i></u></i></b></div>';
return $resultString. '<div style="text-align: left;"><b>' . __('Use coupon:', 'retailcrm') . ' <u><i style="cursor: grab" id="input_loyalty_code" onclick="inputLoyaltyCode()">' . $coupon->get_code() . '</i></u></i></b></div>';
}
public function clearLoyaltyCoupon()

View File

@ -5,7 +5,7 @@ Tags: Интеграция, Simla.com, simla
Requires PHP: 7.0
Requires at least: 5.3
Tested up to: 6.5
Stable tag: 4.8.2
Stable tag: 4.8.3
License: GPLv1 or later
License URI: http://www.gnu.org/licenses/gpl-1.0.html
@ -82,6 +82,9 @@ Asegúrate de tener una clave API específica para cada tienda. Las siguientes i
== Changelog ==
= 4.8.3 =
* Added loyalty program coupon entry in the form by click
= 4.8.2 =
* Fixed base file customization issue
* Added a hook to update the list of meta fields

View File

@ -5,7 +5,7 @@
* Description: Integration plugin for WooCommerce & Simla.com
* Author: RetailDriver LLC
* Author URI: http://retailcrm.pro/
* Version: 4.8.2
* Version: 4.8.3
* Tested up to: 6.5
* Requires Plugins: woocommerce
* WC requires at least: 5.4

View File

@ -16,7 +16,7 @@
*
* @link https://wordpress.org/plugins/woo-retailcrm/
*
* @version 4.8.2
* @version 4.8.3
*
* @package RetailCRM
*/