@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 | |
/** | |
* Change product type from 'external' to 'simple'. | |
*/ | |
function mycode_change_postmeta_product_type( $meta, $post, $product, $set, $action ) { | |
$meta['_product_type'] = 'simple'; | |
return $meta; | |
} |
<?php | |
/** | |
* Adds the brand name to the 'product_brand' taxonomy. | |
* | |
* This will import the brands into the 'product_brand' taxonomy when using | |
* the WooCommerce Brands plugin. | |
* | |
* @link http://www.woothemes.com/products/brands/ | |
* |
@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();
Open the Terminal app on Mac.
Change directories so that you are in your user's .ssh
directory. For example, my user directory is named "Eric" so I would type the following into Terminal:
cd /Users/Eric/.ssh
Now you need to generate your SSH key pairs. Enter the following command into Terminal (source 1, source 2):
ssh-keygen -t rsa -b 4096 -C "[email protected]"
<?php | |
/** | |
* Rewrites the price for an WooCommerce product if it contains a Comparison Set setting the | |
* highest price found in the Comparison Set to the "Regular" price of the product and setting | |
* the lowest sale price found in the Comparison Set to the "Sale" price of the product. | |
* | |
* This only works for a product which already has a Comparison Set. It does not | |
* work if the product has never had a Comparison Set created for it. | |
* |
<?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 | |
/** | |
* Set newly imported products' post_status field to 'draft' instead | |
* of to 'publish'. Only applies to products being imported for the first | |
* time, not to already imported products. | |
* | |
* @param array $post Array containing Post information. | |
* @param array $product Array containing Datafeedr Product information. | |
* @param array $set Array containing Product Set information. |
<?php | |
/** | |
* Add support for webp to WordPress. | |
* | |
* @param array $mime_types | |
* | |
* @return array Updated $mime_types array. | |
*/ | |
add_filter( 'mime_types', 'mycode_mime_types', 20 ); |
<?php | |
/** | |
* Add the product's gender as a gender attribute for this product. | |
* | |
* The attribute "Gender" with a slug of "gender" | |
* must already exist here: | |
* WordPress Admin Area > Products > Attributes. | |
* | |
* @param array|string $value The current value of the $attribute for this $post. |