Skip to content

Instantly share code, notes, and snippets.

View hakikz's full-sized avatar
💭
Github stars make me happy than $ and inspire me to do more for web community :)

Hakik Zaman hakikz

💭
Github stars make me happy than $ and inspire me to do more for web community :)
View GitHub Profile
@hakikz
hakikz / Botiga_theme_&_YITH_quick_view_classes.md
Last active November 5, 2023 17:42
Variation Price Display

Add the following wrapper in Product Wrapper field

Botiga Theme Quick View

.botiga-quick-view-popup-content-ajax

YITH Quick View Plugin

.yith-wcqv-wrapper
@hakikz
hakikz / Maginific Popup with Variation.md
Last active March 15, 2024 06:48
Snippets for PVT 1.4.0 Series

Display an additional column to display variation name and make it clickable for popup variation image

*Steps:

  • Add the following code using Code Snippets plugin.
  • Please enable Run Snippet Everywhere from code snippets code editor (bottom part)
  • Go to Variation Table settings and Reset Columns by click the red icon beside Select Columns to Show in the Variation Table
  • Uncheck Thumbnail & Attributes column. Then drag the Variation column at the top
add_filter('pvtfw_default_columns', function($default){
@hakikz
hakikz / class_pvtfw_common.php
Created March 3, 2022 15:43
PVT Support for Second Image using Additional Variation Images Gallery
<?php
require_once( plugin_dir_path( __DIR__ ) . 'product-variant-table-for-woocommerce.php');
class PVTFW_COMMON{
/**
*
* On install selected columns
*
@hakikz
hakikz / .htaccess
Created January 2, 2022 07:41
Protect file from direct access but get it using API call
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC]
RewriteRule \.(zip|php)$ - [F]
@hakikz
hakikz / wvg-thumbnail-serial.php
Last active December 28, 2021 11:41
Serialize Gallery Thumbnail for Additional Variation Images Gallery for WooCommerce
if ( class_exists( 'Woo_Variation_Gallery' ) ):
function wvg_serialize_support(){
$columns = absint( get_option( 'woo_variation_gallery_thumbnails_columns', apply_filters( 'woo_variation_gallery_default_thumbnails_columns', 4 ) ) );
$thumbnail_js_options = array(
'slidesToShow' => $columns,
'slidesToScroll' => $columns,
'focusOnSelect' => true,
// 'dots'=>true,
'arrows' => wc_string_to_bool( get_option( 'woo_variation_gallery_thumbnail_arrow', 'yes' ) ),
ed.addButton('button_green', {
title: 'Add span',
image: '../wp-includes/images/smilies/icon_mrgreen.gif',
cmd: 'button_green_cmd'
});
ed.addCommand('button_green_cmd', function () {
var data = {
title: 'Default Title',
limit: 10
}
@hakikz
hakikz / add_to_cart_align.css
Last active May 1, 2021 02:32
Porto Theme [Link on Image Template] Swatch Position Support
ul.products li.product-awq_onimage .add-links {
right: 0 !important;
}
<?php
echo apply_filters(
'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
sprintf(
'<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s" %s>%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
esc_attr( $product->get_id() ),
esc_attr( $product->get_sku() ),
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
<?php
function wvs_noo_mebla_theme_support() {
remove_action( 'woocommerce_after_shop_loop_item', 'wvs_pro_archive_variation_template', 30 );
add_action( 'woocommerce_after_shop_loop_item_title2', 'wvs_pro_archive_variation_template', 10 );
add_action( 'woocommerce_after_shop_loop_item_title', 'wvs_pro_archive_variation_template', 10 );
add_action( 'woocommerce_after_shop_loop_item_title2', 'woocommerce_template_loop_add_to_cart', 11 );
// remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
}
@hakikz
hakikz / BSCarouselForWP.php
Created March 23, 2021 19:21
BS Carousel For WP with ACF
<!-- Carousel -->
<div id="carouselHero" class="carousel slide carousel-fade" data-ride="carousel" data-pause="false">
<?php if( have_rows('carousel') ): $id = 0 ?>
<div class="carousel-inner">
<?php while( have_rows('carousel') ): the_row(); $id++ ?>
<div class="carousel-item <?php if($id == 1): echo "active"; endif; ?>">
<div class="content-wrap">
<?php
$logo = get_sub_field('logo');
$title = get_sub_field('title');