Skip to content

Instantly share code, notes, and snippets.

View qant's full-sized avatar
💫
Permanent study state

Anton qant

💫
Permanent study state
  • lusa realty, lusa legal, banisio
  • Испания
  • X @antseme
View GitHub Profile
@qant
qant / wc-rest-api-products-images.php
Created March 28, 2023 08:00 — forked from seb86/wc-rest-api-products-images.php
WooCommerce REST API (Products) - Get the images for a product or product variation and returns all image sizes.
<?php
if ( ! function_exists( 'wc_rest_get_product_images' ) ) {
add_filter( 'woocommerce_rest_prepare_product_object', 'wc_rest_get_product_images', 10, 2 );
/**
* Get the images for a product or product variation
* and returns all image sizes.
*
* @param WP_REST_Request $request Request object.
* @param WC_Product|WC_Product_Variation $product Product instance.
@qant
qant / 01_enhanced_ecommerce_plugin.js
Created July 5, 2023 18:39 — forked from OrenBochman/01_enhanced_ecommerce_plugin.js
Enhanced ecommerce snippets in universal analytics
//This command must occur after you create your tracker object and before you use any of the enhanced ecommerce specific functionality.
ga('require', 'ec');
@qant
qant / function.php
Created July 27, 2023 06:57 — forked from szelag-michal/function.php
Woocommerce Mini Cart
//Override woocommerce product categories widgets
add_action( 'widgets_init', 'floweb_override_woocommerce_widgets', 15 );
function floweb_override_woocommerce_widgets() {
// Ensure our parent class exists to avoid fatal error
if ( class_exists( 'WC_Widget_Cart' ) ) {
unregister_widget( 'WC_Widget_Cart' );
require get_template_directory() . '/functions/custom-widgets/floweb-class-wc-widget-cart.php';
register_widget( 'Floweb_WC_Widget_Cart' );
}
}