This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_add_order_item_meta', 'add_esn_fields'); | |
public function add_esn_fields( $item_id, $values, $cart_item_key ) { | |
if($values['attached_id']){ | |
$x = 1; | |
while($x <= $values['quantity']) { | |
wc_add_order_item_meta( $item_id, 'esn', '', false ); | |
$x++; | |
} | |
}else if($values['type'] == 'wholesaler') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_add_order_item_meta', array( &$this, 'add_esn_fields'), 10, 3 ); | |
public function add_esn_fields( $item_id, $values, $cart_item_key ) { | |
if($values['attached_id']){ | |
$x = 1; | |
while($x <= $values['quantity']) { | |
wc_add_order_item_meta( $item_id, 'esn', '', false ); | |
$x++; | |
} | |
}else if($values['type'] == 'wholesaler') { | |
$x = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mailer = WC()->mailer(); | |
$mails = $mailer->get_emails(); | |
if ( ! empty( $mails ) ) { | |
foreach ( $mails as $mail ) { | |
if ( $mail->id == 'wc_reminder_email' ) { | |
$mail->trigger(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_order_is_editable', 'processing_orders_editable', 10, 2 ); | |
function processing_orders_editable( $is_editable, $order ) { | |
if ( $order->get_status() == 'processing' ) { | |
$is_editable = true; | |
} | |
return $is_editable; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wc_get_template','wholesaler_template'), 10, 5); | |
add_filter( 'wc_get_template_part', 'wholesaler_template_parts'), 10, 3); | |
public function wholesaler_template($located, $template_name, $args, $template_path, $default_path) { | |
global $woocommerce; | |
$newpath = plugin_dir_path( __FILE__ ) . '/woocommerce/' . $template_name; | |
return file_exists( $newpath ) ? $newpath : $located; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../chart-js/chart-js.html"> | |
<link rel="import" href="../cool-clock/cool-clock.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function oauth_url() | |
{ | |
$callback = URL::to('oauth/callback'); | |
$url = SentinelSocial::getAuthorizationUrl('basecamp', $callback); | |
return Redirect::to($url . '&type=web_server'); | |
} | |
protected function oauth_callback() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php use League\OAuth2\Client\Entity\User; | |
// Basecamp Oauth | |
class Basecamp extends League\OAuth2\Client\Provider\AbstractProvider { | |
// Response type | |
public $responseType = 'json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add an extra key + value | |
add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment'); | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
global $woocommerce; | |
ob_start(); | |
?> | |
<div class="total"> <?php echo $woocommerce->cart->get_cart_total(); ?> </div> | |
<?php | |
$fragments['total'] = ob_get_clean(); | |
return $fragments; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Soundboard - Android App!https://play.google.com/store/apps/details?id=asalkey.soundboard&hl=en | |
Space Cat - HTML5 game!http://asalkey.github.io/spacecat/ |
NewerOlder