Skip to content

Instantly share code, notes, and snippets.

@rvanweerd
Created June 16, 2015 10:11
Show Gist options
  • Save rvanweerd/8edada9245c9d2f940e0 to your computer and use it in GitHub Desktop.
Save rvanweerd/8edada9245c9d2f940e0 to your computer and use it in GitHub Desktop.
Exchange: add "buy now" and/or "add to cart" to store view
function buy_now_in_store() {
echo "</br>Example 1: add to cart and buy now: <br />";
it_exchange('product', 'purchase-options', array('add-to-cart-edit-quantity' => false, 'buy-now-edit-quantity' => false));
echo "<br /><hr><br />";
echo "Example 2: add to cart and buy now and edit quantities: <br />";
it_exchange('product', 'purchase-options', array('add-to-cart-edit-quantity' => true, 'buy-now-edit-quantity' => true));
echo "<br /><hr><br />";
echo "Example 3: add to cart: <br />";
it_exchange('product', 'purchase-options', array('add-to-cart-edit-quantity' => false));
echo "<br /><hr><br />";
echo "Example 4: buy now: <br />";
it_exchange('product', 'purchase-options', array( 'buy-now-edit-quantity' => true));
echo "<br /><hr><br />";
}
add_filter('it_exchange_content_store_after_product_info_loop', 'buy_now_in_store');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment