-
Deploy the app to heroku following heroku normal instructions (add link to heroku help)
-
Set heroku environment variables
Make sure all the options in
config.yml
are properly set then run:bundle exec rake heroku:config
This file contains hidden or 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 | |
// Limit checkout to a single vendor store | |
add_action( 'woocommerce_add_to_cart_validation', 'limit_single_vendor_to_cart', 10, 3 ); | |
function limit_single_vendor_to_cart( $valid, $product_id, $quantity ) { | |
$vendor_id = get_post_field( 'post_author', $product_id ); | |
// loop through the cart to check each vendor id | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { | |
$cart_product_id = $cart_item[ 'product_id' ]; |
This file contains hidden or 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
/** | |
* Register term fields | |
*/ | |
add_action( 'init', 'register_vendor_custom_fields' ); | |
function register_vendor_custom_fields() { | |
add_action( WC_PRODUCT_VENDORS_TAXONOMY . '_add_form_fields', 'add_vendor_custom_fields' ); | |
add_action( WC_PRODUCT_VENDORS_TAXONOMY . '_edit_form_fields', 'edit_vendor_custom_fields', 10 ); | |
add_action( 'edited_' . WC_PRODUCT_VENDORS_TAXONOMY, 'save_vendor_custom_fields' ); | |
add_action( 'created_' . WC_PRODUCT_VENDORS_TAXONOMY, 'save_vendor_custom_fields' ); | |
} |