Set and get cookies without refreshing page.
setcookie('cookie_id', $cookie_value, time() + (86400 * 13)); $_COOKIE['cookie_id'] = $cookie_value;
setcookie('cookie_id', $cookie_value, time() + (86400 * 13)); $_COOKIE['cookie_id'] = $cookie_value;
Adding cross icon insteade of remove text function filter_woocommerce_cart_totals_coupon_html( $coupon_html, $coupon, $discount_amount_html ) { // Change text $coupon_html = ' <a href="' . esc_url( add_query_arg( 'remove_coupon', rawurlencode( $coupon->get_code() ), defined(…
Adding coupon removing icon to coupon label function filter_woocommerce_cart_totals_coupon_label( $label, $coupon ) { $label .= ' <a href="' . esc_url( add_query_arg( 'remove_coupon', rawurlencode( $coupon->get_code() ), defined( 'WOOCOMMERCE_CHECKOUT' ) ? wc_get_checkout_url() :…
We can easily add our custom script in woocomerce checkout page by adding the following fuction in function.php of active theme folder function add_checkout_script() { ?> <script type="text/javascript"> jQuery(document).on( "updated_checkout",…
For example we are going to implement add to cart button in product loop Step 1: At first we have to enable ajax in woocommerce dashboard then create add to…
Creating function for tracking ip in function.php /* get user locations */ function ip_info($ip = NULL, $purpose = "location", $deep_detect = TRUE) { $output = NULL; if (filter_var($ip, FILTER_VALIDATE_IP) ===…
We need to add bellow urls in Excluded JavaScript files block in Delay Javascript execution /jquery-latest.min.js /jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js /jquery-migrate(.min)?.js /wp-content/plugins/ultimate-carousel-for-visual-composer/js/custom-tm.js /wp-content/plugins/ultimate-carousel-for-visual-composer/js/slick.js /woocommerce/(.*)/assets/js/zoom/jquery.zoom.min.js /woocommerce/(.*)/assets/js/photoswipe/ /woocommerce/(.*)/assets/js/flexslider/jquery.flexslider.min.js /woocommerce/(.*)/assets/js/frontend/single-product.min.js wc_single_product_params
I simply added a class called "home" in landing page then just check this class as if (document.querySelector('.home') !== null) { // the conditions comes here }
// API to mailchimp ######################################################## $list_id = '7c5f7ad979'; $authToken = 'affe8d215db0b33e1fb22de12c565e17-us6'; // The data to send to the API $postData = array( "email_address" => $discountEmail, "status" => "subscribed" ); //…
It's very easy to send email in Wordpress $to = $discountEmail; $subject = "Your Subject"; $headers = array('Content-Type: text/html; charset=UTF-8'); $message = file_get_contents(get_template_directory().'/example.html', true); $attachments = "Attach"; wp_mail( $to, $subject,…