This file contains 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 xt_qv_shortcode_extension() { | |
global $product; | |
$id = $product->get_id(); | |
return do_shortcode( '[xt_wooqv_trigger id="' . $id . '"]'); | |
} | |
add_shortcode( 'my_new_shortcode', 'xt_qv_shortcode_extension' ); |
This file contains 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
const divs = document.getElementsByClassName('product-bundle__discount-label'); | |
for (let x = 0; x < divs.length; x++) { | |
const div = divs[x]; | |
const content = div.textContent.trim(); | |
if (content == '0%' || content == '-0%') { | |
div.style.display = 'none'; | |
} | |
} |
This file contains 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 restrict_access_for_specific_page() { | |
// Specify the page ID where you want to apply the restriction | |
$restricted_page_id = 123; // Replace 123 with the actual page ID | |
// Check if the current page is the restricted page | |
if (is_page($restricted_page_id)) { | |
// Specify the URL that users must come from to access the page | |
$allowed_url = 'https://example.com/allowed-url'; | |
// Get the referring URL |
This file contains 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
<!-- Attributes --> | |
<?php do_action( 'wcv_before_attributes_tab', $object_id ); ?> | |
<div class="wcv_product_attributes tabs-content" id="attributes"> | |
<div class="attributes-validation-error"></div> | |
<?php WCVendors_Pro_Product_Form::product_attributes( $object_id ); ?> |
This file contains 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
add_filter( 'login_form_fields', 'remember_me_checked' ); | |
function remember_me_checked($fields) { | |
if ( isset( $fields['login']['remember'] ) ) { | |
?> | |
<script type="text/javascript"> | |
function checkit() { | |
document.getElementById('remember').checked = true; | |
} |
This file contains 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
define('ag_webhook_delay', TRUE); |
This file contains 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
add_filter( 'wpum_recaptcha_score_threshold', 'my_recaptcha_score' ); | |
function my_recaptcha_score( $score ) { | |
/* | |
* Return a score between 1 and 0.1. | |
* A lower score will let through more results. | |
*/ | |
return 0.3; | |
} |
This file contains 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 wcv_add_target_blank_for_button() { | |
?> | |
<script> | |
jQuery(document).ready(function ($) { | |
let $manageResource = $('.button.button-primary.add_resource').next(); | |
if ($manageResource.length) { | |
$manageResource.attr('target', '_blank'); | |
} | |
}); | |
</script> |
This file contains 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
/** | |
* Prevent vendor edit booking start date and end date | |
*/ | |
function wcv_prevent_vendor_edit_booking_start_date_and_end_date() { | |
$pagename = get_query_var( 'pagename' ); | |
$object = get_query_var( 'object' ); | |
$action = get_query_var( 'action' ); | |
if ( ! is_user_logged_in() ) { |
This file contains 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
// Add 16% VAT to vendor commission | |
add_filter( 'wcv_process_commission', 'my_wcv_commission_rate', 10, 5 ); | |
add_filter( 'wcv_commission_rate', 'my_wcv_commission_rate', 10, 5 ); | |
function my_wcv_commission_rate( $commission, $product_id, $product_price, $order, $qty ) { | |
$vat_fee = 0.16; | |
$marketplace_split = $product_price - $commission; | |
$vat = $marketplace_split * $vat_fee; | |
$commission -= $vat; |
NewerOlder