This file contains 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 Quantity Option to WooCommerce Shop Page | |
@ code from https://code.mukto.info | |
*/ | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'mukto_qty_inputs_add_to_cart', 10, 2 ); | |
function mukto_qty_inputs_add_to_cart( $html, $product ) { | |
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) { | |
$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">'; | |
$html .= woocommerce_quantity_input( array(), $product, false ); | |
$html .= '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>'; |
This file contains 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($, window) { | |
var adjustAnchor = function() { | |
var $anchor = $(':target'), | |
fixedElementHeight = 120; | |
if ($anchor.length > 0) { | |
$('html, body') | |
.stop() |
This file contains 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
/*! | |
* Webflow: Front-end site library | |
* @license MIT | |
* Inline scripts may access the api using an async handler: | |
* var Webflow = Webflow || []; | |
* Webflow.push(readyFunction); | |
*/ | |
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; |
This file contains 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
//** * Enable preview / thumbnail for webp image files.*/ | |
function webp_is_displayable($result, $path) { | |
if ($result === false) { | |
$displayable_image_types = array( IMAGETYPE_WEBP ); | |
$info = @getimagesize( $path ); | |
if (empty($info)) { | |
$result = false; | |
} elseif (!in_array($info[2], $displayable_image_types)) { | |
$result = false; |
This file contains 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
//** *Enable upload for webp image files.*/ | |
function webp_upload_mimes($existing_mimes) { | |
$existing_mimes['webp'] = 'image/webp'; | |
return $existing_mimes; | |
} | |
add_filter('mime_types', 'webp_upload_mimes'); |
This file contains 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
/*** Take out the divider line between content and sidebar for Single WooCommerce Product Pages ***/ | |
.single-product #main-content .container:before {background: none;} | |
/*** Hide Sidebar for Single WooCommerce Product Pages ***/ | |
.single-product #sidebar, .single-product #sidebar-secondary {display:none;} | |
/*** Expand the content area to fullwidth for Single WooCommerce Product Pages ***/ | |
@media (min-width: 981px){ | |
.single-product #left-area, .single-product #primary { | |
width: 100%; |
This file contains 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_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
/** | |
* custom_woocommerce_template_loop_add_to_cart | |
*/ | |
function custom_woocommerce_product_add_to_cart_text() { | |
global $product; | |
$product_type = $product->product_type; | |
switch ( $product_type ) { |
NewerOlder