Skip to content

Instantly share code, notes, and snippets.

View cpaul007's full-sized avatar
🏠
Working from home

Chinmoy Paul cpaul007

🏠
Working from home
View GitHub Profile
@cpaul007
cpaul007 / ff-order-form.css
Created May 9, 2020 09:08
CSS Snippet for Order Form
.fluent_form_18 .ff-el-form-check-label {
display: none;
}
.fluent_form_18 .ff-el-image-holder {
border: 2px solid #f8f8f8;
padding: 5px 5px 0;
}
.fluent_form_18 .ff-el-image-holder.ff_item_selected {
@cpaul007
cpaul007 / ff-last-step-form-buttons-alignment.css
Last active December 20, 2023 14:45
Removing the previous button and center align the submit button at last step form
/* .fluent_form_18 is my form class. youe will replace form ID 18 with your form ID */
.fluent_form_18 .fluentform-step:last-child .ff_step_nav_last {
display: none;
}
.fluent_form_18 .fluentform-step:last-child .ff-t-column-2 {
display: table-row;
}
@cpaul007
cpaul007 / ff-toggle-next-button-step-form.js
Created May 9, 2020 10:00
Toggle next button of 1st step form
$('input[name=have_business]').on('change', function(){
checkedVal = $('input[name=have_business]:checked').val();
if( checkedVal == 'no' || checkedVal == 'No' ) {
$('.first-step').find('div.step-nav').hide();
} else {
$('.first-step').find('div.step-nav').show();
}
});
@cpaul007
cpaul007 / ff-input-number-format.js
Created May 17, 2020 03:48
Numver Fortmat in JavaScript
jQuery(document).ready(function($){
//* #ff_10_value_1,#ff_10_value_2 are input field ID.
$('#ff_10_value_1,#ff_10_value_2').on('keyup blur', function(){
var value = $('#ff_10_sum_ff').val();
//* #ff_10_sum_ff is the calcualtion field ID where value is showing
$('#ff_10_sum_ff').val( numberFormat(value, 2, '.', ',') );
});
});
function numberFormat (number, decimal_pos, decimal_sep, thousand_sep) {
@cpaul007
cpaul007 / product-category-description-with-link.php
Created October 7, 2020 18:27
Product Category Description with Link
@cpaul007
cpaul007 / checkout-button-text.php
Created October 30, 2020 14:36
Change the Checkout Button Text
<?php
add_filter( 'gettext_woocommerce', 'ouwoo_checkout_button_text', 10, 3);
function ouwoo_checkout_button_text( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'Checkout' :
$translated_text = "ENTER YOUR TEXT HERE";
break;
}
return $translated_text;
@cpaul007
cpaul007 / new-total-text.php
Created November 20, 2020 12:14
Change New Total Text
<?php
add_filter( 'gettext_woocommerce', 'ouwoo_new_total_text', 10, 3);
function ouwoo_new_total_text( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'New Total:' :
$translated_text = "ENTER YOUR TEXT HERE";
break;
}
return $translated_text;
@cpaul007
cpaul007 / change-coupon-field-placeholder-text.php
Created December 7, 2020 10:42
Changing the placeholder text of coupon input field
<?php
add_filter( 'gettext_woocommerce', 'ouwoo_coupon_placeholder_text', 10, 3);
function ouwoo_coupon_placeholder_text( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'Enter coupon code' :
$translated_text = "ENTER YOUR TEXT HERE";
break;
}
return $translated_text;
@cpaul007
cpaul007 / add_custom_remove_icon.php
Created April 11, 2021 13:28
How to add custom remove icon in Menu/Ultimate Cart
<?php //* Don't add this line
add_action( 'woocommerce_before_mini_cart_contents', 'ouwoo_custom_remove_icon', 11 );
function ouwoo_custom_remove_icon() {
remove_filter( 'woocommerce_cart_item_remove_link', 'ouwoo_woo_cart_remove_button', 10, 2 );
add_filter( 'woocommerce_cart_item_remove_link', 'ouwoo_add_custom_remove_button_icon', 10, 2 );
}
function ouwoo_add_custom_remove_button_icon($remove_link, $cart_item_key ) {
@cpaul007
cpaul007 / get_on_sale_wc_products_ids.php
Created June 28, 2021 06:58
Get on sale product IDs for Repeater
<?php
/**
* Getting on sale product ids
* @use wc_get_product_ids_on_sale function
* return string
*/
function ouwoo_wc_get_product_ids_on_sale() {
return implode( ",", (array) wc_get_product_ids_on_sale() );
}