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('woocommerce_thankyou_order_received_text', 'woo_my_thankyou_order_received_text' ); | |
function woo_my_thankyou_order_received_text() { | |
return 'Спасибо. Ваш заказ был принят.</br>В ближайшее время с вами свяжется менеджер для подтверждения.'; | |
} |
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_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); | |
function woocommerce_template_single_excerpt() { | |
global $product; | |
$upsale_products = $product->get_upsell_ids(); | |
if ( !empty($upsale_products) ) { |
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('woocommerce_product_tabs','add_tabs'); | |
function add_tabs($tabs){ | |
$tabs[ 'payment_delivery' ] = array( | |
'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
import requests | |
import base64 | |
url = "https://wholeblogs.com/wp-json/wp/v2/posts/" | |
postID = '1' | |
user = "your-username" | |
password = "your-application-password" | |
credentials = user + ':' + password | |
token = base64.b64encode(credentials.encode()) |
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
import requests | |
import base64 | |
url = "https://wholeblogs.com/wp-json/wp/v2/posts/" | |
postID = '1' | |
user = "your-username" | |
password = "your-application-password" | |
credentials = user + ':' + password | |
token = base64.b64encode(credentials.encode()) |
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
import requests | |
import base64 | |
url = "https://wholeblogs.com/wp-json/wp/v2/posts" | |
user = "your-username" | |
password = "your-application-password" | |
credentials = user + ':' + password | |
token = base64.b64encode(credentials.encode()) | |
header = {'Authorization': 'Basic ' + token.decode('utf-8')} | |
post = { |
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
import requests | |
import json | |
import base64 | |
url = "https://example.com/wp-json/wp/v2/posts" | |
user = "your-username" | |
password = "your-application-password" | |
credentials = user + ':' + password | |
token = base64.b64encode(credentials.encode()) | |
header = {'Authorization': 'Basic ' + token.decode('utf-8')} |
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
/** | |
* Register the 'Custom Column' column in the importer. | |
* | |
* @param array $options | |
* @return array $options | |
*/ | |
add_filter( 'woocommerce_csv_product_import_mapping_options', 'add_column_to_importer' ); | |
function add_column_to_importer( $options ) { | |
// column slug => column name | |
$options['_price_types_1'] = 'Оптовая цена'; return $options; |
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
// Заменяем тег <H2> на <H3> у подкатегорий | |
remove_action( 'woocommerce_shop_loop_subcategory_title', 'woocommerce_template_loop_category_title', 10 ); | |
add_action( 'woocommerce_shop_loop_subcategory_title', 'custom_woocommerce_template_loop_category_title', 10 ); | |
function custom_woocommerce_template_loop_category_title( $category ) { | |
echo '<h3 class="woocommerce-loop-category__title">'; | |
echo esc_html( $category->name ); | |
if ( $category->count > 0 ) { | |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">(' . esc_html( $category->count ) . ')</mark>', $category ); | |
} |
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
// Скрыть категорию Uncategorized со страницы магазина | |
add_filter( 'get_terms', 'ts_get_subcategory_terms', 10, 3 ); | |
function ts_get_subcategory_terms( $terms, $taxonomies, $args ) { | |
$new_terms = array(); | |
if ( in_array( 'product_cat', $taxonomies ) && ! is_admin() &&is_shop() ) { | |
foreach( $terms as $key => $term ) { | |
if ( !in_array( $term->slug, array( 'uncategorized' ) ) ) { //ваш слаг категории | |
$new_terms[] = $term; | |
} | |
} |