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 | |
/** | |
* Sync wc with DIGITS plugin | |
*/ | |
function ywp_sync_digits_with_wc( $customer_id, $new_customer_data, $password_generated ) { | |
$user = get_user_by( 'id', $customer_id ); | |
if ( $user && property_exists( $user, 'user_email' ) && empty( $user->user_email ) ) { | |
$fake_mail = sprintf( |
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 | |
function wpp_woodmart_ajax_search_compatibility( $args ) { | |
if ( function_exists( 'fix_arabic' ) ) { | |
$args['s'] = fix_arabic( $args['s'] ); | |
} | |
return $args; | |
} |
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 | |
function ywp_show_variation_description() { ?> | |
<div id="ywp-var-desc"></div> | |
<script> | |
jQuery(function($){ | |
$('form.variations_form').on('show_variation', function (event, data) { | |
$('#ywp-var-desc').html(data.variation_description); | |
}); | |
}) |
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 | |
/** | |
* Change min qty to area | |
*/ | |
function ywp_set_min_qty_decimal( $val ) { | |
return 0.1; | |
} | |
add_filter('woocommerce_quantity_input_min', 'ywp_set_min_qty_decimal'); |
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 | |
function wpp_replace_arabic_chars_in_search_term( $request_vars ) { | |
if ( function_exists( 'fix_arabic' ) && ! empty( $request_vars['s'] ) ) { | |
$request_vars['s'] = fix_arabic( $request_vars['s'] ); | |
} | |
return $request_vars; | |
} |
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 | |
function ywp_date_modified_wc_product_shortcode( $args, $atts ){ | |
$atts = shortcode_atts( | |
array( | |
'orderby' => 'date', | |
'interval' => '20', | |
), $atts, 'bartag' | |
); | |
if ( 'date_modified' === esc_attr( $atts['orderby'] ) ) { |
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 | |
$order = wc_get_order( $order_id ); | |
$order_shipping_methods = $order->get_items( 'shipping' ); | |
foreach ( order_shipping_methods as $item_id => $item ) { | |
$shipping_method_instance_id = $item->get_instance_id(); | |
$shipping_method_id = $item->get_method_id(); | |
$shipping_method_title = $item->get_method_title(); | |
$order_item_name = $item->get_name(); |
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 packaging option to order bulk actions | |
*/ | |
function ywp_add_packaging_to_bulk_actions( $actions ) { | |
$actions['mark_packaging'] = 'تغییر وضعیت به بستهبندی'; | |
return $actions; | |
} |
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
-- توجه: حتما قبل از اجرای این کد، از دیتابیس نسخۀ پشتیبان تهیه کنید -- | |
-- وارد فضای هاست خود شده و PHPMyAdmin را باز کرده و کد زیر را در بخش SQL اجرا کنید. -- | |
-- تبدیل قیمت همه محصولات به تومان -- | |
UPDATE | |
wp_postmeta | |
SET |
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 custom endpoint to the My Account menu | |
* | |
* @param array $items | |
* | |
* @return array | |
*/ | |
function ywp_account_menu_custom_item( $items ) { | |
$logout = $items['customer-logout']; |