Skip to content

Instantly share code, notes, and snippets.

View praveencs87's full-sized avatar
🏠
Working from home

Praveen praveencs87

🏠
Working from home
View GitHub Profile
@praveencs87
praveencs87 / Install php 7.4 version in ubuntu 22
Created May 30, 2023 08:29
Install php 7.4 version in ubuntu 22
6
It is the issue of the result of 22.10 not being released yet ppa:ondrej/php repository. It will fix it by ppa:ondrej/php, but I have found a solution for this,i don't think it is the best solution,
nano /etc/apt/sources.list.d/ondrej-ubuntu-php-kinetic.list
then add this line and save it
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
#deb-src https://ppa.launchpadcontent.net/ondrej/php/ubuntu/kinetic main
/**
* Code goes in functions.php or a custom plugin.
*/
add_action( 'woocommerce_email', 'unhook_woocommerce_emails' );
function unhook_woocommerce_emails( $email_class ) {
/**
@praveencs87
praveencs87 / Useful tools for digital marketing
Last active January 24, 2023 13:25
Useful tools for Digital marketing:
1- Google Analytics - To track website traffic activity
2- Google Keyword Planner - For keyword research
3- Google Search Console - To check indexing status and optimize visibility
4- Google Trends - To analyze the popularity of a search term
5- UberSuggest Basic Account - For domain overview and content ideas
6- Screaming Frog SEO spider - For website audit
7- SEOreviewtools - To extract backlinks
8- Website Auditor - For website audit
9- Monitor Backlinks - To monitor backlinks & keywords
10- Answer The Public - For visual keyword research
@praveencs87
praveencs87 / .babelrc
Created December 12, 2022 06:52 — forked from andrewmunro/.babelrc
Sequelize cli with ES6
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
],
}
@praveencs87
praveencs87 / function.php
Created November 26, 2020 08:35
Hide Shipping Section in checkout page when local pickup is selected - woocommerce | webinwordpress.com
<?php
add_action( 'woocommerce_after_checkout_form', 'webinwp_hide_shipping' );
// Disable Shipping form section in Checkout page
function webinwp_hide_shipping( $available_gateways ) {
// NB: "#customer_details .col-2" based on your theme html attributes
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
<?php
// Code Description given in https://webinwordpress.com/uncategorized/how-to-create-and-apply-coupon-code-programmatically-in-woocoomerce/
//use code below to apply the coupon code $coupon_code
if (! WC()->cart->add_discount( sanitize_text_field( $coupon_code )))
WC()->show_messages();
?>
@praveencs87
praveencs87 / function.php
Created November 24, 2020 12:56
Create Couponcode Dynamically
<?php
// Code Description given in https://webinwordpress.com/uncategorized/how-to-create-and-apply-coupon-code-programmatically-in-woocoomerce/
$coupon_code = 'WEBINWORDPRESS.COM'; // Code - this can be a dynamic string like $UserRole.$order
$amount = '20'; // Amount
$discount_type = 'percent'; // Types are : fixed_cart, percent, fixed_product, percent_product
$coupon = array(
'post_title' => $coupon_code,
'post_content' => '',
@praveencs87
praveencs87 / .htaccess
Created November 19, 2020 17:28
hide server
<IfModule security2_module>
SecRuleEngine on
ServerTokens Full
SecServerSignature " "
</IfModule>
@praveencs87
praveencs87 / function.php
Created November 14, 2020 05:59
Customize woocommerce No product found Message - webinwordpress.com
<?php
//paste below code in function.php
add_action( 'woocommerce_no_products_found', function(){
remove_action( 'woocommerce_no_products_found', 'wc_no_products_found', 10 );
// HERE change your message below
$message = __( 'No products were found matching your selection.', 'woocommerce' );
echo '<p class="woocommerce-info">' . $message .'</p>';
}, 9 );
@praveencs87
praveencs87 / function.php
Created November 14, 2020 05:49
Yith Delivery Date Filed Label Change based on Shipping Method - webinwordpress.com
<?php
//Chnage based on Shipping
if(!function_exists( 'ywcdd_change_label_datefield' ) ) {
add_filter( 'ywcdd_change_datepicker_label', 'ywcdd_change_label_datefield', 10 );
function ywcdd_change_label_datefield() {
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
if(isset($chosen_methods)) {
$chosen_shipping = $chosen_methods[0];