@plan
Blade Directive For Laravel Spark
Works with user & team billing
Add this to the boot()
method of your AppServiceProvider
\Blade::directive('plan', function($plans) {
$model = auth()->user();
<?php | |
/** | |
* Remove the woocommerce_template_loop_product_link_open() function from the | |
* WooCommerce "woocommerce_before_shop_loop_item" action. | |
* | |
* @see remove_action() | |
*/ | |
add_action( 'wp_head', 'mycode_remove_woocommerce_template_loop_product_link_open' ); | |
function mycode_remove_woocommerce_template_loop_product_link_open() { |
<?php | |
/** | |
* Import a product's image during a Product Set import/update instead | |
* of after the product is imported. | |
* | |
* Use with CAUTION. This may cause product imports to be drastically slower or fail. | |
* | |
* @see do_action_ref_array(), get_post() | |
* |
<?php | |
/** | |
* Remove Comparison Sets from WooCommerce Product pages. | |
* | |
* @see remove_action(), dfrcs_wc_compset_priority() | |
*/ | |
add_action( 'wp_head', 'mycode_remove_compset_from_woocommerce_product_pages' ); | |
function mycode_remove_compset_from_woocommerce_product_pages() { | |
remove_action( 'woocommerce_after_single_product_summary', 'dfrcs_wc_single_product_page_compset', 0 ); |
<?php | |
/** | |
* Forces the insertion of your affiliate ID into the affiliate link even | |
* if the Datafeedr API plugin has been deactivated or uninstalled. | |
* | |
* This should be added to your My Custom Code plugin. | |
* @link https://datafeedrapi.helpscoutdocs.com/article/32-creating-your-own-custom-plugin | |
* | |
* @see mycode_dfrapi_url() |
<?php | |
/** | |
* Prevent the price of a product from being overridden during a Product Set update. | |
* | |
* This code will allow the product's price to be imported when the product is first imported but | |
* upon all subsequent Product Set updates, the product's price will not be updated. Instead it will | |
* rely on the price already in the database. | |
* | |
* @param array $meta An array containing postmeta data for this $post. |
<?php | |
/** | |
* Plugin Name: GearGrabber | |
* Plugin URI: https://www.geargrabber.net/ | |
* Description: Custom code for https://www.geargrabber.net/ | |
* Text Domain: geargrabber | |
* Domain Path: /languages | |
* Version: 1.0.12 | |
* | |
* @package geargrabber |
<?php | |
/** | |
* Returns the affiliate URL with inserted affiliate ID for any | |
* Datafeedr product imported by the Product Sets plugin and | |
* saved as a WooCommerce Product. | |
* | |
* Usage: $url = mycode_dfrapi_url( $product ); | |
* | |
* Returns an empty string if no Datafeedr product exists. |
<?php | |
/** | |
* Add merchant logo (if it exists) to the Loop between product thumbnail and product name. | |
*/ | |
add_action( 'woocommerce_before_shop_loop_item_title', 'mycode_add_merchant_logo_to_loop', 20 ); | |
function mycode_add_merchant_logo_to_loop() { | |
global $product; | |
if ( dfrpswc_is_dfrpswc_product( $product->get_id() ) ) { | |
$postmeta = get_post_meta( $product->get_id(), '_dfrps_product', true ); |
@plan
Blade Directive For Laravel SparkWorks with user & team billing
Add this to the boot()
method of your AppServiceProvider
\Blade::directive('plan', function($plans) {
$model = auth()->user();