Skip to content

Instantly share code, notes, and snippets.

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

Pramod Jodhani pramodjodhani

🏠
Working from home
  • 06:53 (UTC +05:30)
View GitHub Profile
@pramodjodhani
pramodjodhani / wds.php
Created September 3, 2025 06:16
WDS - Disable Monday (weekday) for given product in cart
<?php
/**
* Modify allowed days based on cart items.
*
* @param array $allowed_days
* @param bool $minmax
* * @return mixed
*/
function iconic_wds_modify_allowed_days( $allowed_days, $minmax ) {
if ( $minmax ) {
<?php
/**
* Check cart for given product id product.
*
* @param array $categories Categories.
*
* @return bool
*/
function iconic_check_for_cart_item_in_cart( $product_ids = array() ) {
if ( empty( $product_ids ) || empty( WC()->cart ) ) {
@pramodjodhani
pramodjodhani / functions.php
Created July 28, 2025 06:29
Flux checkout - Move position of shipping container to below the Shipping Adress.
<?php
/**
* Flux checkout: Move position of shipping container to below the Shipping Adress.
*/
add_action( 'woocommerce_after_order_notes', function() {
?>
<div class="flux-shipping-container--desktop"></div>
<?php
} );
@pramodjodhani
pramodjodhani / gf-mcg-php-symbol.php
Last active July 24, 2025 13:22
Gravity Forms: Modify Philippine Peso currency to display ₱ symbol instead of PHP text.
<?php
/**
* Modify Philippine Peso currency to display ₱ symbol instead of PHP text.
*
* @param array $currencies The current currencies registered in Gravity Forms.
* @return array List of currencies with modified PHP currency.
*/
function modify_php_currency_symbol( $currencies ) {
$currencies['PHP'] = array(
'name' => 'Philippine Peso',
@pramodjodhani
pramodjodhani / mcg-add-aed-currency-to-gf.php
Created July 23, 2025 17:20
Add UAE Dirham (AED) currency to Gravity Forms.
<?php
/**
* Add UAE Dirham (AED) currency to Gravity Forms.
*
* @param array $currencies The current currencies registered in Gravity Forms.
* @return array List of supported currencies with AED added.
*/
function add_aed_currency_to_gf( $currencies ) {
$currencies['AED'] = array(
'name' => 'United Arab Emirates Dirham',
@pramodjodhani
pramodjodhani / add-custom-field.php
Created July 11, 2025 13:37
Flu checkout - add custom field
<?php
/**
* Flux checkout - add custom fields.
*
* @param array $fields Checkout Fields.
*
* @return array.
*/
function flux_add_custom_field( $fields ) {
$fields['billing']['billing_birthday'] = array(
<?php
/**
* Plugin Name: Recurring Slot Calculator Test
* Plugin URI: https://iconicwp.com
* Description: Test plugin for RecurringSlotCalculator class
* Version: 1.0.0
* Author: IconicWP
* Text Domain: recurring-slot-test
*
* @package RecurringSlotTest
@pramodjodhani
pramodjodhani / stellarpay-clock-snippet.php
Last active June 3, 2025 13:30
Clock simulation code
<?php
use StellarPay\Core\ValueObjects\WebhookEventType;
use StellarPay\Core\Support\Facades\DateTime\Temporal;
use StellarPay\Core\Support\Facades\DateTime\TemporalFacade;
use StellarPay\Core\Webhooks\EventProcessor;
use StellarPay\Core\Webhooks\EventResponse;
use StellarPay\PaymentGateways\Stripe\Webhook\WebhookRegisterer;
use function StellarPay\Core\container;
@pramodjodhani
pramodjodhani / function.php
Created May 26, 2025 11:13
Flux checkout - custom validatio
add_filter('woocommerce_checkout_fields', 'add_custom_checkout_field');
function add_custom_checkout_field($fields) {
$fields['billing']['billing_custom_field'] = array(
'type' => 'text',
'label' => __('BTW-nummer'),
'required' => false, // has to be false, otherwise it's always checked dispite of country selected!
'class' => array('form-row-wide', 'tax-number-class'),
'label_class' => array('tax-number-label'),
'clear' => true,
);
@pramodjodhani
pramodjodhani / functions.php
Created May 7, 2025 13:03
Flux checkout - move company field to billing step.
/**
* Flux checkout - move company field to billing step.
*/
add_filter( 'flux_checkout_details_fields', function( $fields ) {
foreach ( $fields as $key => $field ) {
if ( $field === 'billing_company' ) {
unset( $fields[ $key ] );
}
}