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 | |
/** | |
* Custom Loop for Woocommerce Shop only show the products of the author of the store of WCVendors | |
* | |
* The Template for displaying product archives, including the main shop page which is a post type archive | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to |
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 | |
/** | |
* Show different archive-product.php if is a WC Vendor or is a Normal User | |
* Put this file in you folder theme or child theme in woocommerce folder | |
* | |
* The Template for displaying product archives, including the main shop page which is a post type archive | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you |
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 | |
/* Create a Shorcode for custom_ajax_add_to_cart_button to add a Woocommerce Subscription button add to cart to any place*/ | |
if (!function_exists('custom_ajax_add_to_cart_button') && class_exists('WooCommerce')) { | |
function custom_ajax_add_to_cart_button($atts) | |
{ | |
// Shortcode attributes | |
$atts = shortcode_atts(array( | |
'id' => '0', // Product ID | |
'qty' => '1', // Product quantity | |
'text' => '', // Text of the button |
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 | |
/** This filter function will add a custom tab to the Products Data metabox */ | |
function add_my_custom_product_data_tab($product_data_tabs) | |
{ | |
$product_data_tabs['marketplace'] = array( | |
'label' => __('Name of you custom tab', 'my_custom_text_domain'), | |
'target' => 'my_custom_product_data', | |
); | |
return $product_data_tabs; | |
} |
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 "Have one to sell?" Button on product pages */ | |
function wc_button_have_one_to_sell() | |
{ | |
if (has_term('marketplace', 'product_cat')) { | |
?> | |
<!-- Here your HTML --> | |
<div class="card" id="card-have-one-to-sell"> | |
<h4 class="card-heading"> | |
<i class="card-icon icon-cash-dollar"></i> |
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 | |
$urls = array( | |
'vendor-dashboard', | |
'vendor-dashboard/product', | |
'vendor-dashboard/order', | |
'vendor-dashboard/settings', | |
'vendor-dashboard/rating', | |
'vendor-dashboard/wcv_refund_request', | |
); |
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 | |
$url = $_SERVER["REQUEST_URI"]; | |
$iscategorymarketplace = strpos($url, 'marketplace'); | |
if ($iscategorymarketplace == true) { | |
//url contains 'marketplace' | |
wp_enqueue_style('marketplace_cat', get_stylesheet_directory_uri() . '/assets/css/marketplace-category.css', array(), '1.0', 'all'); | |
} | |
?> |
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 to Show or Hide a field */ | |
function wcv_show_custom_field_time_warranty() | |
{ | |
?> | |
<script> | |
jQuery(function ($) { | |
if ($('#wcv_custom_product_warranty').val() == 'No') { //'.val()' | |
$("#wcv_custom_product_time_warranty").hide(); | |
$("label[for='wcv_custom_product_time_warranty']").hide(); |
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 | |
/*Create a new tab in the single product page for the clients view the information*/ | |
function woo_new_product_tab($tabs) | |
{ | |
// Adds the new tab | |
$tabs['aditional_information'] = array( | |
'title' => __('Aditional Information', 'woocommerce'), | |
'priority' => 10, | |
'callback' => 'HERE YOUR FUNCTION TO ADD THE DATA FIELDS', | |
); |
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 enqueue_scripts_and_styles(){ | |
//Enqueue custom styles and scripts in various especific URL in WordPress Theme | |
$urls = array( | |
'dashboard', | |
'dashboard/product', | |
'dashboard/order', | |
'dashboard/settings', | |
'dashboard/rating', | |
'dashboard/refund_request', |
OlderNewer