Changeset 3081748
- Timestamp:
- 05/06/2024 08:01:23 AM (2 years ago)
- Location:
- stan-checkout/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (2 diffs)
-
includes/classes/class-wc-stan-checkout-button.php (modified) (1 diff)
-
includes/classes/class-wc-stan-checkout-cart-api.php (modified) (1 diff)
-
public/css/wc-stan-checkout-public.css (modified) (2 diffs)
-
public/js/wc-stan-checkout-public.js (modified) (1 diff)
-
wc-stan-checkout.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
stan-checkout/trunk/README.txt
r3079007 r3081748 4 4 Requires at least: 5.0.0 5 5 Tested up to: 6.5.2 6 Stable tag: 1. 1.16 Stable tag: 1.2.0 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 91 91 == Mise à jour == 92 92 93 = 1.2.0 = 94 * Ajout de la gestion des variations de produits avec le Checkout Xpress 95 96 = 1.1.0 = 97 * Fonctionnalité de Checkout Xpress directement depuis la page produit 98 93 99 = 1.0.0 = 94 100 * Première publication -
stan-checkout/trunk/includes/classes/class-wc-stan-checkout-button.php
r3077758 r3081748 37 37 add_action( 'woocommerce_before_cart_totals', array( $this, 'display_stan_checkout_button_in_cart_page' ), 5 ); 38 38 add_action( 'woocommerce_widget_shopping_cart_buttons', array( $this, 'display_stan_checkout_button_in_mini_cart_page' ), 10 ); 39 add_action( 'woocommerce_ before_add_to_cart_button', array( $this, 'display_stan_checkout_button_in_product_page' ), 10 );39 add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_stan_checkout_button_in_product_page' ), 10 ); 40 40 } 41 41 -
stan-checkout/trunk/includes/classes/class-wc-stan-checkout-cart-api.php
r3079007 r3081748 91 91 add_filter( 'woocommerce_add_to_cart_redirect', '__return_empty_string' ); 92 92 WC()->cart->empty_cart(); 93 WC()->cart->add_to_cart( $this->decode_request_payload->product_id ); 93 94 $variation_id = null; 95 $variations = array(); 96 97 if ( isset( $this->decode_request_payload->variation_id ) && isset( $this->decode_request_payload->attributes ) ) { 98 foreach( $this->decode_request_payload->attributes as $attribute ) { 99 $variations[ $attribute->name ] = $attribute->value; 100 } 101 } 102 103 WC()->cart->add_to_cart( $this->decode_request_payload->product_id, 1, $this->decode_request_payload->variation_id, $variations ); 94 104 remove_filter( 'woocommerce_add_to_cart_redirect', '__return_empty_string' ); 95 105 -
stan-checkout/trunk/public/css/wc-stan-checkout-public.css
r3077758 r3081748 7 7 } 8 8 #stan-checkout .stan-checkout--button { 9 position: relative;10 9 display: flex; 11 10 flex-direction: row; … … 16 15 border-width: 0; 17 16 border-radius: 3px; 18 height: 30px;19 min-height: 30px;17 height: 48px; 18 min-height: 48px; 20 19 line-height: 0; 21 20 padding: 10px 15px; 22 box-sizing: content-box;23 21 cursor: pointer; 24 22 } -
stan-checkout/trunk/public/js/wc-stan-checkout-public.js
r3077758 r3081748 21 21 $( '.stan-checkout--error' ).css( 'visibility', 'hidden' ); 22 22 23 const variationsForm = $( '.variations_form.cart' ); 24 25 const body = { 26 product_id: $( this ).data('product'), 27 attributes: [], 28 } 29 30 if (variationsForm.length) { 31 var variationsData = {}; 32 33 // Get all form elements within the variations form 34 variationsForm.find('input, select').each(function() { 35 var element = $(this); 36 37 variationsData[element.attr('name')] = element.val(); 38 }); 39 40 for (const v in variationsData) { 41 if (v.includes('attribute_')) { 42 body.attributes.push({ 43 name: v, 44 value: variationsData[v], 45 }); 46 } 47 } 48 49 if (typeof variationsData['variation_id'] !== 'undefined') { 50 body.variation_id = variationsData['variation_id']; 51 } 52 } 53 23 54 fetch('/wp-json/stan/checkouts', { 24 55 method: 'POST', 25 body: JSON.stringify({ 26 product_id: $( this ).data( 'product' ), 27 }), 56 body: JSON.stringify(body), 28 57 credentials: 'include', 29 58 }) -
stan-checkout/trunk/wc-stan-checkout.php
r3079007 r3081748 19 19 * Plugin URI: https://compte.stan-app.fr 20 20 * Description: Vous perdez des utilisateurs lorsque vous demandez de s'inscrire, remplir les formulaires est la première raison qui mène les utilisateurs à quitter un site. Avec Stan Checkout vos utilisateurs s'inscrivent sans formulaire, sans contrainte. 21 * Version: 1. 1.121 * Version: 1.2.0 22 22 * Author: Brightweb 23 23 * Author URI: https://stan-business.fr
Note: See TracChangeset
for help on using the changeset viewer.