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
@tanmay27vats
tanmay27vats / function.php
Created July 18, 2017 06:01
Get product's default variation ID, variation price or variation object without plugin.
function tv_find_matching_product_variation( $product, $attributes )
{
foreach( $attributes as $key => $value )
{
if( strpos( $key, 'attribute_' ) === 0 )
{
continue;
}
unset( $attributes[ $key ] );
@ronykader
ronykader / How to pass a parameter by CI redirect Function
Created March 2, 2017 11:13
When you want to pass a parameter by redirect function ( Codeigniter ) the you can follow this way
$hometeam = $this->input->post('home_team');
$awayteam = $this->input->post('away_team');
if( $hometeam == $awayteam ) :
$this->session->set_flashdata('FlsMsgCheckteam', $this->alert->danger('please selete proper home team and away team'));
$id = $this->uri->segment(3);
$leagueid = $this->uri->segment(4);
redirect(base_url()."football/update_matchform/".$id.'/'.$leagueid);
endif;
@corsonr
corsonr / functions.php
Created September 28, 2016 08:33
Display WooCommerce product variations dropdown select on the shop page
<?php
// Display variations dropdowns on shop page for variable products
add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' );
function woo_display_variation_dropdown_on_shop_page() {
global $product;
if( $product->is_type( 'variable' )) {