This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_loop_ajax_add_to_cart', 10, 2 ); | |
/** | |
* Add qty button and ajax to add to cart | |
* @link https://stackoverflow.com/questions/48722178/add-a-quantity-field-to-ajax-add-to-cart-button-on-woocommerce-shop-page | |
* | |
*/ | |
function quantity_inputs_for_loop_ajax_add_to_cart( $html, $product ) { | |
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Process the checkout | |
**/ | |
add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process'); | |
function my_custom_checkout_field_process() { | |
global $woocommerce; | |
if ( ! (preg_match('/^[+]{0,1}[0-9]{10,14}$/D', $_POST['billing_phone'] ) ) ){ | |
wc_add_notice( "<strong>Telefón</strong> musí obsahovať minimálne 10 čísiel." ,'error' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************************************/ | |
/* ADD Custom Partner Field for MyAccount page and change user role to Partner */ | |
/****************************************************************************************************/ | |
function wooc_extra_register_fields() { | |
?> | |
<p class="form-row form-row-wide"> | |
<label for="reg_partner"><?php _e( 'Partner', 'woocommerce' ); ?> </label> |