Skip to content

Instantly share code, notes, and snippets.

@stalukder03
stalukder03 / gist:60214f8e17bc5a69d9333caed2894c5e
Created September 21, 2017 09:42 — forked from webaware/gist:6260468
WooCommerce purchase page add-to-cart with quantity and AJAX, without customising any templates. See blog post for details: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
<?php
/**
* start the customisation
*/
function custom_woo_before_shop_link() {
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2);
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop');
}
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link');
@stalukder03
stalukder03 / add-to-cart.php
Created September 21, 2017 09:09 — forked from Jplus2/add-to-cart.php
Add quantity button and ajax functionality to add to cart button on product archive page.
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
@stalukder03
stalukder03 / add-wordpress-settings-page.php
Created September 19, 2017 11:07 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@stalukder03
stalukder03 / Redux-required-arg-exampes.php
Created September 19, 2017 04:02 — forked from dovy/Redux-required-arg-exampes.php
Example of the required attribute for the Redux Framework.
<?php
$options = array(
'required' => array('id','equals',array( 1,3 ) ) // Multiple values
);
$options = array(
'required' => array('id','equals', array( 1 ) ) // Single value
);