Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Register menus
- register_nav_menus(
- array(
- 'main-menu' => 'Main Menu',
- )
- );
- register_nav_menus(
- array(
- 'extended-menu' => 'Extended Menu',
- )
- );
- // Support Featured Images
- add_theme_support( 'post-thumbnails' );
- // additional image sizes
- add_image_size( 'blog-thumb', 500, 500, true );
- //Add WooCommerce
- function mytheme_add_woocommerce_support() {
- add_theme_support( 'woocommerce' );
- add_theme_support( 'wc-product-gallery-zoom' );
- add_theme_support( 'wc-product-gallery-lightbox' );
- add_theme_support( 'wc-product-gallery-slider' );
- }
- add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
- //Show cart contents / total Ajax
- add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );
- function woocommerce_header_add_to_cart_fragment( $fragments ) {
- global $woocommerce;
- ob_start();
- ?>
- <a class="cart-customlocation" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?></a>
- <?php
- $fragments['a.cart-customlocation'] = ob_get_clean();
- return $fragments;
- }
- /* Add kode unik to WC Cart */
- //function woo_add_cart_fee() { global $woocommerce; $woocommerce->cart->add_fee( __('Kode unik', 'woocommerce'), rand(1,49) ); } add_action( 'woocommerce_before_calculate_totals', 'woo_add_cart_fee' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement