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 | |
// ❌ PROBLEM 1: Aggressive file renaming interfering with feed generation | |
function tp_random_media_filename($filename) { | |
// Skip randomization for WooCommerce export files | |
if (did_action('woocommerce_product_export_batch_export_start') || | |
did_action('woocommerce_product_exporter_start_export') || | |
strpos($filename, 'wc-product-export') !== false) { | |
return $filename; | |
} |
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
/** | |
* Remove WCVendors Pro split shipping functionality | |
* | |
* @since 1.0.0 | |
*/ | |
function wcv_remove_split_shipping_packages() { | |
// Check if WCVendors Pro is active and shipping controller exists | |
if ( ! class_exists( 'WCVendors_Pro' ) ) { | |
return; |
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
function wwp_hide_wholesale_price_for_guests($wholesale_price_html, $price, $product, $user_wholesale_role, $wholesale_price_title_text, $raw_wholesale_price, $source, $wholesale_price) { | |
// Only hide wholesale prices for guest users (not logged in) | |
if (!is_user_logged_in()) { | |
// Return only the regular price, no wholesale pricing | |
return $price; | |
} | |
// For logged-in users, return the wholesale price as normal | |
return $wholesale_price_html; |
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
/** | |
* Force downloadable checkbox to be checked using MutationObserver | |
*/ | |
function force_downloadable_checkbox_checked() { | |
?> | |
<script type="text/javascript"> | |
(function() { | |
// Function to check the downloadable checkbox | |
function checkDownloadable() { | |
var downloadableCheckbox = document.getElementById('_downloadable'); |
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
function replace_decimal_separator_for_tiktok( $product_data, $feed = null ) { | |
// Check if this is a TikTok Product Catalog feed | |
$is_tiktok_feed = false; | |
// First check by feed title if available | |
if ( isset($feed) && is_object($feed) && isset($feed->title) && strpos($feed->title, 'TikTok') !== false ) { | |
$is_tiktok_feed = true; | |
} | |
// Check by feed templates as defined in the channel statics |
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
/** | |
* Modify capabilities to allow Shop Manager to access only Product Feed menus | |
* | |
* @return string Required capability for accessing product feed menus | |
*/ | |
function allow_feed_menus_to_shop_manager() { | |
// Create a custom capability instead of using manage_woocommerce | |
return 'manage_adtribes_product_feeds'; | |
} | |
add_filter( 'woosea_user_cap', 'allow_feed_menus_to_shop_manager' ); |
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
/** | |
* Update product lookup table prices | |
* | |
* @param int $product_id The product ID | |
* @param array $postdata The product form data | |
* | |
* @return void | |
*/ | |
function dokan_update_product_lookup_prices( $product_id, $postdata ) { | |
if ( ! $product_id ) { |
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
/** | |
* Hide "Not right now" button in Dokan vendor setup wizard | |
*/ | |
/** | |
* Add CSS and JavaScript to hide the "Not right now" button | |
*/ | |
function dokan_hide_not_right_now_button() { | |
// Only apply on the dokan-seller-setup page | |
if ( isset( $_GET['page'] ) && 'dokan-seller-setup' === $_GET['page'] ) { |
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
function add_contact_form_to_vendor_dashboard( $nav_items ) { | |
// Add contact form menu to the vendor dashboard | |
$nav_items['contact_form'] = [ | |
'title' => __( 'Contact Form', 'dokan' ), | |
'icon' => '<i class="fa fa-envelope"></i>', | |
'url' => dokan_get_navigation_url( 'contact-form' ), | |
'pos' => 71, // Position in the menu (adjust as needed) | |
'permission' => 'dokan_view_contact_form_menu' | |
]; | |
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
#-- Vendor Registration Form Custom Field HTML --# | |
function form_custom_field_html() { | |
?> | |
<p class="form-row form-group form-row-wide"> | |
<label for="referred-by"><?php esc_html_e( 'Referred By', 'dokan-lite' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text form-control" name="dokan_referred_by" id="referred-by" value="<?php echo ! empty( $data['dokan_referred_by'] ) ? esc_attr( $data['dokan_referred_by'] ) : ''; ?>" required="required" /> | |
</p> | |
<p class="form-row form-group form-row-wide"> | |
<label for="gst-id"><?php esc_html_e( 'GST ID', 'dokan-lite' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text form-control" name="dokan_gst_id" id="gst-id" value="<?php echo ! empty( $data['dokan_gst_id'] ) ? esc_attr( $data['dokan_gst_id'] ) : ''; ?>" required="required" /> |
NewerOlder