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 | |
// this goes in your theme functions.php file | |
function my_custom_product_response( $response, $product ) { | |
// early exit if user is not in the POS | |
if( ! is_pos() ) { | |
return $response; | |
} |
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 | |
// this goes in your functions.php file | |
function my_custom_pre_get_posts( $query ) { | |
// early exit if user is not in the POS | |
if( ! is_pos() ) { | |
return; | |
} |
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 | |
// the code below goes in your theme's functions.php file | |
function my_custom_pos_template_redirect() { | |
// a manual map of Store IDs => array of User IDs | |
$restrict = array( | |
1524 => array( 52, 863 ), // ie: Store ID 1524 restricted to User IDs 52 and 863 | |
6252 => array( 863 ) // ie: Store ID 6252 restricted to User ID 863 |
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 | |
// the code below goes in your functions file | |
function my_custom_pos_template_redirect(){ | |
if ( isset( $_SESSION['wcj-currency'] ) ) { | |
$_SESSION['wcj-currency'] = 'USD'; // force session variable to correct currency | |
// unset( $_SESSION['wcj-currency'] ); // or - unset the variable altogether | |
} | |
} |
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 the code below to your functions.php file | |
function my_custom_insert_shop_order_object( $order ) { | |
if( function_exists('wc_cog') ) { | |
$WC_COG = wc_cog(); | |
$WC_COG->set_order_cost_meta( $order->get_id() ); | |
} | |
} |
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 | |
// the code below goes in your functions.php file | |
function my_custom_prepare_shop_order_object( $response, $order, $request ) { | |
if( !is_pos() ) { | |
return $response; // early exit if not POS request | |
} | |
$data = $response->get_data(); |
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 | |
// the code below goes in your functions.php file | |
function my_custom_prepare_shop_order_object($response, $order, $request) { | |
if( is_pos() ) { | |
$data = $response->get_data(); | |
$data['regular_price'] = get_post_meta( $data['id'], 'wholesale_customer_wholesale_price', true ); | |
$response->set_data($data); | |
} |
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 | |
// the code below goes in your functions.php file | |
function my_custom_prepare_shop_order_object($response, $order, $request) { | |
$data = $response->get_data(); | |
if( function_exists('wc_seq_order_number_pro') ) { | |
$data['number'] = wc_seq_order_number_pro()->find_order_by_order_number( $data['id'] ); | |
} | |
$response->set_data($data); |
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 | |
// the code below goes in your functions.php file | |
function my_custom_pos_templates($templates){ | |
if(isset($templates['pos']['checkout']['gateways']['stripe'])) { | |
$templates['pos']['checkout']['gateways']['stripe'] = str_replace('type="tel"','',$templates['pos']['checkout']['gateways']['stripe']); | |
} | |
return $templates; | |
} |
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 | |
// this goes in your theme functions.php file | |
function my_custom_pos_css() { | |
echo '<style>body, h1, h2, h3, h4, h5 { font-family: IRANSans !important }</style>'; | |
} | |
add_action( 'woocommerce_pos_head', 'my_custom_pos_css' ); |