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
Below is the naming conventions for HTML structure. | |
===================================================== | |
Names are written in lowercase Latin letters. | |
Words are separated by a hyphen (-). | |
The block name defines the namespace for its elements and modifiers. | |
The element name is separated from the block name by a double underscore (__). |
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
Install Python and Create local environment | |
=============================================== | |
Some basic Commands to note i your memory | |
check selenium is installed or not. | |
=========================================== | |
$ python3 -c "import selenium; print(selenium.__version__)" | |
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
Web Automation Testing using Selenium and Python | |
================================================= | |
First you need to check the python is already installed in the system. | |
In order to check this just type the below command | |
$ python or $ python3 | |
It will result the as given below |
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
grep | |
============== | |
Grep search a specific patten in each file | |
$ grep "some string" file | |
Search a string in a specific. |
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
This is used to formate the debuging mode of the MAMP. | |
Here we need to enable the xdebug module in mamp in php ini file. | |
There are two different php ini file in, The locations are following. | |
/Applications/MAMP/bin/php/php7.3.8/conf/php.ini ---- In bin folder | |
/Applications/MAMP/conf/php7.3.8/php.ini ---- In conf folder | |
In bin folder open php.ini file and uncomment the line | |
zend_extension="/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so" |
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
WPML plugin is used for making the multi lingual website. | |
This will allow user to add transalted version of posts, category, page, product etc. | |
WPML use the parse_query hook to modify query. Using this filter WPML adds query modification. | |
The argument suppress_filters is used for removing the filter added in the query | |
like posts_search, posts_search_orderby, posts_where etc. All these type of queries will execute if the suppress_filters is false. | |
Default value of suppress filter is false in the WP_Query. So it will return only the posts in the current language. | |
But get_posts() return all the posts in the posts. because suppress_filters is true in this function by default. |
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
Introduced in the PHP 5. | |
PHP will call this method, when ever we create a new object. So it is used for the any initialisation before object start. | |
Parent constructors are not called implicitly in the child class. In order to get the parent constructors in child class | |
we need to add the statement parent::__construct() within the child constructor. | |
If the child doesn't contain any __construct(), then the parent class __construct() method will be inherited. | |
<?php | |
class grandpa{ |
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
If we are using the button in the form for submitting the data, then it will work if we click the button. | |
If we are using the jQuery.submit() function for submiting the form. Then the button value doesn't submit. | |
For working form with the button value without an issue you just need to configure the a hidden input | |
and add all the button property to the hidden field. | |
Below is the code for configuring the form. | |
$("input[type=submit], input[type=button], button").click(function(e) { | |
var self= $(this), |
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
When we apply the float to inner elements and the outer div is not taking the height. Then you can use below snippets. | |
<div class="containing-div"> | |
<div class="floating-div"> | |
<ul> | |
<li>List Item One</li> | |
<li>List Item Two</li> | |
<li>List Item Three</li> | |
<li>List Item Four</li> | |
</ul> |
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
In woo-commerce there are lot of filter they are dynamically generated for the multiple function use. | |
So these hooks are hard to find and can't be found while searching the woocommerce folder. | |
The below hook is the one of the dynamic hooks used in the woocommerce | |
1) get_property hooks for the woocommerce product class (woocommerce_product_get_price). | |
========================================================= | |
All the get_functions in the WooCommerce product class, like $product->get_price(), | |
use the get_prop() method under the dynamic filter hook | |
This is part of the WC_Data class that WC_Product extends. |