Version Description
- 06.27.2018 =
- Dev - Disable plugin if running Storefront 2.3+. This plugin is now included in Storefront core.
Download this release
Release Info
Developer | jameskoster |
Plugin | Storefront Sticky Add to Cart |
Version | 1.1.9 |
Comparing to | |
See all releases |
Code changes from version 1.1.8 to 1.1.9
- assets/css/style.css +0 -0
- assets/css/style.scss +0 -0
- assets/js/variable.js +0 -0
- assets/js/variable.min.js +0 -0
- assets/js/waypoints.init.js +0 -0
- assets/js/waypoints.init.min.js +0 -0
- classes/class-storefront-sticky-add-to-cart.php +296 -0
- config.codekit +920 -0
- functions/functions.php +10 -0
- index.php +0 -0
- languages/storefront-sticky-add-to-cart.pot +0 -0
- readme.txt +5 -2
- storefront-sticky-add-to-cart.php +14 -304
assets/css/style.css
CHANGED
File without changes
|
assets/css/style.scss
CHANGED
File without changes
|
assets/js/variable.js
CHANGED
File without changes
|
assets/js/variable.min.js
CHANGED
File without changes
|
assets/js/waypoints.init.js
CHANGED
File without changes
|
assets/js/waypoints.init.min.js
CHANGED
File without changes
|
classes/class-storefront-sticky-add-to-cart.php
ADDED
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main Storefront_Sticky_Add_to_Cart Class
|
4 |
+
*
|
5 |
+
* @class Storefront_Sticky_Add_to_Cart
|
6 |
+
* @version 1.0.0
|
7 |
+
* @since 1.0.0
|
8 |
+
* @package Storefront_Sticky_Add_to_Cart
|
9 |
+
*/
|
10 |
+
final class Storefront_Sticky_Add_to_Cart {
|
11 |
+
/**
|
12 |
+
* Storefront_Sticky_Add_to_Cart The single instance of Storefront_Sticky_Add_to_Cart.
|
13 |
+
*
|
14 |
+
* @var object
|
15 |
+
* @access private
|
16 |
+
* @since 1.0.0
|
17 |
+
*/
|
18 |
+
private static $_instance = null;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The token.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
* @access public
|
25 |
+
* @since 1.0.0
|
26 |
+
*/
|
27 |
+
public $token;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* The version number.
|
31 |
+
*
|
32 |
+
* @var string
|
33 |
+
* @access public
|
34 |
+
* @since 1.0.0
|
35 |
+
*/
|
36 |
+
public $version;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* The admin object.
|
40 |
+
*
|
41 |
+
* @var object
|
42 |
+
* @access public
|
43 |
+
* @since 1.0.0
|
44 |
+
*/
|
45 |
+
public $admin;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Constructor function.
|
49 |
+
*
|
50 |
+
* @access public
|
51 |
+
* @since 1.0.0
|
52 |
+
* @return void
|
53 |
+
*/
|
54 |
+
public function __construct() {
|
55 |
+
$this->token = 'storefront-sticky-add-to-cart';
|
56 |
+
$this->plugin_url = plugin_dir_url( __FILE__ );
|
57 |
+
$this->plugin_path = plugin_dir_path( __FILE__ );
|
58 |
+
$this->version = '1.1.9';
|
59 |
+
|
60 |
+
register_activation_hook( __FILE__, array( $this, 'install' ) );
|
61 |
+
|
62 |
+
add_action( 'init', array( $this, 'ssatc_load_plugin_textdomain' ) );
|
63 |
+
|
64 |
+
add_action( 'init', array( $this, 'ssatc_setup' ) );
|
65 |
+
|
66 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'ssatc_plugin_links' ) );
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Main Storefront_Sticky_Add_to_Cart Instance
|
71 |
+
*
|
72 |
+
* Ensures only one instance of Storefront_Sticky_Add_to_Cart is loaded or can be loaded.
|
73 |
+
*
|
74 |
+
* @since 1.0.0
|
75 |
+
* @static
|
76 |
+
* @see Storefront_Sticky_Add_to_Cart()
|
77 |
+
* @return Main Storefront_Sticky_Add_to_Cart instance
|
78 |
+
*/
|
79 |
+
public static function instance() {
|
80 |
+
if ( is_null( self::$_instance ) ) {
|
81 |
+
self::$_instance = new self();
|
82 |
+
}
|
83 |
+
|
84 |
+
return self::$_instance;
|
85 |
+
} // End instance()
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Load the localisation file.
|
89 |
+
*
|
90 |
+
* @access public
|
91 |
+
* @since 1.0.0
|
92 |
+
* @return void
|
93 |
+
*/
|
94 |
+
public function ssatc_load_plugin_textdomain() {
|
95 |
+
load_plugin_textdomain( 'storefront-sticky-add-to-cart', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Cloning is forbidden.
|
100 |
+
*
|
101 |
+
* @since 1.0.0
|
102 |
+
*/
|
103 |
+
public function __clone() {
|
104 |
+
_doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?' ), '1.0.0' );
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Unserializing instances of this class is forbidden.
|
109 |
+
*
|
110 |
+
* @since 1.0.0
|
111 |
+
*/
|
112 |
+
public function __wakeup() {
|
113 |
+
_doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?' ), '1.0.0' );
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Plugin page links
|
118 |
+
*
|
119 |
+
* @param array $links the plugin action links.
|
120 |
+
* @since 1.0.0
|
121 |
+
*/
|
122 |
+
public function ssatc_plugin_links( $links ) {
|
123 |
+
$plugin_links = array(
|
124 |
+
'<a href="https://wordpress.org/support/plugin/storefront-sticky-add-to-cart">' . esc_attr__( 'Support', 'storefront-sticky-add-to-cart' ) . '</a>',
|
125 |
+
);
|
126 |
+
|
127 |
+
return array_merge( $plugin_links, $links );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Installation.
|
132 |
+
* Runs on activation. Logs the version number.
|
133 |
+
*
|
134 |
+
* @access public
|
135 |
+
* @since 1.0.0
|
136 |
+
* @return void
|
137 |
+
*/
|
138 |
+
public function install() {
|
139 |
+
$this->_log_version_number();
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Log the plugin version number.
|
144 |
+
*
|
145 |
+
* @access private
|
146 |
+
* @since 1.0.0
|
147 |
+
* @return void
|
148 |
+
*/
|
149 |
+
private function _log_version_number() {
|
150 |
+
// Log the version number.
|
151 |
+
update_option( $this->token . '-version', $this->version );
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Setup all the things.
|
156 |
+
*
|
157 |
+
* @return void
|
158 |
+
*/
|
159 |
+
public function ssatc_setup() {
|
160 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'ssatc_script' ), 999 );
|
161 |
+
add_action( 'wp', array( $this, 'ssatc_load_add_to_cart_bar' ), 999 );
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Enqueue CSS and custom styles.
|
166 |
+
*
|
167 |
+
* @since 1.0.0
|
168 |
+
* @return void
|
169 |
+
*/
|
170 |
+
public function ssatc_script() {
|
171 |
+
$theme = wp_get_theme();
|
172 |
+
wp_enqueue_style( 'ssatc-styles', plugins_url( '../assets/css/style.css', __FILE__ ), '', get_option( 'storefront-sticky-add-to-cart-version' ) );
|
173 |
+
wp_register_script( 'waypoints', plugins_url( '../assets/js/jquery.waypoints.min.js', __FILE__ ), array( 'jquery' ), '4.0.0' );
|
174 |
+
wp_register_script( 'waypoints-init', plugins_url( '../assets/js/waypoints.init.min.js', __FILE__ ), array( 'jquery' ) );
|
175 |
+
wp_register_script( 'ssatc-variable', plugins_url( '../assets/js/variable.min.js', __FILE__ ), array( 'jquery' ) );
|
176 |
+
|
177 |
+
// If Storefront is the active parent theme, add some styles.
|
178 |
+
if ( 'Storefront' === $theme->name || 'storefront' === $theme->template ) {
|
179 |
+
|
180 |
+
$bg_color = storefront_get_content_background_color();
|
181 |
+
$accent_color = get_theme_mod( 'storefront_accent_color' );
|
182 |
+
$text_color = get_theme_mod( 'storefront_text_color' );
|
183 |
+
|
184 |
+
$ssatc_style = '
|
185 |
+
.ssatc-sticky-add-to-cart {
|
186 |
+
background-color: ' . $bg_color . ';
|
187 |
+
color: ' . $text_color . ';
|
188 |
+
}
|
189 |
+
|
190 |
+
.ssatc-sticky-add-to-cart a:not(.button) {
|
191 |
+
color: ' . $accent_color . ';
|
192 |
+
}';
|
193 |
+
|
194 |
+
wp_add_inline_style( 'ssatc-styles', $ssatc_style );
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Hooks the add to cart bar into DOM
|
200 |
+
*/
|
201 |
+
public function ssatc_load_add_to_cart_bar() {
|
202 |
+
add_action( 'storefront_after_footer', array( $this, 'ssatc_add_to_cart_bar' ), 999 );
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Display the current product image
|
207 |
+
*
|
208 |
+
* @return void
|
209 |
+
*/
|
210 |
+
public function ssatc_product_image() {
|
211 |
+
global $post;
|
212 |
+
|
213 |
+
if ( has_post_thumbnail() ) {
|
214 |
+
|
215 |
+
$image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
|
216 |
+
$image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_catalog' ), array(
|
217 |
+
'title' => $image_title,
|
218 |
+
'alt' => $image_title,
|
219 |
+
) );
|
220 |
+
|
221 |
+
echo wp_kses_post( apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image ), $post->ID ) );
|
222 |
+
|
223 |
+
} else {
|
224 |
+
|
225 |
+
echo wp_kses_post( apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="%s" />', wc_placeholder_img_src(), __( 'Placeholder', 'storefront-sticky-add-to-cart' ) ), $post->ID ) );
|
226 |
+
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Display the add to cart bar
|
232 |
+
*
|
233 |
+
* @return void
|
234 |
+
*/
|
235 |
+
function ssatc_add_to_cart_bar() {
|
236 |
+
global $product;
|
237 |
+
|
238 |
+
// Only execute if WooCommerce is installed.
|
239 |
+
if ( class_exists( 'WooCommerce' ) ) {
|
240 |
+
|
241 |
+
// And if we're on a product page.
|
242 |
+
if ( is_product() ) {
|
243 |
+
$availability = $product->get_availability();
|
244 |
+
$ssatc = new Storefront_Sticky_Add_to_Cart();
|
245 |
+
$availability_html = empty( $availability['availability'] ) ? '' : '<span class="stock ' . esc_attr( $availability['class'] ) . '">' . wp_kses_post( $availability['availability'] ) . '</span>';
|
246 |
+
|
247 |
+
// And if the product isn't variable or grouped.
|
248 |
+
wp_enqueue_script( 'waypoints' );
|
249 |
+
wp_enqueue_script( 'waypoints-init' );
|
250 |
+
|
251 |
+
?>
|
252 |
+
<section class="ssatc-sticky-add-to-cart animated">
|
253 |
+
<div class="col-full">
|
254 |
+
<?php
|
255 |
+
if ( version_compare( WC_VERSION, '2.7.0', '<' ) ) {
|
256 |
+
$rating_html = $product->get_rating_html();
|
257 |
+
} else {
|
258 |
+
$rating_html = wc_get_rating_html( $product->get_average_rating() );
|
259 |
+
}
|
260 |
+
|
261 |
+
$ssatc->ssatc_product_image();
|
262 |
+
echo '<div class="ssatc-content">';
|
263 |
+
echo esc_attr__( 'You\'re viewing:', 'storefront-sticky-add-to-cart' ) . ' <strong>' . get_the_title() . '</strong><br />';
|
264 |
+
echo '<span class="price">' . wp_kses_post( $product->get_price_html() ) . '</span> ' . wp_kses_post( $rating_html );
|
265 |
+
echo wp_kses_post( apply_filters( 'woocommerce_stock_html', $availability_html, array_key_exists( 'availability', $availability ) ? $availability['availability'] : '', $product ) );
|
266 |
+
|
267 |
+
ob_start();
|
268 |
+
|
269 |
+
if ( $product->is_type( 'simple' ) ) {
|
270 |
+
echo '<a href="' . esc_url( $product->add_to_cart_url() ) . '" class="button alt">' . esc_attr( $product->single_add_to_cart_text() ) . '</a>';
|
271 |
+
} else {
|
272 |
+
echo '<a class="button alt variable">' . esc_attr__( 'Select options', 'storefront-sticky-add-to-cart' ) . '</a>';
|
273 |
+
wp_enqueue_script( 'ssatc-variable' );
|
274 |
+
}
|
275 |
+
|
276 |
+
if ( class_exists( 'WC_Catalog_Restrictions' ) ) {
|
277 |
+
if ( ! WC_Catalog_Restrictions_Filters::instance()->user_can_purchase( $product ) ) {
|
278 |
+
ob_end_clean();
|
279 |
+
global $wc_cvo;
|
280 |
+
$html = apply_filters( 'catalog_visibility_alternate_add_to_cart_button', do_shortcode( wpautop( wptexturize( $wc_cvo->setting( 'wc_cvo_s_price_text' ) ) ) ) );
|
281 |
+
|
282 |
+
echo $html;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
ob_end_flush();
|
287 |
+
|
288 |
+
echo '</div>';
|
289 |
+
?>
|
290 |
+
</div>
|
291 |
+
</section>
|
292 |
+
<?php
|
293 |
+
}
|
294 |
+
}
|
295 |
+
}
|
296 |
+
} // End Class
|
config.codekit
ADDED
@@ -0,0 +1,920 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
|
3 |
+
"creatorBuild": "19137",
|
4 |
+
"files": {
|
5 |
+
"\/assets\/css\/style.css": {
|
6 |
+
"fileType": 16,
|
7 |
+
"ignore": 1,
|
8 |
+
"ignoreWasSetByUser": 0,
|
9 |
+
"inputAbbreviatedPath": "\/assets\/css\/style.css",
|
10 |
+
"outputAbbreviatedPath": "No Output Path",
|
11 |
+
"outputPathIsOutsideProject": 0,
|
12 |
+
"outputPathIsSetByUser": 0
|
13 |
+
},
|
14 |
+
"\/assets\/css\/style.scss": {
|
15 |
+
"createSourceMap": 0,
|
16 |
+
"debugStyle": 0,
|
17 |
+
"decimalPrecision": 10,
|
18 |
+
"fileType": 4,
|
19 |
+
"ignore": 0,
|
20 |
+
"ignoreWasSetByUser": 0,
|
21 |
+
"inputAbbreviatedPath": "\/assets\/css\/style.scss",
|
22 |
+
"outputAbbreviatedPath": "\/assets\/css\/style.css",
|
23 |
+
"outputPathIsOutsideProject": 0,
|
24 |
+
"outputPathIsSetByUser": 0,
|
25 |
+
"outputStyle": 0,
|
26 |
+
"shouldRunAutoprefixer": 0,
|
27 |
+
"shouldRunBless": 0,
|
28 |
+
"useLibsass": 0
|
29 |
+
},
|
30 |
+
"\/assets\/js\/jquery.waypoints.min.js": {
|
31 |
+
"fileType": 64,
|
32 |
+
"ignore": 1,
|
33 |
+
"ignoreWasSetByUser": 1,
|
34 |
+
"inputAbbreviatedPath": "\/assets\/js\/jquery.waypoints.min.js",
|
35 |
+
"outputAbbreviatedPath": "\/assets\/js\/min\/jquery.waypoints.min-min.js",
|
36 |
+
"outputPathIsOutsideProject": 0,
|
37 |
+
"outputPathIsSetByUser": 0,
|
38 |
+
"outputStyle": 1,
|
39 |
+
"syntaxCheckerStyle": 1
|
40 |
+
},
|
41 |
+
"\/assets\/js\/variable.js": {
|
42 |
+
"fileType": 64,
|
43 |
+
"ignore": 0,
|
44 |
+
"ignoreWasSetByUser": 0,
|
45 |
+
"inputAbbreviatedPath": "\/assets\/js\/variable.js",
|
46 |
+
"outputAbbreviatedPath": "\/assets\/js\/variable.min.js",
|
47 |
+
"outputPathIsOutsideProject": 0,
|
48 |
+
"outputPathIsSetByUser": 1,
|
49 |
+
"outputStyle": 1,
|
50 |
+
"syntaxCheckerStyle": 1
|
51 |
+
},
|
52 |
+
"\/assets\/js\/variable.min.js": {
|
53 |
+
"fileType": 64,
|
54 |
+
"ignore": 1,
|
55 |
+
"ignoreWasSetByUser": 0,
|
56 |
+
"inputAbbreviatedPath": "\/assets\/js\/variable.min.js",
|
57 |
+
"outputAbbreviatedPath": "\/assets\/js\/min\/variable.min-min.js",
|
58 |
+
"outputPathIsOutsideProject": 0,
|
59 |
+
"outputPathIsSetByUser": 0,
|
60 |
+
"outputStyle": 1,
|
61 |
+
"syntaxCheckerStyle": 1
|
62 |
+
},
|
63 |
+
"\/assets\/js\/waypoints.init.js": {
|
64 |
+
"fileType": 64,
|
65 |
+
"ignore": 0,
|
66 |
+
"ignoreWasSetByUser": 0,
|
67 |
+
"inputAbbreviatedPath": "\/assets\/js\/waypoints.init.js",
|
68 |
+
"outputAbbreviatedPath": "\/assets\/js\/waypoints.init.min.js",
|
69 |
+
"outputPathIsOutsideProject": 0,
|
70 |
+
"outputPathIsSetByUser": 1,
|
71 |
+
"outputStyle": 1,
|
72 |
+
"syntaxCheckerStyle": 1
|
73 |
+
},
|
74 |
+
"\/assets\/js\/waypoints.init.min.js": {
|
75 |
+
"fileType": 64,
|
76 |
+
"ignore": 1,
|
77 |
+
"ignoreWasSetByUser": 0,
|
78 |
+
"inputAbbreviatedPath": "\/assets\/js\/waypoints.init.min.js",
|
79 |
+
"outputAbbreviatedPath": "\/assets\/js\/min\/waypoints.init.min-min.js",
|
80 |
+
"outputPathIsOutsideProject": 0,
|
81 |
+
"outputPathIsSetByUser": 0,
|
82 |
+
"outputStyle": 1,
|
83 |
+
"syntaxCheckerStyle": 1
|
84 |
+
},
|
85 |
+
"\/index.php": {
|
86 |
+
"fileType": 8192,
|
87 |
+
"ignore": 0,
|
88 |
+
"ignoreWasSetByUser": 0,
|
89 |
+
"inputAbbreviatedPath": "\/index.php",
|
90 |
+
"outputAbbreviatedPath": "No Output Path",
|
91 |
+
"outputPathIsOutsideProject": 0,
|
92 |
+
"outputPathIsSetByUser": 0
|
93 |
+
},
|
94 |
+
"\/storefront-sticky-add-to-cart.php": {
|
95 |
+
"fileType": 8192,
|
96 |
+
"ignore": 0,
|
97 |
+
"ignoreWasSetByUser": 0,
|
98 |
+
"inputAbbreviatedPath": "\/storefront-sticky-add-to-cart.php",
|
99 |
+
"outputAbbreviatedPath": "No Output Path",
|
100 |
+
"outputPathIsOutsideProject": 0,
|
101 |
+
"outputPathIsSetByUser": 0
|
102 |
+
}
|
103 |
+
},
|
104 |
+
"hooks": [
|
105 |
+
],
|
106 |
+
"lastSavedByUser": "James Koster",
|
107 |
+
"manualImportLinks": {
|
108 |
+
},
|
109 |
+
"projectAttributes": {
|
110 |
+
"bowerAbbreviatedPath": "",
|
111 |
+
"displayValue": "storefront-sticky-add-to-cart",
|
112 |
+
"displayValueWasSetByUser": 0,
|
113 |
+
"iconImageName": "compass_blue"
|
114 |
+
},
|
115 |
+
"projectSettings": {
|
116 |
+
"alwaysUseExternalServer": 0,
|
117 |
+
"animateCSSInjections": 1,
|
118 |
+
"autoApplyPSLanguageSettingsStyle": 0,
|
119 |
+
"autoprefixerBrowserString": "> 1%, last 2 versions, Firefox ESR, Opera 12.1",
|
120 |
+
"autoSyncProjectSettingsFile": 1,
|
121 |
+
"browserRefreshDelay": 0,
|
122 |
+
"coffeeAutoOutputPathEnabled": 1,
|
123 |
+
"coffeeAutoOutputPathFilenamePattern": "*.js",
|
124 |
+
"coffeeAutoOutputPathRelativePath": "",
|
125 |
+
"coffeeAutoOutputPathReplace1": "",
|
126 |
+
"coffeeAutoOutputPathReplace2": "",
|
127 |
+
"coffeeAutoOutputPathStyle": 0,
|
128 |
+
"coffeeCreateSourceMap": 0,
|
129 |
+
"coffeeLintFlags2": {
|
130 |
+
"arrow_spacing": {
|
131 |
+
"active": 0,
|
132 |
+
"flagValue": -1
|
133 |
+
},
|
134 |
+
"camel_case_classes": {
|
135 |
+
"active": 1,
|
136 |
+
"flagValue": -1
|
137 |
+
},
|
138 |
+
"colon_assignment_spacing": {
|
139 |
+
"active": 0,
|
140 |
+
"flagValue": 1
|
141 |
+
},
|
142 |
+
"cyclomatic_complexity": {
|
143 |
+
"active": 0,
|
144 |
+
"flagValue": 10
|
145 |
+
},
|
146 |
+
"duplicate_key": {
|
147 |
+
"active": 1,
|
148 |
+
"flagValue": -1
|
149 |
+
},
|
150 |
+
"empty_constructor_needs_parens": {
|
151 |
+
"active": 0,
|
152 |
+
"flagValue": -1
|
153 |
+
},
|
154 |
+
"ensure_comprehensions": {
|
155 |
+
"active": 1,
|
156 |
+
"flagValue": -1
|
157 |
+
},
|
158 |
+
"indentation": {
|
159 |
+
"active": 1,
|
160 |
+
"flagValue": 2
|
161 |
+
},
|
162 |
+
"line_endings": {
|
163 |
+
"active": 0,
|
164 |
+
"flagValue": 0
|
165 |
+
},
|
166 |
+
"max_line_length": {
|
167 |
+
"active": 0,
|
168 |
+
"flagValue": 150
|
169 |
+
},
|
170 |
+
"missing_fat_arrows": {
|
171 |
+
"active": 0,
|
172 |
+
"flagValue": -1
|
173 |
+
},
|
174 |
+
"newlines_after_classes": {
|
175 |
+
"active": 0,
|
176 |
+
"flagValue": 3
|
177 |
+
},
|
178 |
+
"no_backticks": {
|
179 |
+
"active": 1,
|
180 |
+
"flagValue": -1
|
181 |
+
},
|
182 |
+
"no_debugger": {
|
183 |
+
"active": 1,
|
184 |
+
"flagValue": -1
|
185 |
+
},
|
186 |
+
"no_empty_functions": {
|
187 |
+
"active": 0,
|
188 |
+
"flagValue": -1
|
189 |
+
},
|
190 |
+
"no_empty_param_list": {
|
191 |
+
"active": 0,
|
192 |
+
"flagValue": -1
|
193 |
+
},
|
194 |
+
"no_implicit_braces": {
|
195 |
+
"active": 1,
|
196 |
+
"flagValue": -1
|
197 |
+
},
|
198 |
+
"no_implicit_parens": {
|
199 |
+
"active": 0,
|
200 |
+
"flagValue": -1
|
201 |
+
},
|
202 |
+
"no_interpolation_in_single_quotes": {
|
203 |
+
"active": 0,
|
204 |
+
"flagValue": -1
|
205 |
+
},
|
206 |
+
"no_nested_string_interpolation": {
|
207 |
+
"active": 1,
|
208 |
+
"flagValue": -1
|
209 |
+
},
|
210 |
+
"no_plusplus": {
|
211 |
+
"active": 0,
|
212 |
+
"flagValue": -1
|
213 |
+
},
|
214 |
+
"no_private_function_fat_arrows": {
|
215 |
+
"active": 1,
|
216 |
+
"flagValue": -1
|
217 |
+
},
|
218 |
+
"no_stand_alone_at": {
|
219 |
+
"active": 1,
|
220 |
+
"flagValue": -1
|
221 |
+
},
|
222 |
+
"no_tabs": {
|
223 |
+
"active": 1,
|
224 |
+
"flagValue": -1
|
225 |
+
},
|
226 |
+
"no_this": {
|
227 |
+
"active": 0,
|
228 |
+
"flagValue": -1
|
229 |
+
},
|
230 |
+
"no_throwing_strings": {
|
231 |
+
"active": 1,
|
232 |
+
"flagValue": -1
|
233 |
+
},
|
234 |
+
"no_trailing_semicolons": {
|
235 |
+
"active": 1,
|
236 |
+
"flagValue": -1
|
237 |
+
},
|
238 |
+
"no_trailing_whitespace": {
|
239 |
+
"active": 1,
|
240 |
+
"flagValue": -1
|
241 |
+
},
|
242 |
+
"no_unnecessary_double_quotes": {
|
243 |
+
"active": 0,
|
244 |
+
"flagValue": -1
|
245 |
+
},
|
246 |
+
"no_unnecessary_fat_arrows": {
|
247 |
+
"active": 1,
|
248 |
+
"flagValue": -1
|
249 |
+
},
|
250 |
+
"non_empty_constructor_needs_parens": {
|
251 |
+
"active": 0,
|
252 |
+
"flagValue": -1
|
253 |
+
},
|
254 |
+
"prefer_english_operator": {
|
255 |
+
"active": 0,
|
256 |
+
"flagValue": -1
|
257 |
+
},
|
258 |
+
"space_operators": {
|
259 |
+
"active": 0,
|
260 |
+
"flagValue": -1
|
261 |
+
},
|
262 |
+
"spacing_after_comma": {
|
263 |
+
"active": 1,
|
264 |
+
"flagValue": -1
|
265 |
+
}
|
266 |
+
},
|
267 |
+
"coffeeMinifyOutput": 1,
|
268 |
+
"coffeeOutputStyle": 0,
|
269 |
+
"coffeeSyntaxCheckerStyle": 1,
|
270 |
+
"externalServerAddress": "http:\/\/localhost:8888",
|
271 |
+
"externalServerPreviewPathAddition": "",
|
272 |
+
"genericWebpageFileExtensionsString": "html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp",
|
273 |
+
"hamlAutoOutputPathEnabled": 1,
|
274 |
+
"hamlAutoOutputPathFilenamePattern": "*.html",
|
275 |
+
"hamlAutoOutputPathRelativePath": "",
|
276 |
+
"hamlAutoOutputPathReplace1": "",
|
277 |
+
"hamlAutoOutputPathReplace2": "",
|
278 |
+
"hamlAutoOutputPathStyle": 0,
|
279 |
+
"hamlEscapeHTMLCharacters": 0,
|
280 |
+
"hamlNoEscapeInAttributes": 0,
|
281 |
+
"hamlOutputFormat": 2,
|
282 |
+
"hamlOutputStyle": 0,
|
283 |
+
"hamlUseCDATA": 0,
|
284 |
+
"hamlUseDoubleQuotes": 0,
|
285 |
+
"hamlUseUnixNewlines": 0,
|
286 |
+
"jadeAutoOutputPathEnabled": 1,
|
287 |
+
"jadeAutoOutputPathFilenamePattern": "*.html",
|
288 |
+
"jadeAutoOutputPathRelativePath": "",
|
289 |
+
"jadeAutoOutputPathReplace1": "",
|
290 |
+
"jadeAutoOutputPathReplace2": "",
|
291 |
+
"jadeAutoOutputPathStyle": 0,
|
292 |
+
"jadeCompileDebug": 1,
|
293 |
+
"jadeOutputStyle": 0,
|
294 |
+
"javascriptAutoOutputPathEnabled": 1,
|
295 |
+
"javascriptAutoOutputPathFilenamePattern": "*-min.js",
|
296 |
+
"javascriptAutoOutputPathRelativePath": "\/min",
|
297 |
+
"javascriptAutoOutputPathReplace1": "",
|
298 |
+
"javascriptAutoOutputPathReplace2": "",
|
299 |
+
"javascriptAutoOutputPathStyle": 2,
|
300 |
+
"javascriptCreateSourceMap": 1,
|
301 |
+
"javascriptOutputStyle": 1,
|
302 |
+
"javascriptSyntaxCheckerStyle": 1,
|
303 |
+
"jsCheckerReservedNamesString": "",
|
304 |
+
"jsHintFlags2": {
|
305 |
+
"asi": {
|
306 |
+
"active": 0,
|
307 |
+
"flagValue": -1
|
308 |
+
},
|
309 |
+
"bitwise": {
|
310 |
+
"active": 1,
|
311 |
+
"flagValue": -1
|
312 |
+
},
|
313 |
+
"boss": {
|
314 |
+
"active": 0,
|
315 |
+
"flagValue": -1
|
316 |
+
},
|
317 |
+
"browser": {
|
318 |
+
"active": 1,
|
319 |
+
"flagValue": -1
|
320 |
+
},
|
321 |
+
"browserify": {
|
322 |
+
"active": 0,
|
323 |
+
"flagValue": -1
|
324 |
+
},
|
325 |
+
"camelcase": {
|
326 |
+
"active": 0,
|
327 |
+
"flagValue": -1
|
328 |
+
},
|
329 |
+
"couch": {
|
330 |
+
"active": 0,
|
331 |
+
"flagValue": -1
|
332 |
+
},
|
333 |
+
"curly": {
|
334 |
+
"active": 1,
|
335 |
+
"flagValue": -1
|
336 |
+
},
|
337 |
+
"debug": {
|
338 |
+
"active": 0,
|
339 |
+
"flagValue": -1
|
340 |
+
},
|
341 |
+
"devel": {
|
342 |
+
"active": 0,
|
343 |
+
"flagValue": -1
|
344 |
+
},
|
345 |
+
"dojo": {
|
346 |
+
"active": 0,
|
347 |
+
"flagValue": -1
|
348 |
+
},
|
349 |
+
"elision": {
|
350 |
+
"active": 1,
|
351 |
+
"flagValue": -1
|
352 |
+
},
|
353 |
+
"eqeqeq": {
|
354 |
+
"active": 1,
|
355 |
+
"flagValue": -1
|
356 |
+
},
|
357 |
+
"eqnull": {
|
358 |
+
"active": 0,
|
359 |
+
"flagValue": -1
|
360 |
+
},
|
361 |
+
"es3": {
|
362 |
+
"active": 0,
|
363 |
+
"flagValue": -1
|
364 |
+
},
|
365 |
+
"esnext": {
|
366 |
+
"active": 0,
|
367 |
+
"flagValue": -1
|
368 |
+
},
|
369 |
+
"evil": {
|
370 |
+
"active": 0,
|
371 |
+
"flagValue": -1
|
372 |
+
},
|
373 |
+
"expr": {
|
374 |
+
"active": 0,
|
375 |
+
"flagValue": -1
|
376 |
+
},
|
377 |
+
"forin": {
|
378 |
+
"active": 0,
|
379 |
+
"flagValue": -1
|
380 |
+
},
|
381 |
+
"freeze": {
|
382 |
+
"active": 1,
|
383 |
+
"flagValue": -1
|
384 |
+
},
|
385 |
+
"funcscope": {
|
386 |
+
"active": 0,
|
387 |
+
"flagValue": -1
|
388 |
+
},
|
389 |
+
"futurehostile": {
|
390 |
+
"active": 0,
|
391 |
+
"flagValue": -1
|
392 |
+
},
|
393 |
+
"globalstrict": {
|
394 |
+
"active": 0,
|
395 |
+
"flagValue": -1
|
396 |
+
},
|
397 |
+
"immed": {
|
398 |
+
"active": 0,
|
399 |
+
"flagValue": -1
|
400 |
+
},
|
401 |
+
"indent": {
|
402 |
+
"active": 0,
|
403 |
+
"flagValue": 4
|
404 |
+
},
|
405 |
+
"iterator": {
|
406 |
+
"active": 0,
|
407 |
+
"flagValue": -1
|
408 |
+
},
|
409 |
+
"jasmine": {
|
410 |
+
"active": 0,
|
411 |
+
"flagValue": -1
|
412 |
+
},
|
413 |
+
"jquery": {
|
414 |
+
"active": 1,
|
415 |
+
"flagValue": -1
|
416 |
+
},
|
417 |
+
"lastsemic": {
|
418 |
+
"active": 0,
|
419 |
+
"flagValue": -1
|
420 |
+
},
|
421 |
+
"latedef": {
|
422 |
+
"active": 1,
|
423 |
+
"flagValue": -1
|
424 |
+
},
|
425 |
+
"laxbreak": {
|
426 |
+
"active": 0,
|
427 |
+
"flagValue": -1
|
428 |
+
},
|
429 |
+
"laxcomma": {
|
430 |
+
"active": 0,
|
431 |
+
"flagValue": -1
|
432 |
+
},
|
433 |
+
"loopfunc": {
|
434 |
+
"active": 0,
|
435 |
+
"flagValue": -1
|
436 |
+
},
|
437 |
+
"maxcomplexity": {
|
438 |
+
"active": 0,
|
439 |
+
"flagValue": 10
|
440 |
+
},
|
441 |
+
"maxdepth": {
|
442 |
+
"active": 0,
|
443 |
+
"flagValue": 3
|
444 |
+
},
|
445 |
+
"maxlen": {
|
446 |
+
"active": 0,
|
447 |
+
"flagValue": 150
|
448 |
+
},
|
449 |
+
"maxparams": {
|
450 |
+
"active": 0,
|
451 |
+
"flagValue": 3
|
452 |
+
},
|
453 |
+
"maxstatements": {
|
454 |
+
"active": 0,
|
455 |
+
"flagValue": 4
|
456 |
+
},
|
457 |
+
"mocha": {
|
458 |
+
"active": 0,
|
459 |
+
"flagValue": -1
|
460 |
+
},
|
461 |
+
"mootools": {
|
462 |
+
"active": 0,
|
463 |
+
"flagValue": -1
|
464 |
+
},
|
465 |
+
"moz": {
|
466 |
+
"active": 0,
|
467 |
+
"flagValue": -1
|
468 |
+
},
|
469 |
+
"multistr": {
|
470 |
+
"active": 0,
|
471 |
+
"flagValue": -1
|
472 |
+
},
|
473 |
+
"newcap": {
|
474 |
+
"active": 1,
|
475 |
+
"flagValue": -1
|
476 |
+
},
|
477 |
+
"noarg": {
|
478 |
+
"active": 1,
|
479 |
+
"flagValue": -1
|
480 |
+
},
|
481 |
+
"nocomma": {
|
482 |
+
"active": 0,
|
483 |
+
"flagValue": -1
|
484 |
+
},
|
485 |
+
"node": {
|
486 |
+
"active": 0,
|
487 |
+
"flagValue": -1
|
488 |
+
},
|
489 |
+
"noempty": {
|
490 |
+
"active": 0,
|
491 |
+
"flagValue": -1
|
492 |
+
},
|
493 |
+
"nonbsp": {
|
494 |
+
"active": 0,
|
495 |
+
"flagValue": -1
|
496 |
+
},
|
497 |
+
"nonew": {
|
498 |
+
"active": 1,
|
499 |
+
"flagValue": -1
|
500 |
+
},
|
501 |
+
"nonstandard": {
|
502 |
+
"active": 0,
|
503 |
+
"flagValue": -1
|
504 |
+
},
|
505 |
+
"notypeof": {
|
506 |
+
"active": 1,
|
507 |
+
"flagValue": -1
|
508 |
+
},
|
509 |
+
"noyield": {
|
510 |
+
"active": 0,
|
511 |
+
"flagValue": -1
|
512 |
+
},
|
513 |
+
"onecase": {
|
514 |
+
"active": 0,
|
515 |
+
"flagValue": -1
|
516 |
+
},
|
517 |
+
"phantom": {
|
518 |
+
"active": 0,
|
519 |
+
"flagValue": -1
|
520 |
+
},
|
521 |
+
"plusplus": {
|
522 |
+
"active": 0,
|
523 |
+
"flagValue": -1
|
524 |
+
},
|
525 |
+
"proto": {
|
526 |
+
"active": 0,
|
527 |
+
"flagValue": -1
|
528 |
+
},
|
529 |
+
"prototypejs": {
|
530 |
+
"active": 0,
|
531 |
+
"flagValue": -1
|
532 |
+
},
|
533 |
+
"qunit": {
|
534 |
+
"active": 0,
|
535 |
+
"flagValue": -1
|
536 |
+
},
|
537 |
+
"regexp": {
|
538 |
+
"active": 1,
|
539 |
+
"flagValue": -1
|
540 |
+
},
|
541 |
+
"rhino": {
|
542 |
+
"active": 0,
|
543 |
+
"flagValue": -1
|
544 |
+
},
|
545 |
+
"scripturl": {
|
546 |
+
"active": 0,
|
547 |
+
"flagValue": -1
|
548 |
+
},
|
549 |
+
"shadow": {
|
550 |
+
"active": 0,
|
551 |
+
"flagValue": -1
|
552 |
+
},
|
553 |
+
"shelljs": {
|
554 |
+
"active": 0,
|
555 |
+
"flagValue": -1
|
556 |
+
},
|
557 |
+
"singleGroups": {
|
558 |
+
"active": 0,
|
559 |
+
"flagValue": -1
|
560 |
+
},
|
561 |
+
"strict": {
|
562 |
+
"active": 0,
|
563 |
+
"flagValue": -1
|
564 |
+
},
|
565 |
+
"sub": {
|
566 |
+
"active": 0,
|
567 |
+
"flagValue": -1
|
568 |
+
},
|
569 |
+
"supernew": {
|
570 |
+
"active": 0,
|
571 |
+
"flagValue": -1
|
572 |
+
},
|
573 |
+
"typed": {
|
574 |
+
"active": 0,
|
575 |
+
"flagValue": -1
|
576 |
+
},
|
577 |
+
"undef": {
|
578 |
+
"active": 1,
|
579 |
+
"flagValue": -1
|
580 |
+
},
|
581 |
+
"unused": {
|
582 |
+
"active": 1,
|
583 |
+
"flagValue": -1
|
584 |
+
},
|
585 |
+
"varstmt": {
|
586 |
+
"active": 0,
|
587 |
+
"flagValue": -1
|
588 |
+
},
|
589 |
+
"withstmt": {
|
590 |
+
"active": 0,
|
591 |
+
"flagValue": -1
|
592 |
+
},
|
593 |
+
"worker": {
|
594 |
+
"active": 0,
|
595 |
+
"flagValue": -1
|
596 |
+
},
|
597 |
+
"wsh": {
|
598 |
+
"active": 0,
|
599 |
+
"flagValue": -1
|
600 |
+
},
|
601 |
+
"yui": {
|
602 |
+
"active": 0,
|
603 |
+
"flagValue": -1
|
604 |
+
}
|
605 |
+
},
|
606 |
+
"jsLintFlags2": {
|
607 |
+
"bitwise": {
|
608 |
+
"active": 0,
|
609 |
+
"flagValue": -1
|
610 |
+
},
|
611 |
+
"browser": {
|
612 |
+
"active": 1,
|
613 |
+
"flagValue": -1
|
614 |
+
},
|
615 |
+
"couch": {
|
616 |
+
"active": 0,
|
617 |
+
"flagValue": -1
|
618 |
+
},
|
619 |
+
"devel": {
|
620 |
+
"active": 0,
|
621 |
+
"flagValue": -1
|
622 |
+
},
|
623 |
+
"es6": {
|
624 |
+
"active": 0,
|
625 |
+
"flagValue": -1
|
626 |
+
},
|
627 |
+
"eval": {
|
628 |
+
"active": 0,
|
629 |
+
"flagValue": -1
|
630 |
+
},
|
631 |
+
"for": {
|
632 |
+
"active": 0,
|
633 |
+
"flagValue": -1
|
634 |
+
},
|
635 |
+
"maxlen": {
|
636 |
+
"active": 0,
|
637 |
+
"flagValue": 150
|
638 |
+
},
|
639 |
+
"node": {
|
640 |
+
"active": 0,
|
641 |
+
"flagValue": -1
|
642 |
+
},
|
643 |
+
"this": {
|
644 |
+
"active": 0,
|
645 |
+
"flagValue": -1
|
646 |
+
},
|
647 |
+
"white": {
|
648 |
+
"active": 0,
|
649 |
+
"flagValue": -1
|
650 |
+
}
|
651 |
+
},
|
652 |
+
"jsonAutoOutputPathEnabled": 0,
|
653 |
+
"jsonAutoOutputPathFilenamePattern": "*-min.json",
|
654 |
+
"jsonAutoOutputPathRelativePath": "",
|
655 |
+
"jsonAutoOutputPathReplace1": "",
|
656 |
+
"jsonAutoOutputPathReplace2": "",
|
657 |
+
"jsonAutoOutputPathStyle": 0,
|
658 |
+
"jsonOrderOutput": 0,
|
659 |
+
"jsonOutputStyle": 1,
|
660 |
+
"kitAutoOutputPathEnabled": 1,
|
661 |
+
"kitAutoOutputPathFilenamePattern": "*.html",
|
662 |
+
"kitAutoOutputPathRelativePath": "",
|
663 |
+
"kitAutoOutputPathReplace1": "",
|
664 |
+
"kitAutoOutputPathReplace2": "",
|
665 |
+
"kitAutoOutputPathStyle": 0,
|
666 |
+
"lessAllowInsecureImports": 0,
|
667 |
+
"lessAutoOutputPathEnabled": 1,
|
668 |
+
"lessAutoOutputPathFilenamePattern": "*.css",
|
669 |
+
"lessAutoOutputPathRelativePath": "..\/css",
|
670 |
+
"lessAutoOutputPathReplace1": "less",
|
671 |
+
"lessAutoOutputPathReplace2": "css",
|
672 |
+
"lessAutoOutputPathStyle": 2,
|
673 |
+
"lessCreateSourceMap": 0,
|
674 |
+
"lessDisableJavascript": 0,
|
675 |
+
"lessIeCompatibility": 1,
|
676 |
+
"lessOutputStyle": 0,
|
677 |
+
"lessRelativeURLS": 0,
|
678 |
+
"lessStrictImports": 0,
|
679 |
+
"lessStrictMath": 0,
|
680 |
+
"lessStrictUnits": 0,
|
681 |
+
"markdownAutoOutputPathEnabled": 1,
|
682 |
+
"markdownAutoOutputPathFilenamePattern": "*.html",
|
683 |
+
"markdownAutoOutputPathRelativePath": "",
|
684 |
+
"markdownAutoOutputPathReplace1": "",
|
685 |
+
"markdownAutoOutputPathReplace2": "",
|
686 |
+
"markdownAutoOutputPathStyle": 0,
|
687 |
+
"markdownCriticStyle": 0,
|
688 |
+
"markdownEnableFootnotes": 1,
|
689 |
+
"markdownEnableLabels": 1,
|
690 |
+
"markdownEnableSmartQuotes": 1,
|
691 |
+
"markdownEscapeLineBreaks": 0,
|
692 |
+
"markdownMaskEmailAddresses": 1,
|
693 |
+
"markdownOutputFormat": 0,
|
694 |
+
"markdownOutputStyle": 0,
|
695 |
+
"markdownParseMetadata": 1,
|
696 |
+
"markdownProcessHTML": 0,
|
697 |
+
"markdownRandomFootnoteNumbers": 0,
|
698 |
+
"markdownUseCompatibilityMode": 0,
|
699 |
+
"reloadFileURLs": 0,
|
700 |
+
"sassAutoOutputPathEnabled": 1,
|
701 |
+
"sassAutoOutputPathFilenamePattern": "*.css",
|
702 |
+
"sassAutoOutputPathRelativePath": "..\/css",
|
703 |
+
"sassAutoOutputPathReplace1": "sass",
|
704 |
+
"sassAutoOutputPathReplace2": "css",
|
705 |
+
"sassAutoOutputPathStyle": 2,
|
706 |
+
"sassCreateSourceMap": 0,
|
707 |
+
"sassDebugStyle": 0,
|
708 |
+
"sassDecimalPrecision": 10,
|
709 |
+
"sassOutputStyle": 0,
|
710 |
+
"sassUseLibsass": 0,
|
711 |
+
"shouldRunAutoprefixer": 0,
|
712 |
+
"shouldRunBless": 0,
|
713 |
+
"skippedItemsString": ".svn, .git, .hg, log, _logs, _cache, cache, logs, node_modules",
|
714 |
+
"slimAutoOutputPathEnabled": 1,
|
715 |
+
"slimAutoOutputPathFilenamePattern": "*.html",
|
716 |
+
"slimAutoOutputPathRelativePath": "",
|
717 |
+
"slimAutoOutputPathReplace1": "",
|
718 |
+
"slimAutoOutputPathReplace2": "",
|
719 |
+
"slimAutoOutputPathStyle": 0,
|
720 |
+
"slimCompileOnly": 0,
|
721 |
+
"slimLogicless": 0,
|
722 |
+
"slimOutputFormat": 0,
|
723 |
+
"slimOutputStyle": 1,
|
724 |
+
"slimRailsCompatible": 0,
|
725 |
+
"stylusAutoOutputPathEnabled": 1,
|
726 |
+
"stylusAutoOutputPathFilenamePattern": "*.css",
|
727 |
+
"stylusAutoOutputPathRelativePath": "..\/css",
|
728 |
+
"stylusAutoOutputPathReplace1": "stylus",
|
729 |
+
"stylusAutoOutputPathReplace2": "css",
|
730 |
+
"stylusAutoOutputPathStyle": 2,
|
731 |
+
"stylusCreateSourceMap": 0,
|
732 |
+
"stylusDebugStyle": 0,
|
733 |
+
"stylusImportCSS": 0,
|
734 |
+
"stylusOutputStyle": 0,
|
735 |
+
"stylusResolveRelativeURLS": 0,
|
736 |
+
"typescriptAutoOutputPathEnabled": 1,
|
737 |
+
"typescriptAutoOutputPathFilenamePattern": "*.js",
|
738 |
+
"typescriptAutoOutputPathRelativePath": "\/js",
|
739 |
+
"typescriptAutoOutputPathReplace1": "",
|
740 |
+
"typescriptAutoOutputPathReplace2": "",
|
741 |
+
"typescriptAutoOutputPathStyle": 2,
|
742 |
+
"typescriptCreateDeclarationFile": 0,
|
743 |
+
"typescriptCreateSourceMap": 0,
|
744 |
+
"typescriptJSXMode": 0,
|
745 |
+
"typescriptMinifyOutput": 0,
|
746 |
+
"typescriptModuleResolutionType": 0,
|
747 |
+
"typescriptModuleType": 0,
|
748 |
+
"typescriptNoImplicitAny": 0,
|
749 |
+
"typescriptPreserveConstEnums": 0,
|
750 |
+
"typescriptRemoveComments": 0,
|
751 |
+
"typescriptSuppressImplicitAnyIndexErrors": 0,
|
752 |
+
"typescriptTargetECMAVersion": 0,
|
753 |
+
"uglifyDefinesString": "",
|
754 |
+
"uglifyFlags2": {
|
755 |
+
"ascii-only": {
|
756 |
+
"active": 0,
|
757 |
+
"flagValue": -1
|
758 |
+
},
|
759 |
+
"bare-returns": {
|
760 |
+
"active": 0,
|
761 |
+
"flagValue": -1
|
762 |
+
},
|
763 |
+
"booleans": {
|
764 |
+
"active": 1,
|
765 |
+
"flagValue": -1
|
766 |
+
},
|
767 |
+
"bracketize": {
|
768 |
+
"active": 0,
|
769 |
+
"flagValue": -1
|
770 |
+
},
|
771 |
+
"cascade": {
|
772 |
+
"active": 1,
|
773 |
+
"flagValue": -1
|
774 |
+
},
|
775 |
+
"comments": {
|
776 |
+
"active": 1,
|
777 |
+
"flagValue": -1
|
778 |
+
},
|
779 |
+
"comparisons": {
|
780 |
+
"active": 1,
|
781 |
+
"flagValue": -1
|
782 |
+
},
|
783 |
+
"compress": {
|
784 |
+
"active": 1,
|
785 |
+
"flagValue": -1
|
786 |
+
},
|
787 |
+
"conditionals": {
|
788 |
+
"active": 1,
|
789 |
+
"flagValue": -1
|
790 |
+
},
|
791 |
+
"dead_code": {
|
792 |
+
"active": 0,
|
793 |
+
"flagValue": -1
|
794 |
+
},
|
795 |
+
"drop_console": {
|
796 |
+
"active": 0,
|
797 |
+
"flagValue": -1
|
798 |
+
},
|
799 |
+
"drop_debugger": {
|
800 |
+
"active": 1,
|
801 |
+
"flagValue": -1
|
802 |
+
},
|
803 |
+
"eval": {
|
804 |
+
"active": 0,
|
805 |
+
"flagValue": -1
|
806 |
+
},
|
807 |
+
"evaluate": {
|
808 |
+
"active": 1,
|
809 |
+
"flagValue": -1
|
810 |
+
},
|
811 |
+
"hoist_funs": {
|
812 |
+
"active": 1,
|
813 |
+
"flagValue": -1
|
814 |
+
},
|
815 |
+
"hoist_vars": {
|
816 |
+
"active": 0,
|
817 |
+
"flagValue": -1
|
818 |
+
},
|
819 |
+
"if_return": {
|
820 |
+
"active": 1,
|
821 |
+
"flagValue": -1
|
822 |
+
},
|
823 |
+
"indent-level": {
|
824 |
+
"active": 0,
|
825 |
+
"flagValue": 4
|
826 |
+
},
|
827 |
+
"indent-start": {
|
828 |
+
"active": 0,
|
829 |
+
"flagValue": 0
|
830 |
+
},
|
831 |
+
"inline-script": {
|
832 |
+
"active": 0,
|
833 |
+
"flagValue": -1
|
834 |
+
},
|
835 |
+
"join_vars": {
|
836 |
+
"active": 1,
|
837 |
+
"flagValue": -1
|
838 |
+
},
|
839 |
+
"keep_fargs": {
|
840 |
+
"active": 0,
|
841 |
+
"flagValue": -1
|
842 |
+
},
|
843 |
+
"keep_fnames": {
|
844 |
+
"active": 0,
|
845 |
+
"flagValue": -1
|
846 |
+
},
|
847 |
+
"loops": {
|
848 |
+
"active": 1,
|
849 |
+
"flagValue": -1
|
850 |
+
},
|
851 |
+
"mangle": {
|
852 |
+
"active": 1,
|
853 |
+
"flagValue": -1
|
854 |
+
},
|
855 |
+
"max-line-len": {
|
856 |
+
"active": 1,
|
857 |
+
"flagValue": 32000
|
858 |
+
},
|
859 |
+
"negate_iife": {
|
860 |
+
"active": 1,
|
861 |
+
"flagValue": -1
|
862 |
+
},
|
863 |
+
"properties": {
|
864 |
+
"active": 1,
|
865 |
+
"flagValue": -1
|
866 |
+
},
|
867 |
+
"pure_getters": {
|
868 |
+
"active": 0,
|
869 |
+
"flagValue": -1
|
870 |
+
},
|
871 |
+
"quote-keys": {
|
872 |
+
"active": 0,
|
873 |
+
"flagValue": -1
|
874 |
+
},
|
875 |
+
"screw-ie8": {
|
876 |
+
"active": 0,
|
877 |
+
"flagValue": -1
|
878 |
+
},
|
879 |
+
"semicolons": {
|
880 |
+
"active": 1,
|
881 |
+
"flagValue": -1
|
882 |
+
},
|
883 |
+
"sequences": {
|
884 |
+
"active": 1,
|
885 |
+
"flagValue": -1
|
886 |
+
},
|
887 |
+
"sort": {
|
888 |
+
"active": 0,
|
889 |
+
"flagValue": -1
|
890 |
+
},
|
891 |
+
"space-colon": {
|
892 |
+
"active": 1,
|
893 |
+
"flagValue": -1
|
894 |
+
},
|
895 |
+
"toplevel": {
|
896 |
+
"active": 0,
|
897 |
+
"flagValue": -1
|
898 |
+
},
|
899 |
+
"unsafe": {
|
900 |
+
"active": 0,
|
901 |
+
"flagValue": -1
|
902 |
+
},
|
903 |
+
"unused": {
|
904 |
+
"active": 0,
|
905 |
+
"flagValue": -1
|
906 |
+
},
|
907 |
+
"warnings": {
|
908 |
+
"active": 0,
|
909 |
+
"flagValue": -1
|
910 |
+
},
|
911 |
+
"width": {
|
912 |
+
"active": 1,
|
913 |
+
"flagValue": 80
|
914 |
+
}
|
915 |
+
},
|
916 |
+
"uglifyReservedNamesString": "$",
|
917 |
+
"websiteRelativeRoot": ""
|
918 |
+
},
|
919 |
+
"settingsFileVersion": "2"
|
920 |
+
}
|
functions/functions.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Returns the main instance of Storefront_Sticky_Add_to_Cart to prevent the need to use globals.
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @return object Storefront_Sticky_Add_to_Cart
|
7 |
+
*/
|
8 |
+
function storefront_sticky_add_to_cart() {
|
9 |
+
return Storefront_Sticky_Add_to_Cart::instance();
|
10 |
+
} // End Storefront_Sticky_Add_to_Cart()
|
index.php
CHANGED
File without changes
|
languages/storefront-sticky-add-to-cart.pot
CHANGED
File without changes
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: jameskoster, woothemes
|
3 |
Tags: woocommerce, ecommerce, storefront, sticky
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 4.9
|
6 |
-
Stable tag: 1.1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -39,6 +39,9 @@ It simply takes up too much valuable screen real estate. You can display it on m
|
|
39 |
|
40 |
== Changelog ==
|
41 |
|
|
|
|
|
|
|
42 |
= 1.1.8 - 20.12.2017 =
|
43 |
* Fix - Undefined index error for specific stock settings.
|
44 |
|
2 |
Contributors: jameskoster, woothemes
|
3 |
Tags: woocommerce, ecommerce, storefront, sticky
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 4.9
|
6 |
+
Stable tag: 1.1.9
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
39 |
|
40 |
== Changelog ==
|
41 |
|
42 |
+
= 1.1.9 - 06.27.2018 =
|
43 |
+
* Dev - Disable plugin if running Storefront 2.3+. This plugin is now included in Storefront core.
|
44 |
+
|
45 |
= 1.1.8 - 20.12.2017 =
|
46 |
* Fix - Undefined index error for specific stock settings.
|
47 |
|
storefront-sticky-add-to-cart.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: Storefront Sticky Add to Cart
|
4 |
* Plugin URI: https://wordpress.org/plugins/storefront-sticky-add-to-cart/
|
5 |
* Description: Adds a sticky add-to-cart bar in single product pages that is revealed as the user scrolls down the page.
|
6 |
-
* Version: 1.1.
|
7 |
* Author: WooThemes
|
8 |
* Author URI: http://woothemes.com/
|
9 |
-
* Requires at least: 4.0
|
10 |
-
* Tested up to: 4.
|
11 |
*
|
12 |
* Text Domain: storefront-sticky-add-to-cart
|
13 |
* Domain Path: /languages/
|
@@ -21,311 +21,21 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
21 |
exit; // Exit if accessed directly.
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Returns the main instance of Storefront_Sticky_Add_to_Cart to prevent the need to use globals.
|
27 |
-
*
|
28 |
-
* @since 1.0.0
|
29 |
-
* @return object Storefront_Sticky_Add_to_Cart
|
30 |
-
*/
|
31 |
-
function storefront_sticky_add_to_cart() {
|
32 |
-
return Storefront_Sticky_Add_to_Cart::instance();
|
33 |
-
} // End Storefront_Sticky_Add_to_Cart()
|
34 |
-
|
35 |
-
storefront_sticky_add_to_cart();
|
36 |
-
|
37 |
/**
|
38 |
-
*
|
39 |
*
|
40 |
-
* @
|
41 |
-
* @
|
42 |
-
* @since 1.0.0
|
43 |
-
* @package Storefront_Sticky_Add_to_Cart
|
44 |
*/
|
45 |
-
|
46 |
-
|
47 |
-
* Storefront_Sticky_Add_to_Cart The single instance of Storefront_Sticky_Add_to_Cart.
|
48 |
-
*
|
49 |
-
* @var object
|
50 |
-
* @access private
|
51 |
-
* @since 1.0.0
|
52 |
-
*/
|
53 |
-
private static $_instance = null;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* The token.
|
57 |
-
*
|
58 |
-
* @var string
|
59 |
-
* @access public
|
60 |
-
* @since 1.0.0
|
61 |
-
*/
|
62 |
-
public $token;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* The version number.
|
66 |
-
*
|
67 |
-
* @var string
|
68 |
-
* @access public
|
69 |
-
* @since 1.0.0
|
70 |
-
*/
|
71 |
-
public $version;
|
72 |
-
|
73 |
-
/**
|
74 |
-
* The admin object.
|
75 |
-
*
|
76 |
-
* @var object
|
77 |
-
* @access public
|
78 |
-
* @since 1.0.0
|
79 |
-
*/
|
80 |
-
public $admin;
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Constructor function.
|
84 |
-
*
|
85 |
-
* @access public
|
86 |
-
* @since 1.0.0
|
87 |
-
* @return void
|
88 |
-
*/
|
89 |
-
public function __construct() {
|
90 |
-
$this->token = 'storefront-sticky-add-to-cart';
|
91 |
-
$this->plugin_url = plugin_dir_url( __FILE__ );
|
92 |
-
$this->plugin_path = plugin_dir_path( __FILE__ );
|
93 |
-
$this->version = '1.1.8';
|
94 |
-
|
95 |
-
register_activation_hook( __FILE__, array( $this, 'install' ) );
|
96 |
-
|
97 |
-
add_action( 'init', array( $this, 'ssatc_load_plugin_textdomain' ) );
|
98 |
-
|
99 |
-
add_action( 'init', array( $this, 'ssatc_setup' ) );
|
100 |
-
|
101 |
-
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'ssatc_plugin_links' ) );
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Main Storefront_Sticky_Add_to_Cart Instance
|
106 |
-
*
|
107 |
-
* Ensures only one instance of Storefront_Sticky_Add_to_Cart is loaded or can be loaded.
|
108 |
-
*
|
109 |
-
* @since 1.0.0
|
110 |
-
* @static
|
111 |
-
* @see Storefront_Sticky_Add_to_Cart()
|
112 |
-
* @return Main Storefront_Sticky_Add_to_Cart instance
|
113 |
-
*/
|
114 |
-
public static function instance() {
|
115 |
-
if ( is_null( self::$_instance ) ) {
|
116 |
-
self::$_instance = new self();
|
117 |
-
}
|
118 |
-
|
119 |
-
return self::$_instance;
|
120 |
-
} // End instance()
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Load the localisation file.
|
124 |
-
*
|
125 |
-
* @access public
|
126 |
-
* @since 1.0.0
|
127 |
-
* @return void
|
128 |
-
*/
|
129 |
-
public function ssatc_load_plugin_textdomain() {
|
130 |
-
load_plugin_textdomain( 'storefront-sticky-add-to-cart', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Cloning is forbidden.
|
135 |
-
*
|
136 |
-
* @since 1.0.0
|
137 |
-
*/
|
138 |
-
public function __clone() {
|
139 |
-
_doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?' ), '1.0.0' );
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Unserializing instances of this class is forbidden.
|
144 |
-
*
|
145 |
-
* @since 1.0.0
|
146 |
-
*/
|
147 |
-
public function __wakeup() {
|
148 |
-
_doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin’ huh?' ), '1.0.0' );
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Plugin page links
|
153 |
-
*
|
154 |
-
* @param array $links the plugin action links.
|
155 |
-
* @since 1.0.0
|
156 |
-
*/
|
157 |
-
public function ssatc_plugin_links( $links ) {
|
158 |
-
$plugin_links = array(
|
159 |
-
'<a href="https://wordpress.org/support/plugin/storefront-sticky-add-to-cart">' . esc_attr__( 'Support', 'storefront-sticky-add-to-cart' ) . '</a>',
|
160 |
-
);
|
161 |
-
|
162 |
-
return array_merge( $plugin_links, $links );
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Installation.
|
167 |
-
* Runs on activation. Logs the version number.
|
168 |
-
*
|
169 |
-
* @access public
|
170 |
-
* @since 1.0.0
|
171 |
-
* @return void
|
172 |
-
*/
|
173 |
-
public function install() {
|
174 |
-
$this->_log_version_number();
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Log the plugin version number.
|
179 |
-
*
|
180 |
-
* @access private
|
181 |
-
* @since 1.0.0
|
182 |
-
* @return void
|
183 |
-
*/
|
184 |
-
private function _log_version_number() {
|
185 |
-
// Log the version number.
|
186 |
-
update_option( $this->token . '-version', $this->version );
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Setup all the things.
|
191 |
-
*
|
192 |
-
* @return void
|
193 |
-
*/
|
194 |
-
public function ssatc_setup() {
|
195 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'ssatc_script' ), 999 );
|
196 |
-
add_action( 'wp', array( $this, 'ssatc_load_add_to_cart_bar' ), 999 );
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Enqueue CSS and custom styles.
|
201 |
-
*
|
202 |
-
* @since 1.0.0
|
203 |
-
* @return void
|
204 |
-
*/
|
205 |
-
public function ssatc_script() {
|
206 |
-
$theme = wp_get_theme();
|
207 |
-
wp_enqueue_style( 'ssatc-styles', plugins_url( '/assets/css/style.css', __FILE__ ), '', get_option( 'storefront-sticky-add-to-cart-version' ) );
|
208 |
-
wp_register_script( 'waypoints', plugins_url( '/assets/js/jquery.waypoints.min.js', __FILE__ ), array( 'jquery' ), '4.0.0' );
|
209 |
-
wp_register_script( 'waypoints-init', plugins_url( '/assets/js/waypoints.init.min.js', __FILE__ ), array( 'jquery' ) );
|
210 |
-
wp_register_script( 'ssatc-variable', plugins_url( '/assets/js/variable.min.js', __FILE__ ), array( 'jquery' ) );
|
211 |
|
212 |
-
|
213 |
-
|
|
|
214 |
|
215 |
-
|
216 |
-
$accent_color = get_theme_mod( 'storefront_accent_color' );
|
217 |
-
$text_color = get_theme_mod( 'storefront_text_color' );
|
218 |
-
|
219 |
-
$ssatc_style = '
|
220 |
-
.ssatc-sticky-add-to-cart {
|
221 |
-
background-color: ' . $bg_color . ';
|
222 |
-
color: ' . $text_color . ';
|
223 |
-
}
|
224 |
-
|
225 |
-
.ssatc-sticky-add-to-cart a:not(.button) {
|
226 |
-
color: ' . $accent_color . ';
|
227 |
-
}';
|
228 |
-
|
229 |
-
wp_add_inline_style( 'ssatc-styles', $ssatc_style );
|
230 |
-
}
|
231 |
}
|
|
|
232 |
|
233 |
-
|
234 |
-
* Hooks the add to cart bar into DOM
|
235 |
-
*/
|
236 |
-
public function ssatc_load_add_to_cart_bar() {
|
237 |
-
add_action( 'storefront_after_footer', array( $this, 'ssatc_add_to_cart_bar' ), 999 );
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Display the current product image
|
242 |
-
*
|
243 |
-
* @return void
|
244 |
-
*/
|
245 |
-
public function ssatc_product_image() {
|
246 |
-
global $post;
|
247 |
-
|
248 |
-
if ( has_post_thumbnail() ) {
|
249 |
-
|
250 |
-
$image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
|
251 |
-
$image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_catalog' ), array(
|
252 |
-
'title' => $image_title,
|
253 |
-
'alt' => $image_title,
|
254 |
-
) );
|
255 |
-
|
256 |
-
echo wp_kses_post( apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image ), $post->ID ) );
|
257 |
-
|
258 |
-
} else {
|
259 |
-
|
260 |
-
echo wp_kses_post( apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="%s" />', wc_placeholder_img_src(), __( 'Placeholder', 'storefront-sticky-add-to-cart' ) ), $post->ID ) );
|
261 |
-
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* Display the add to cart bar
|
267 |
-
*
|
268 |
-
* @return void
|
269 |
-
*/
|
270 |
-
function ssatc_add_to_cart_bar() {
|
271 |
-
global $product;
|
272 |
-
|
273 |
-
// Only execute if WooCommerce is installed.
|
274 |
-
if ( class_exists( 'WooCommerce' ) ) {
|
275 |
-
|
276 |
-
// And if we're on a product page.
|
277 |
-
if ( is_product() ) {
|
278 |
-
$availability = $product->get_availability();
|
279 |
-
$ssatc = new Storefront_Sticky_Add_to_Cart();
|
280 |
-
$availability_html = empty( $availability['availability'] ) ? '' : '<span class="stock ' . esc_attr( $availability['class'] ) . '">' . wp_kses_post( $availability['availability'] ) . '</span>';
|
281 |
-
|
282 |
-
// And if the product isn't variable or grouped.
|
283 |
-
wp_enqueue_script( 'waypoints' );
|
284 |
-
wp_enqueue_script( 'waypoints-init' );
|
285 |
-
|
286 |
-
?>
|
287 |
-
<section class="ssatc-sticky-add-to-cart animated">
|
288 |
-
<div class="col-full">
|
289 |
-
<?php
|
290 |
-
if ( version_compare( WC_VERSION, '2.7.0', '<' ) ) {
|
291 |
-
$rating_html = $product->get_rating_html();
|
292 |
-
} else {
|
293 |
-
$rating_html = wc_get_rating_html( $product->get_average_rating() );
|
294 |
-
}
|
295 |
-
|
296 |
-
$ssatc->ssatc_product_image();
|
297 |
-
echo '<div class="ssatc-content">';
|
298 |
-
echo esc_attr__( 'You\'re viewing:', 'storefront-sticky-add-to-cart' ) . ' <strong>' . get_the_title() . '</strong><br />';
|
299 |
-
echo '<span class="price">' . wp_kses_post( $product->get_price_html() ) . '</span> ' . wp_kses_post( $rating_html );
|
300 |
-
echo wp_kses_post( apply_filters( 'woocommerce_stock_html', $availability_html, array_key_exists( 'availability', $availability ) ? $availability['availability'] : '', $product ) );
|
301 |
-
|
302 |
-
ob_start();
|
303 |
-
|
304 |
-
if ( $product->is_type( 'simple' ) ) {
|
305 |
-
echo '<a href="' . esc_url( $product->add_to_cart_url() ) . '" class="button alt">' . esc_attr( $product->single_add_to_cart_text() ) . '</a>';
|
306 |
-
} else {
|
307 |
-
echo '<a class="button alt variable">' . esc_attr__( 'Select options', 'storefront-sticky-add-to-cart' ) . '</a>';
|
308 |
-
wp_enqueue_script( 'ssatc-variable' );
|
309 |
-
}
|
310 |
-
|
311 |
-
if ( class_exists( 'WC_Catalog_Restrictions' ) ) {
|
312 |
-
if ( ! WC_Catalog_Restrictions_Filters::instance()->user_can_purchase( $product ) ) {
|
313 |
-
ob_end_clean();
|
314 |
-
global $wc_cvo;
|
315 |
-
$html = apply_filters( 'catalog_visibility_alternate_add_to_cart_button', do_shortcode( wpautop( wptexturize( $wc_cvo->setting( 'wc_cvo_s_price_text' ) ) ) ) );
|
316 |
-
|
317 |
-
echo $html;
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
ob_end_flush();
|
322 |
-
|
323 |
-
echo '</div>';
|
324 |
-
?>
|
325 |
-
</div>
|
326 |
-
</section>
|
327 |
-
<?php
|
328 |
-
}
|
329 |
-
}
|
330 |
-
}
|
331 |
-
} // End Class
|
3 |
* Plugin Name: Storefront Sticky Add to Cart
|
4 |
* Plugin URI: https://wordpress.org/plugins/storefront-sticky-add-to-cart/
|
5 |
* Description: Adds a sticky add-to-cart bar in single product pages that is revealed as the user scrolls down the page.
|
6 |
+
* Version: 1.1.9
|
7 |
* Author: WooThemes
|
8 |
* Author URI: http://woothemes.com/
|
9 |
+
* Requires at least: 4.0
|
10 |
+
* Tested up to: 4.9
|
11 |
*
|
12 |
* Text Domain: storefront-sticky-add-to-cart
|
13 |
* Domain Path: /languages/
|
21 |
exit; // Exit if accessed directly.
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
/**
|
25 |
+
* Only load plugin if Storefront version is under 2.3.0.
|
26 |
*
|
27 |
+
* @since 1.1.9
|
28 |
+
* @return void
|
|
|
|
|
29 |
*/
|
30 |
+
function storefront_sticky_add_to_cart_init() {
|
31 |
+
global $storefront_version;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
if ( class_exists( 'Storefront' ) && version_compare( $storefront_version, '2.3.0', '<' ) ) {
|
34 |
+
require 'classes/class-storefront-sticky-add-to-cart.php';
|
35 |
+
require 'functions/functions.php';
|
36 |
|
37 |
+
storefront_sticky_add_to_cart();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
+
} // end storefront_sticky_add_to_cart_init()
|
40 |
|
41 |
+
add_action( 'after_setup_theme', 'storefront_sticky_add_to_cart_init' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|