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
| add_action( 'woocommerce_review_order_before_submit', 'bt_add_checkout_checkbox', 10 ); | |
| /** | |
| * Add WooCommerce additional Checkbox checkout field | |
| */ | |
| function bt_add_checkout_checkbox() { | |
| woocommerce_form_field( 'checkout_checkbox', array( // CSS ID | |
| 'type' => 'checkbox', | |
| 'class' => array('form-row mycheckbox'), // CSS Class |
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
| function initMap() { | |
| const map = new google.maps.Map(document.getElementById("map"), { | |
| zoom: 10, | |
| center: { lat: 51.3055106, lng: 0.3105068 }, | |
| }); | |
| setMarkers(map,locations); | |
| } | |
| function setMarkers(map,locations){ | |
| var marker, i | |
| var infowindow = new google.maps.InfoWindow(); |
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
| $args = array( | |
| 'post_type' => 'product', | |
| 'posts_per_page' => 12, | |
| 'order' => 'desc', | |
| 'orderby' => 'date', | |
| 'paged' => (get_query_var('paged') ? get_query_var('paged') : 1) | |
| ); | |
| $post_query = new WP_Query($args); | |
| if($post_query->have_posts() ) { |
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
| // Creating the widget | |
| class spacer_widget extends WP_Widget { | |
| function __construct() { | |
| parent::__construct('spacer_widget', __('Spacer', 'spacer_widget_domain'), array( 'description' => __( 'Spacer widget', 'spacer_widget_domain' ))); | |
| } | |
| public function widget( $args, $instance ) { | |
| $space_px = apply_filters( 'space_px', $instance['space_px'] ); | |
| echo $args['before_widget']; |
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
| // Disable Google Fonts in Elementor | |
| add_filter( 'elementor/frontend/print_google_fonts', '__return_false' ); |
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
| add_action( 'admin_bar_menu', 'remove_wp_nodes', 999 ); | |
| function remove_wp_nodes() | |
| { | |
| global $user_ID; | |
| global $wp_admin_bar; | |
| if ( current_user_can( 'editor' ) ) { | |
| $wp_admin_bar->remove_menu('wp-logo'); | |
| $wp_admin_bar->remove_menu('comments'); |
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
| sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs | |
| sudo find /opt/bitnami/apps/wordpress/htdocs -type d -exec chmod 775 {} \; | |
| sudo find /opt/bitnami/apps/wordpress/htdocs -type f -exec chmod 664 {} \; |
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
| add_action( 'woocommerce_check_cart_items', 'mandatory_coupon_for_specific_items' ); | |
| function mandatory_coupon_for_specific_items() { | |
| $targeted_ids = array(37); // The targeted product ids (in this array) | |
| $coupon_code = 'summer2'; // The required coupon code | |
| $coupon_applied = in_array( strtolower($coupon_code), WC()->cart->get_applied_coupons() ); | |
| // Loop through cart items | |
| foreach(WC()->cart->get_cart() as $cart_item ) { | |
| // Check cart item for defined product Ids and applied coupon |
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
| <form class=" woocommerce-cart-form"> | |
| ... | |
| <input type="hidden" id="cart_extra_option" name="cart_extra_option" value="value" > | |
| <input type="hidden" id="cart_total_price" name="cart_total_price" value="value"> | |
| ... | |
| </form> |
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 ( is_active_sidebar( 'sidebar-1' ) ) : ?> | |
| <div id="secondary" class="widget-area" role="complementary"> | |
| <?php dynamic_sidebar( 'sidebar-1' ); ?> | |
| </div> | |
| <?php endif; ?> |