Skip to content

Instantly share code, notes, and snippets.

View mrky007's full-sized avatar

Marko Jezernik mrky007

View GitHub Profile
@kartikparmar
kartikparmar / aaptc_add_product_to_cart.php
Last active October 18, 2021 09:05
Adding product to cart on website visit
<?php
/*
* Automatically adding the product to the cart.
*/
function aaptc_add_product_to_cart() {
if ( ! is_admin() ) {
$product_id = 12986; // Product Id of the free product which will get added to cart
$found = false;
@flyingluscas
flyingluscas / InstallPopcornTime.md
Last active April 19, 2023 01:51
Installing Popcorn Time on Ubuntu 16.x

1. Downloading

32 bits version

$ wget https://get.popcorntime.sh/build/Popcorn-Time-0.3.10-Linux-32.tar.xz -O popcorntime.tar.xz

64 bits version

@neilgee
neilgee / woo-endpoint-custom.php
Last active November 22, 2022 13:34
WooCommerce Endpoint Order and Rename - My Account Page v2.6+
<?php
/*
Plugin Name: WooCustom My Account
Plugin URI: http://wpbeaches.com/
Description: WooCustom - add a custom area in my-account
Author: Neil Gee
Version: 1.0.0
Author URI: http://wpbeaches.com
License: GPL-2.0+
@anythinggraphic
anythinggraphic / gravity-forms-notification-popup-keep-form.php
Last active November 27, 2020 21:30
Gravity Forms Notification Popup (Genesis Framework)
<?php
//* OPTIONAL STEP - Keep the form disappearing.
//* Gravity Forms notification popup instead of the page redirect or AJAX notification.
//* Props to @WilliamAlexander in the comments
//* @link https://anythinggraphic.net/gravity-forms-notification-popup
add_filter( 'gform_confirmation', 'ag_custom_confirmation', 10, 4 );
function ag_custom_confirmation( $confirmation, $form, $entry, $ajax ) {
add_filter( 'wp_footer', 'ag_overlay');
// https://gist.github.com/3069522
;(function($, window, document, undefined) {
// Prepare our Variables
var History = window.History;
// Check to see if History.js is enabled for our Browser
if (!History.enabled) {
return false;
}
@MrDys
MrDys / gist:3512455
Created August 29, 2012 13:26
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@mikejolley
mikejolley / gist:1860056
Created February 18, 2012 16:27
WooCommerce - Override billing fields
add_filter( 'woocommerce_billing_fields', 'custom_woocommerce_billing_fields' );
function custom_woocommerce_billing_fields( $fields ) {
// Over-ride a single label
$fields['billing_first_name']['label'] = 'Your label';
// Over-ride a single required value
$fields['billing_first_name']['required'] = false;