Created
November 29, 2013 14:09
-
-
Save tjhole/7706212 to your computer and use it in GitHub Desktop.
ACF: Shipping Repeter to Ultra Simple WP Cart
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 $price = get_field('price'); | |
$title = get_the_title(); | |
$shipping_row = get_field('shipping_costs'); | |
$shipping_total = count($shipping_row); | |
$i = 0; | |
foreach($shipping_row as $ship){ | |
$i++; | |
$shipping_output.= $ship['area'] . ',' . $ship['cost']; | |
if ($i!=$shipping_total) {$shipping_output.= "|";} | |
}; | |
echo apply_filters( 'the_content', '[wp_cart:' . $title . ':price:' . $price . ':shipping:[Shipping|' . $shipping_output .']:end]' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment