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
<?php | |
// Elementor does not include woocommerce_before_main_content in their wc-product-archive widget | |
// WC Vendors users the woocommerce_before_main_content to hook into to display the vendor store headers | |
// The following snippet re-adds the required actions for WC Vendors | |
// @source - https://github.com/elementor/elementor/issues/5574 | |
// Add the woocommerce_before_main_content to the elementor wc-archive-products widget | |
add_action( 'elementor/widget/render_content', function( $content, $widget ) { |
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
<?php | |
add_filter( 'wcv_vendor_shipping_package_title', 'wcv_change_package_title', 10, 4 ); | |
function wcv_change_package_title( $title, $count, $package, $vendor_sold_by ){ | |
$vendor_sold_by = WCV_Vendors::get_vendor_sold_by( $package['vendor_id'] ); | |
$title = sprintf( __( 'Modes de livraison des articles ( %s )', 'wcvendors-pro' ), $vendor_sold_by ); | |
return $title; | |
} |
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
<?php | |
add_filter( 'woocommerce_my_account_my_orders_actions', 'remove_mark_received' ); | |
function remove_mark_received( $actions ){ | |
if (array_key_exists('wcv-mark-order-received', $actions ) ){ | |
unset($actions['wcv-mark-order-received']); | |
} | |
return $actions; | |
} |
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
<?php | |
/** | |
* The Template for displaying a vendor in the vendor list shortcode | |
* | |
* Override this template by copying it to yourtheme/wc-vendors/front | |
* | |
* @package WCVendors_Pro | |
* @since 1.2.3 | |
* @version 1.6.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
<?php | |
add_filter( 'woocommerce_cart_shipping_method_full_label', 'wcv_override_vendor_shipping_label', 10, 2 ); | |
function wcv_override_vendor_shipping_label( $label, $method ){ | |
$label = 'Livraison Standard'; | |
$has_cost = 0 < $method->cost; | |
$hide_cost = ! $has_cost && in_array( $method->get_method_id(), array( 'free_shipping', 'local_pickup' ), true ); | |
if ( $has_cost && ! $hide_cost ) { | |
if ( WC()->cart->display_prices_including_tax() ) { |
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
<?php | |
// disable add to cart with js | |
add_action( 'wp_footer', 'disable_somebutton_js' ); | |
function disable_somebutton_js(){ | |
// Bail if this isn't the single product page | |
if ( ! is_single() ) return; | |
global $product; |
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
<?php | |
public static function log( $data = '', $prefix = '' ) { | |
// phpcs:disable | |
$trace = debug_backtrace( false, 2 ); | |
$caller = ( isset( $trace[1]['class'] ) ) ? $trace[1]['class'] : basename( $trace[1]['file'] ); | |
if ( is_array( $data ) || is_object( $data ) ) { | |
if ( $prefix ) { | |
error_log( '===========================' ); |
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
<?php | |
// Add the property reference as a hidden field on the single product page. | |
add_action( 'wcv_quick_contact_after_subject', 'add_acf_fields' ); | |
function add_acf_fields(){ | |
global $post; | |
if ( is_single() ){ | |
$referencia = get_field ('referencia', $post->ID ); //reference is my ACF field | |
$tipo_de_anuncio = get_field ('tipo_de_anuncio', $post->ID ); //tipo_de_anuncio is my ACF field | |
WC_Vendors::log( $tipo_de_anuncio ); |
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
<?php | |
add_action( 'wcv_after_product_type', 'wcv_checkbox_check' ); | |
function wcv_checkbox_check( $object_id ){ | |
$value = get_post_meta( $object_id, 'wcv_custom_product_checkbox3', true ); | |
WCVendors_Pro_Form_Helper::input( array( | |
'id' => 'wcv_custom_product_checkbox3', | |
'label' => __( 'Personalisation', 'wcvendors-pro' ), | |
'type' => 'checkbox', | |
'desc_tip' => 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
<?php | |
add_filter( 'wcv_product_description_editor_settings', 'wcv_full_editor' ); | |
add_filter( 'wcv_product_short_description_editor_settings', 'wcv_full_editor' ); | |
function wcv_full_editor( $settings ){ | |
$settings['teeny'] = false; | |
return $settings; | |
} |