Skip to content

Instantly share code, notes, and snippets.

View zakirsajib's full-sized avatar
💭
Looking for a new challenge in 2022!

Zakir Sajib zakirsajib

💭
Looking for a new challenge in 2022!
View GitHub Profile
@zakirsajib
zakirsajib / gist:6675b3bb3c702e5f040aff3b5fa3da23
Created June 24, 2020 13:24
Multi Vendor Theme for WooCommerce
https://yithemes.com/themes/plugins/yith-woocommerce-multi-vendor/
Check their admin dashboard.
http://demo.wpthemego.com/themes/sw_shopymall/
https://preview.themeforest.net/item/electro-electronics-store-woocommerce-theme/full_screen_preview/15720624?_ga=2.233221533.228043824.1593003774-282314435.1593003038
@zakirsajib
zakirsajib / gist:55f1dd18d6fe0147806f2b1e78e35b9d
Last active June 23, 2020 04:11
Imagine a scenario where the application you have built is regularly causing MySQL CPU usage to spike to 100% and memory exhaustion in production. Describe what you would do to isolate the cause of the problem and fix it.
# Imagine a scenario where the application you have built is regularly causing MySQL CPU
usage to spike to 100% and memory exhaustion in production. Describe what you would
do to isolate the cause of the problem and fix it.
# Answer
## Isolate the cause of the problem
## Fix
@zakirsajib
zakirsajib / gist:10cce8ab73c8de2dcb31be3e78cadec8
Created June 22, 2020 07:45
Write a custom MySQL query to return the title and featured image url for the best selling products in a WooCommerce website for the past 30 days.
# Write a custom MySQL query to return the title and featured image url for the best selling
products in a WooCommerce website for the past 30 days.
@zakirsajib
zakirsajib / gist:fc549e5b1b2bde1d335d9b2d9e78a180
Last active June 21, 2020 08:12
Convert the following jQuery dependent javascript to Vanilla js.
# jQuery
$( '.post-type-archive-product #secondary' ).prepend( '<div class="close-drawer"></div>' );
# JavaScript
var drawer = document.createElement("div");
drawer.className="close-drawer"
document.querySelector('.post-type-archive-product #secondary').appendChild(drawer);
@zakirsajib
zakirsajib / functions.php
Last active June 20, 2020 15:29
Hide header/Footer in Cart page of Storefront theme
#Using Hooks or CSS
# Code must go to functions.php of Storefront theme or its child theme
function remove_header_from_cart(){
if( is_cart() ):?>
<style>
header,
footer{
display: none;
}
@zakirsajib
zakirsajib / gist:79351c53918794c0728c5ec2bd79f633
Created June 20, 2020 13:52
Hide the tag description in mobile
# Using CSS
@media screen and (max-width: 767px){
.site-branding p{
display: none;
}
}
@zakirsajib
zakirsajib / gist:a01a74fde85e0c136f22f124d357b1bb
Created June 20, 2020 13:50
Change Dark Blue background color
# Using CSS
.shoptimizer-primary-navigation {
background-color: darkblue;
}
@zakirsajib
zakirsajib / gist:fd6b68384c33e8c374a882aa65be7b1a
Created June 20, 2020 13:49
Hide Sale text in WooCommerce
# There are two ways we can hide Sale text
# Using CSS
.content-area .summary .onsale{
display: none;
}
# Using remove action
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
@zakirsajib
zakirsajib / gist:f6c8c07625ef78a7b454fab03d868b6e
Last active June 20, 2020 15:59
Change the add to cart button color to white with 2 pixels green border
# Using CSS
.product .cart .single_add_to_cart_button{
border: 2px solid #3bb54a;
background-color: #fff;
}
@zakirsajib
zakirsajib / gist:bb48cacb8ebef3f8447d3a5660590be5
Created June 20, 2020 13:41
Make the PDP descriptions tab content fill the standard container width
# We can do it using CSS
#page .woocommerce-tabs .panel{
width: 100%;
}