Skip to content

Instantly share code, notes, and snippets.

@FSahinn
Last active December 3, 2015 18:45
Show Gist options
  • Save FSahinn/c152c57ceb2ccda79f6e to your computer and use it in GitHub Desktop.
Save FSahinn/c152c57ceb2ccda79f6e to your computer and use it in GitHub Desktop.
Easy digital download için gerekli kısa kodlar
<?php echo edd_get_cart_quantity(); ?> // Sepetekki ürün sayısı
<?php echo edd_get_cart_total(); ?> // Sepetteki toplam fiyat
<?php echo edd_get_checkout_uri(); ?> // Sepete yönlendiren kod
<?php edd_price($post->ID); ?> // Ürünün fiyatı
Functions.php'ye eklenecek kodlar
// Download uzantısını kendi uzantınız ile değiştirmek
define('EDD_SLUG', 'uzantiadi');
// Para Uzantısını TL'ye Çevirme ( Türk Lirasını seçtiğiniz TRY olarak görünüyor onu TL olarak çeviriyoruz )
function pippin_extra_edd_currencies( $currencies ) {
$currencies['TL'] = __('Türk Lirası', 'vekod');
return $currencies;
}
add_filter('edd_currencies', 'pippin_extra_edd_currencies');
// Single sayfasında yorumu çalıştırabilmek için gerekli olan kod
function modify_edd_product_supports($supports) {
$supports[] = 'comments';
return $supports;
}
add_filter('edd_download_supports', 'modify_edd_product_supports');
// Checkout sayfasındaki kullanım şartlarını sayfaya yönlendirme kodu
function sumobi_edd_terms_agreement() {
global $edd_options;
if ( isset( $edd_options['show_agree_to_terms'] ) ) : ?>
<fieldset id="edd_terms_agreement">
<label for="edd_agree_to_terms">
<?php
$page_id = 32; // change this to the ID of your terms page
echo '<a target="_blank" href="' . get_permalink( $page_id ) . '">Kullanım Şartları</a>';
?>
</label>
<input name="edd_agree_to_terms" class="required" type="checkbox" id="edd_agree_to_terms" value="1" />
</fieldset>
<?php endif;
}
remove_action( 'edd_purchase_form_before_submit', 'edd_terms_agreement' );
add_action( 'edd_purchase_form_before_submit', 'sumobi_edd_terms_agreement' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment