ื“ืœื’ ืœืชื•ื›ืŸ ื”ืจืืฉื™
ืžืืžืจ ยท ืคื•ืจืกื™ื™ื˜

ื”ื•ืกืคืช ื›ืžื•ืช ืžื•ืฆืจื™ื ืœื™ื“ ื›ืคืชื•ืจ ื”ื•ืกืคื” ืœืกืœ (ืขืžื•ื“ ื™ื—ื™ื“ ื‘ื•ื•ืงื•ืžืจืก)

ื”ื•ืกืคืช ื›ืžื•ืช ืžื•ืฆืจื™ื ื‘ืขืžื•ื“ ืžื•ืฆืจ ื‘ื•ื•ืงื•ืžืจืก - ื—ื ื•ืช ืื•ื ืœื™ื™ืŸ ื•ืขื’ืœืช ืงื ื™ื•ืช, ืคื•ืจืกื™ื™ื˜ ื‘ื ื™ื™ืช ื—ื ื•ื™ื•ืช

ืื™ืš ืžืขื•ื“ื“ื™ื ืืช ื”ื’ื•ืœืฉ ื‘ื—ื ื•ืช ืื™ื ื˜ืจื ื˜ื™ืช ืœืงื ื•ืช ืขื•ื“ ืžื•ืฆืจื™ื ืื• ืขื•ื“ ืžืื•ืชื• ืžื•ืฆืจ ืฉื”ื•ื ืงื ื”?

ืคืฉื•ื˜ ืžืื•ื“, ื’ื•ืจืžื™ื ืœื• ืœื”ื’ื“ื™ืœ ืืช ื›ืžื•ืช ื”ืžื•ืฆืจื™ื ืฉื”ื•ื ืžื›ื ื™ืก ืœืกืœ.
ื‘ืฉื‘ื™ืœ ื–ื” ื™ืฉ ืงื•ื“ ืฉืžื•ืกื™ืฃ ื›ืคืชื•ืจื™ื ื’ื“ื•ืœื™ื ืฉืœ ืคืœื•ืก ื•ืžื™ื ื•ืก ืœื™ื“ ื”ื›ืคืชื•ืจ ืฉืœ ื”ื•ืกืคื” ืœืกืœ ื‘ืขืžื•ื“ ืฉืœ ื”ืžื•ืฆืจ.

ืื– ืื™ืš ืขื•ืฉื™ื ืืช ื–ื”?

ืžื•ืกื™ืคื™ื ืืช ื”ืงื•ื“ PHP ืœfunctions.php

/*** START 'woocommerce_after_add_to_cart_quantity' ***/

add_action( 'woocommerce_after_add_to_cart_quantity', 'ts_quantity_plus_sign' );

function ts_quantity_plus_sign() {
echo '<button type="button" class="plus" >+</button>';
}

add_action( 'woocommerce_before_add_to_cart_quantity', 'ts_quantity_minus_sign' );

function ts_quantity_minus_sign() {
echo '<button type="button" class="minus" >-</button>';
}

add_action( 'wp_footer', 'ts_quantity_plus_minus' );

function ts_quantity_plus_minus() {
// To run this on the single product page
if ( ! is_product() ) return;
?>
<script type="text/javascript">

jQuery(document).ready(function($){

$('form.cart').on( 'click', 'button.plus, button.minus', function() {

// Get current quantity values
var qty = $( this ).closest( 'form.cart' ).find( '.qty' );
var val = parseFloat(qty.val());
var max = parseFloat(qty.attr( 'max' ));
var min = parseFloat(qty.attr( 'min' ));
var step = parseFloat(qty.attr( 'step' ));

if(!val) {
val = 0;
}

// Change the value if plus or minus
if ( $( this ).is( '.plus' ) ) {
if ( max && ( max <= val ) ) {
qty.val( max );
}
else {
qty.val( val + step );
}
}
else {
if ( min && ( min >= val ) ) {
qty.val( min );
}
else if ( val > 1 ) {
qty.val( val - step );
}
}

});

});

</script>
<?php
}
/*** END 'woocommerce_after_add_to_cart_quantity' ***/

 

ืžื•ืกื™ืคื™ื ืขื™ืฆื•ื‘ CSS ื‘ืขืžื•ื“ ืกื™ื ื’ืœ

 

ื‘ืชื‘ื ื™ืช ืกื™ื ื’ืœ ืžื•ืฆืจ ืžื•ืกื™ืคื™ื ืขืœ ื”ื•ื™ื“ื’ืณื˜ ืดื”ื•ืกืคื” ืœืกืœืด ืืช ื”ืงื•ื“ CSS ื”ื‘ื:

selector .quantity .qty {
width: 4.631em;
-webkit-appearance: textfield;
-moz-appearance: textfield;
appearance: textfield;
text-align: center !important;
border-width: 1px 0 !important;
}

selector .quantity .qty::-webkit-outer-spin-button,
selector .quantity .qty::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

selector button:not(.single_add_to_cart_button) {
flex-basis: auto !important;
padding: 15px !important;
overflow: hidden;
background-color: #f9f9f9 !important;
color: #666 !important;
border: 1px solid #ddd !important;
text-transform: none !important;
font-weight: normal !important;
font-size: 12px !important;
}
selector .single_add_to_cart_button {
margin-right: 10px;
}

 

ื•ืื– ืžืงื‘ืœื™ื:

*** ืขื“ื›ื•ืŸ ***

ืชื•ื“ื” ืจื‘ื”ย ืœื“ื•ืจ ืฉื™ืฃย ืฉืคื ื” ืืœื™ื™ ืขื ืชื™ืงื•ืŸ ืœืชืจื—ื™ืฉ ื”ื‘ื:
ืดื‘ืžืงืจื” ื•ื‘-input ืฉืœ ื”-qty ืื™ืŸ ืžืกืคืจ ื›ื™ ืžื™ืฉื”ื• ื ื™ืกื” ืœื”ืงืœื™ื“ ื•ืื– ืžื—ืง ืื•ืชื•, ื”ืกืงืจื™ืคื˜ ืœื ื™ื•ื“ืข ืžืžื” ืœื”ืขืœื•ืช ืื• ืœื”ื•ืจื™ื“. ื”ื•ืกืคืชื™ ืฉื•ืจื” ืงื˜ื ื” ืฉื‘ื•ื“ืงืช ืื ืื™ืŸ ืžืกืคืจ ื‘-input ื”ื•ื ืฉื ืื•ืชื• ื›-0 ื•ืื– ืžื•ืจื™ื“ ืื• ืžื•ืกื™ืฃ ืœืคื™ ืžื” ืฉืœื—ืฆื•ืด

ื”ืงื•ื“ ืฉืœื• ื ื•ืกืฃ ืœืงื•ื“ ื”ืžืœื ืœืžืขืœื” (ืฉื•ืจื•ืช 34-36) ๐Ÿ™‚

ืงืจื“ื™ื˜ - ื ืœืงื— ืžืืชืจ : lmn.co.il

 

ืื”ื‘ืช ืืช ื”ืžืืžืจ?
ื‘ื•ื ื ื“ื‘ืจ ืขืœ ื”ืขืกืง ืฉืœืš.

ืกืจื™ืงื” ืฉื™ื•ื•ืงื™ืช ื—ื™ื ื, ืื ื™ ื‘ื•ื“ืง ืืช ื”ืืชืจ, ืืช ื”ืžืชื—ืจื™ื ื•ืืช ื’ื•ื’ืœ, ื•ืžื—ื–ื™ืจ ืœืš ืชื•ื›ื ื™ืช ืขื‘ื•ื“ื” ื‘ืจื•ืจื”. ื‘ืœื™ ื”ืชื—ื™ื™ื‘ื•ืช.