Skip to content

Instantly share code, notes, and snippets.

View rajucs's full-sized avatar
🎯
Focusing

Arman Hossain rajucs

🎯
Focusing
View GitHub Profile
@rajucs
rajucs / gist:dee58b22648028eb502f8be8c1423965
Created November 24, 2018 18:40
Installing Selenium Server
Setup
Download and install Java for your platform
Download selenium server’s latest version from
Place the downloaded .jar file to a folder of your choice, commonly C:\selenium
Create a batch file to run the server and add file to start up
To run server use java –jar selenium-server-standalone-2.25.0.jar
to create the batch file:
1) open notepad or any text-editor of your choice;
2) write the following in the file (supposing the .jar file is in C:\selenium folder):
# BEGIN LiteSpeed
<IfModule Litespeed>
SetEnv noabort 1
</IfModule>
# END LiteSpeed
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
This problem is raised for .htaccess file.
you need to modifiy .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /yourprojectname/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
add_action( 'woocommerce_after_shop_loop_item', 'add_loop_custom_button', 1000 );
function add_loop_custom_button() {
global $product;
$product_link = $product->get_permalink(); // Link to the product (if needed)
// Define your button link
$custom_link = home_url( "/something/" ) ;
// Output
<?php
$taxonomyName = "product_cat";
//This gets top layer terms only. This is done by setting parent to 0.
$parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'slug', 'hide_empty' => false));
echo '<ul>';
foreach ($parent_terms as $pterm) {
//show parent categories
echo '<li><a href="' . get_term_link($pterm->name, $taxonomyName) . '">' . $pterm->name . '</a></li>';
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://username@bitbucket.org/username/repository-name.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
To fix this error try this command-
add_filter( 'woocommerce_checkout_cart_item_quantity', 'customizing_checkout_item_quantity', 10, 3);
function customizing_checkout_item_quantity( $quantity_html, $cart_item, $cart_item_key ) {
$quantity_html = ' <br>
<span class="product-quantity" style="font-weight:bold;">' . __('Quantity:') . ' <strong>' . $cart_item['quantity'] . '</strong></span>';
return $quantity_html;
}
<section>
<h3>latest product section start</h3>
<?php
$args = array(
'number' => $number,
'orderby' => 'title',
'order' => 'ASC',
'hide_empty' => $hide_empty,
'include' => $ids
);
@rajucs
rajucs / gist:7b0223ba1210c61067ca6bb6a5365148
Created June 29, 2019 19:00
Woocommerce single product gallery thumbnails vertically
/*Based on Solution from Rodolfo Melogli*/
/* --- PHASE 1, make the gallery thumbnail column count 1 (not 3 or 4 )--- */
add_filter( 'woocommerce_product_thumbnails_columns', 'dk_single_gallery_columns', 99 );
function dk_single_gallery_columns() {
return 1;
}
// Do it for the Storefront theme specifically:
add_filter( 'storefront_product_thumbnail_columns', 'dk_single_gallery_columns_storefront', 99 );