Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Created August 1, 2019 08:36
Show Gist options
  • Select an option

  • Save hedqvist/9eb43e7f7b75de273ff9f3724b989e59 to your computer and use it in GitHub Desktop.

Select an option

Save hedqvist/9eb43e7f7b75de273ff9f3724b989e59 to your computer and use it in GitHub Desktop.
Custom logic to check for offer - YITH Request a quote
<?php
/**
* @snippet WooCommerce - Custom Logic for YITH Request a Quote
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.6.2
*/
function redlight_fortnox_ywraq( $is_offer, $order_id ) {
$order = new WC_Order($order_id);
if( 'yes' === $order->get_meta('ywraq_raq',true) ){
$is_offer = true;
}
return $is_offer;
}
add_filter('obj_fortnox_is_offer', 'redlight_fortnox_ywraq', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment