Does Creatine Cause Water Retention? Myth vs Science

Posted

Today, creating a website is easier than ever. However, one important question remains before starting development — which CMS is the best for your business? The most popular options today are WordPress, Shopify, and custom development. Each platform has its own advantages and is suitable for different business needs. WordPress WordPress is one of the […]

How to Choose the Right Website Platform for Your Business

Posted

How to Choose the Right Website Platform for Your Business Choosing the right platform for your website is one of the most important decisions when starting an online business. The platform you choose will affect your website’s performance, scalability, and ability to grow in the future. There are many website platforms available today, but the […]

Website Speed and SEO: Why Page Speed Matters for Business

Posted

Quick Answer Website speed is one of the most important ranking factors for search engines. A slow website can reduce conversions, increase bounce rates, and negatively affect SEO performance. Fast websites not only rank better in Google but also create a better experience for visitors. Many websites built on platforms like WordPress or Shopify can […]

Custom Website vs Template Website: What Is Better for Business?

Posted

Quick Answer A template website is cheaper and faster to launch, while a custom website offers greater flexibility, scalability, and long-term value. Businesses that need a simple online presence often choose templates, while companies planning long-term growth usually invest in custom development. Platforms like WordPress or Shopify often use templates, while custom websites are frequently […]

WordPress vs Shopify: Which Platform Is Better for Business?

Posted

Quick Answer If you want full control, flexibility, and lower long-term costs, choose WordPress.If you want a simple, all-in-one ecommerce platform that is easy to launch quickly, choose Shopify. Both platforms are powerful, but they are built for different types of businesses. Understanding the Core Difference At first glance, WordPress and Shopify both allow you […]

Add function custom redirect on thanks page woocommerce

Posted

add_action(‘after_setup_theme’, ‘woocommerce_support’); function woocommerce_support() { add_theme_support(‘woocommerce’); } add_filter(‘woocommerce_cart_item_name’, ‘add_excerpt_in_cart_item_name’, 10, 3); function add_excerpt_in_cart_item_name($item_name, $cart_item, $cart_item_key) { $excerpt = wp_strip_all_tags(get_the_excerpt($cart_item[‘product_id’]), true); $style = ‘ style="font-size:14px; line-height:normal;"’; $excerpt_html = ‘ <p name="short-description" class="product-description"’ . $style . ‘>’ . $excerpt . ‘</p>’; return $item_name . $excerpt_html; } add_action( ‘woocommerce_get_return_url’, ‘trueroman_redirect_to_thank_you_2’, 90, 2 ); function truemisha_redirect_to_thank_you_2( $thank_you_url, $order ) […]

Update Cart Automatically on Quantity Change

Posted

add_action(‘wp_head’, function () { ?><style> .woocommerce button[name="update_cart"], .woocommerce input[name="update_cart"] { display: none; } </style><?php }); add_action(‘wp_footer’, function () { ?> <script> jQuery(function($) { let timeout; $(‘.woocommerce’).on(‘change’, ‘input.qty’, function() { if (timeout !== undefined) { clearTimeout(timeout); } timeout = setTimeout(function() { $("button[name=’update_cart’]").removeAttr("disabled"); $("[name=’update_cart’]").trigger("click"); // trigger cart update }, 1000); // 1 second delay, half a second […]

Minimum product order woocommerce

Posted

/** * For cart */ add_filter(‘woocommerce_cart_item_quantity’, ‘trueroman_min_kolvo_cart’, 20, 3); function truemisha_min_kolvo_cart($product_quantity, $cart_item_key, $cart_item) { $product = $cart_item[‘data’]; $min = 0; if (567 === $product->get_id()) { // товар с ID 500 $min = 1; } return woocommerce_quantity_input( array( ‘input_name’ => "cart[{$cart_item_key}][qty]", ‘input_value’ => $cart_item[‘quantity’], ‘max_value’ => $product->get_max_purchase_quantity(), ‘min_value’ => $min, ‘product_name’ => $product->get_name(), ), $product, false […]

Automatically add product to cart on visit woocommerce

Posted

/** * Automatically add product to cart on visit */ add_action(‘template_redirect’, ‘add_product_to_cart’); function add_product_to_cart() { $simple_product_id = 567; if (!is_admin()) { $product_id = 567; //replace with your own product id $found = false; //check if product already in cart if (sizeof(WC()->cart->get_cart()) > 0) { foreach (WC()->cart->get_cart() as $cart_item_key => $values) { $_product = $values[‘data’]; if […]

How to enable the Gutenberg editor in WooCommerce products

Posted

add_filter( ‘use_block_editor_for_post_type’, ‘art_enable_rest_for_product’, 10, 2 ); add_filter( ‘woocommerce_taxonomy_args_product_cat’, ‘art_show_in_rest_for_product’, 10, 1 ); add_filter( ‘woocommerce_taxonomy_args_product_tag’, ‘art_show_in_rest_for_product’, 10, 1 ); add_filter( ‘woocommerce_register_post_type_product’, ‘art_show_in_rest_for_product’, 10, 1 ); /** * Включение редактора Gutenberg для товаров * * @sourcecode https://omwagency.com/ * * @param bool $can_edit * @param string $post_type * * @return bool * * @author Roman Petrovich * @testedwith […]

Woocommerce rest check permissions

Posted

REST-API WOOCOMERCE add_filter( ‘woocommerce_rest_check_permissions’, ‘my_woocommerce_rest_check_permissions’, 90, 4 ); function my_woocommerce_rest_check_permissions( $permission, $context, $object_id, $post_type ){ return true; } редирект со страницы на страницу RewriteCond %{QUERY_STRING} ^_route_=login/$ RewriteRule ^(.*)$ https://omwagency.com/? [R=301,L]

Set a cookie and close a popup after Contact Form 7 form is submitted.

Posted

<?php // As is this will check if the form is in a popup, if so set a cookie and close after 5 seconds. // Copy everything below this line. function custom_cf7_scripts() { ?> <script type="text/javascript"> var wpcf7Elm = document.querySelector(‘.wpcf7’); wpcf7Elm.addEventListener(‘wpcf7submit’, function (event) { var $form = $(event.target), $popup = $form.parents(‘.pum’); if (!$popup.length) { return; […]

Liqpay payment widget

Posted

$liqpay = new LiqPay($public_key, $private_key); $html = $liqpay->cnb_form(array( ‘action’ => ‘pay’, ‘amount’ => ‘1’, ‘currency’ => ‘USD’, ‘description’ => ‘description text’, ‘order_id’ => ‘order_id_1’, ‘version’ => ‘3’ )); Payment widget options data Required String json string with APIs parameters is encoded by the base64_encode( json_string ) function , where base64_encode – returns a string encoded by the base64 method signature Required String Unique […]

Fixing the Common jQuery Error in WordPress

Posted

wp_enqueue_script( ‘tt-mobile-menu’, get_template_directory_uri() . ‘/js/mobile-menu.js’, array(‘jquery’), ‘1.0’, true ); jQuery(document).ready(function() { jQuery(#selector) … }); (function($) { // Use $() inside of this function $(#selector) … })(jQuery); <script src="http://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></script>

How to Hide Posts or Pages from the WordPress Admin

Posted

function true_hide_pages_from_admin( $query ) { global $pagenow; if( is_admin() && ‘edit.php’ == $pagenow && ‘page’ == get_query_var(‘post_type’) ){ // в качестве ‘page’ в условии можно указать любой произвольный тип постов $query->set( ‘post__not_in’, array(300,271) ); // через запятую прописываем ID страниц, которые хотим скрыть } return $query; } add_action( ‘pre_get_posts’ ,’true_hide_pages_from_admin’ ); function true_hide_posts_from_admin( $query ) […]

Change photo in url

Posted

<meta name="viewport" content="width=device-width, initial-scale=1"> <meta property="og:image" content="https://omwagency.com/wp-content/uploads/2018/05/cropped-download-1-1.png;" /> <meta property="og:image:secure_url" content="https://omwagency.com/wp-content/uploads/2018/05/cropped-download-1-1.png"; /> <meta property="og:image:type" content="image/jpeg" /> <meta property="og:image:width" content="400" /> <meta property="og:image:height" content="300" /> <meta property="og:image:alt" content="" />

Adding consent to the WooCommerce Privacy Policy

Posted

// Добавление чекбокса add_action( ‘woocommerce_review_order_before_submit’, ‘truemisha_privacy_checkbox’, 25 ); function truemisha_privacy_checkbox() { woocommerce_form_field( ‘privacy_policy_checkbox’, array( ‘type’ => ‘checkbox’, ‘class’ => array( ‘form-row’ ), ‘label_class’ => array( ‘woocommerce-form__label-for-checkbox’ ), ‘input_class’ => array( ‘woocommerce-form__input-checkbox’ ), ‘required’ => true, ‘label’ => ‘Принимаю <a href=”‘ . get_privacy_policy_url() . ‘”>Политику конфиденциальности</a>’, )); } // Валидация add_action( ‘woocommerce_checkout_process’, ‘truemisha_privacy_checkbox_error’, 25 ); function […]

Product availability in Woocommerce

Posted

add_action( ‘woocommerce_before_shop_loop_item_title’, ‘my_sold_out_loop’ ); function my_sold_out_loop() { global $product; if ( !$product->is_in_stock() ) { echo ‘<span class=”soldout”>Нет в наличии</span>’; } } add_action( ‘woocommerce_before_single_product_summary’, ‘my_sold_out_loop’ ); span.soldout { padding: 3px 7px; background: #7b1616; color: white; font-size: 13px; } add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 1, 2); function wcs_custom_get_availability( $availability, $_product ) { if ( $_product->is_in_stock() ) { $availability[‘availability’] = […]

Add field to user profile wordpress and woocommerce

Posted

function my_user_contactmethods($user_contactmethods){ $user_contactmethods[‘phone’] = ‘Телефон’; return $user_contactmethods; } add_filter(‘user_contactmethods’, ‘my_user_contactmethods’); <p class=”form-row form-row-wide”> <label for=”phone”>Phone</label> <input type=”text” class=”input-text” name=”phone” id=”phone” value=”<?php echo esc_attr( $user->phone ); ?>” /> </p> $phone = ! empty( $_POST[ ‘phone’ ] ) ? $_POST[ ‘phone’ ] : ”; $user->phone = $phone;

Woocommerce product category description under products

Posted

In order to display the description of the Woocommerce product category at the bottom of the page – under the products, you need to add the following code to the functions.php file of the theme: remove_action( ‘woocommerce_archive_description’, ‘woocommerce_taxonomy_archive_description’, 10 ); add_action( ‘woocommerce_after_shop_loop’, ‘woocommerce_taxonomy_archive_description’, 100 ); function woocommerce_taxonomy_archive_description() { if ( is_tax( array( ‘product_cat’, ‘product_tag’ ) […]

Sorting WordPress posts by creation time and AFC custom field

Posted

add_action(‘pre_get_posts’, ‘my_pre_get_posts’, 10, 1); function my_pre_get_posts($query) { if ($query->is_main_query() && !is_admin()) { $query->set(‘meta_key’, ‘sorting’); // сортировка по произвольному полю $query->set(‘orderby’, ‘meta_value_num’); $query->set(‘order’, ‘ASC’); // порядок сортировки } $query->set(‘meta_query’, $meta_query); } function postSorting() { $todays_date = current_time(‘Ymd’); $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => ‘4’, ‘paged’ => $paged, ‘meta_query’ => array( ‘relation’ => ‘AND’, ‘sorting_clause’ […]

Percentage Discount on Whole Cart Without Coupon in WooCommerce

Posted

Fixed Percentage Discount on Whole Cart in WooCommerce So, let’s start with the simplest discount – fixed. In it, the discount will be applied to the entire basket as a result, without unnecessary actions on the part of the user. Discount script: function woo_discount_total(WC_Cart $cart) { if(is_admin() && !defined(‘DOING_AJAX’)) { return; } $discount = $cart->subtotal […]

Enable phone field validation in woocommerce

Posted

// Custom validation for Billing Phone checkout field add_action(‘woocommerce_checkout_process’, ‘custom_validate_billing_phone’); function custom_validate_billing_phone() { $is_correct = preg_match(‘^((8|+7)[- ]?)?((?d{3})?[- ]?)?[d- ]{7,10}$’, $_POST[‘billing_phone’]); if ($_POST[‘billing_phone’] && !$is_correct) { wc_add_notice(__(‘The Phone field should be <strong>between 6 and 20 digits</strong>.’), ‘error’); } }

jQuery is Not Defined in WordPress

Posted

Step 1: Inclusion of jQuery Library When you go through code, make sure that jQuery is included and will load before your script. Even, the jQuery should be loaded once only. If it is loading multiple times, it will cause problems. If it is not included, then pass it as third argument in your wp_enqueue_script […]

Replacing currency sign with letters Woocommerce

Posted

Open the WordPress theme’s functions.php file and add a filter for woocommerce to it (ATTENTION !!! The code below is added to the end of the functions.php file) add_filter( ‘woocommerce_currencies’, ‘add_my_currency’ ); function add_my_currency( $currencies ) { $currencies[‘UAH’] = __( ‘Українська гривня’, ‘woocommerce’ ); return $currencies; } add_filter(‘woocommerce_currency_symbol’, ‘add_my_currency_symbol’, 10, 2); function add_my_currency_symbol( $currency_symbol, $currency […]

Platform installation Orchid – Laravel Admin Panel

Posted

Create a project Add dependency Platform installation Create user Start local server Publishing resources Updating What to do next? Before you can use the platform, you need to install it. This guide should help you perform a simple installation to start the project. Create a project Note. If you already have Laravel installation, you can skip […]

Installing ext-dom PHP7

Posted

First of all, read the warning! He says don’t run composer as root! Second, you are probably using Xammp on your local machine, which has the required php libraries by default. But on your server you are missing ext-dom. php-xml has all the required bundled packages. Thus, you can simply install it by running: sudo […]

How to insert shortcode into PHP

Posted

Especially for those who already know everything, but are just looking for a quick answer on how to insert a shortcode into a wordpress template or another engine, please use this code: However, don’t forget about punctuation! The quotes in your shortcode and php code must be different. That is, if in your WordPress site […]

Show password by icon

Posted

<div class=»password»> <input type=»password» id=»password-input» placeholder=»Введите пароль» name=»password» value=»123456″> <a href=»#» class=»password-control»></a> </div> <style type=»text/css»> .password { width: 300px; margin: 15px auto; position: relative; } #password-input { width: 100%; padding: 5px 0; height: 30px; line-height: 40px; text-indent: 10px; margin: 0 0 15px 0; border-radius: 5px; border: 1px solid #999; font-size: 18px; } .password-control { position: […]

Create tab tabs for product cards WooCommerce

Posted

This plugin extends to allow shop owners to add custom tabs to products. The tabs are displayed on the individual product pages to the right of the default “Description” tab. Individual product tabs are managed on the WooCommerce Edit Product screen and can be added on a per product basis. You can also create saved tabs […]

SQL queries to transfer a WordPress site to another domain

Posted

Describing SQL Queries In general, there are three main requests (there is a fourth request in the screenshot, but about it a little later). So, https://test.onmywaystudio.net/ is the old domain, https://omwagency.com/ is the new one. WordPress database table names are prefixed. By default, this is wp_, but on your site the prefix can be absolutely […]

Redirect after a successful order in the store

Posted

The redirect can be done by adding this code to the function.php of your theme. add_action( ‘template_redirect’, ‘woo_custom_redirect_after_purchase’ ); function woo_custom_redirect_after_purchase() { global $wp; if ( is_checkout() && !empty( $wp->query_vars[‘order-received’] ) ) { wp_redirect( ‘URL куда будем делать редирект’ ); exit; } } Now you can simply create a “thank you for order” page and […]

Install Symfony Framework

Posted

Создание проекта   Чтобы создать новый Symfony проект, основанный на одном из официальных шаблонов, нужно запустить команду:   $ symfony new [–full | –demo] <path-to-project>   По умолчанию используется минимальный шаблон skeleton. Чтобы установить website-skeleton нужно запустить команду с опцией –full. Соответственно, для установки demo проекта необходимо запускать команду с опцией –demo.   Под капотом symfony new выполняет команду composer create-project, затем инициализирует новый Git […]

Install Laravel on Ubuntu

Posted

System requirements Your system must meet the following requirements to be able to run the latest version of Laravel: PHP> = 7.1.3 with OpenSSL, PDO, Mbstring, Tokenizer, XML, Ctype and JSON PHP Extensions. Composer is an application-level package manager for PHP. Setting prerequisites First, make sure you update your system sources and existing software packages […]

Adobe Flash reaches end of life

Posted

Adobe’s once-ubiquitous Flash Player, a browser-based runtime for displaying rich media content on the Internet, has reached the end of the road, with the company having made the final scheduled release of the technology for all regions outside mainland China. The final release was made on December 8. Adobe will no longer support Flash Player […]

Mozilla Firefox boosts JavaScript performance

Posted

Firefox users can expect improved JavaScript performance in the Firefox 83 browser, with the Warp update to the SpiderMonkey JavaScript engine enabled by default. Also called WarpBuilder, Warp improves responsiveness and memory usage and speeds up page loads by making changes to JiT (just-in-time) compilers. Optimizing JiT is changed to rely solely on the CacheIR simple linear […]

Angular, React, Vue: JavaScript frameworks

Posted 1 Comment

Figure 1 describes how state manifestation is handled without such frameworks. Figure 2 describes how it is handled with the frameworks. Figure 1. Without data binding IDGFigure 1. Figure 2. With data binding via Angular, React, and Vue IDGFigure 2. Components The frameworks also align in being component-based. This is not a new idea: Each […]

Microsoft, Google address browser compatibility issues

Posted

Microsoft and Google are partnering to promote web browser compatibility around a number of CSS (Cascading Style Sheets) features, with an effort called #Compat2021. Also involving open source software consulting firm Igalia and the broader web community, #Compat2021 aims to improve compatibility in five specific areas: CSS Flexbox, a CSS module that defines a CSS box model […]

Color design of the site

Posted

One of the key roles in the success of the site plays the color scheme. Color directly affects the perception of the site by visitors: it can inspire confidence and encourage purchase, but it can also push away. The fact is that in our case the adage “to meet clothes …” is fair, as users […]

Website promotion (SEO, contextual advertising)

Posted

They paid a lot of money, built ambitious plans, got the key, and the site does not bring anything? It is early to get upset, as the availability of the site does not guarantee anything (if they are not properly engaged). Therefore, we derive the most popular and effective ways to increase awareness and increase […]

Ready-made website templates or original design

Posted

It makes no sense to explain the importance of having a site for any business, so let’s get to the point. The site is the face of the company, the business card of the entrepreneur and an obligatory attribute of doing business in modern realities. The main criteria for this tool: • catchiness; • informative; […]

E-COMMERCE

How it all began

Posted

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed venenatis dignissim ultrices. Suspendisse ut sollicitudin nisi. Fusce efficitur nec nunc nec bibendum. Praesent laoreet tortor quis velit facilisis faucibus. Maecenas sollicitudin lectus diam, non vehicula arcu ullamcorper ac. In pharetra, est vitae interdum tincidunt, urna ligula rutrum tellus, sit amet pharetra purus magna eu enim. […]