Created
November 29, 2013 13:09
-
-
Save tjhole/7705499 to your computer and use it in GitHub Desktop.
WORDPRESS: Ultra Simple Paypal Cart Parse Shortcode
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 if( get_field('the_price') ) { | |
$price = get_field('the_price'); | |
echo '<div id="price">$' . $price . '</div>'; | |
} ?> | |
<?php if( get_field('the_colors') ) { | |
$colors = implode('|', get_field('the_colors')); | |
<?php $title = get_the_title(); ?> | |
<?php | |
if ( function_exists('print_wp_cart_button_for_product') && $price && $colors) { | |
echo apply_filters( 'the_content', '[wp_cart:' . $title . ':price:' . $price . ':var1[Color|' . $colors .']:end]' ); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment