Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial a11y improvements #45

Merged
merged 1 commit into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions css/foxyshop.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ http://www.foxy-shop.com/documentation/theme-customization/

/* Breadcrumbs Colors */
#foxyshop_breadcrumbs {
background-color: #FBEEB2;
border: 1px solid #E3CD69;
background-color: #FFF5C9;
border: 1px solid #ECDC93;
}

/* border color for images */
Expand Down Expand Up @@ -61,6 +61,9 @@ http://www.foxy-shop.com/documentation/theme-customization/
font-family: Arial;
font-size: 12px;
}
.foxyshop_button:visited {
color: #fff;
}
.foxyshop_button:hover {
background-color: #591b62;
color: #fff;
Expand Down Expand Up @@ -94,7 +97,7 @@ http://www.foxy-shop.com/documentation/theme-customization/
}
.foxyshop_slideshow_title {
font-size: 11px;
color: #ABABAB;
color: #555555;
}
.foxyshop_slideshow li img {
border: 1px solid #7D268A;
Expand All @@ -105,8 +108,8 @@ http://www.foxy-shop.com/documentation/theme-customization/

/* featured product settings */
.foxyshop_featured_product_list .foxyshop_product_box {
background-color: #FBEEB2;
border: 1px solid #E3CD69;
background-color: #FFF5C9;
border: 1px solid #ECDC93;
}

/* related product settings (gray default) */
Expand All @@ -129,8 +132,8 @@ http://www.foxy-shop.com/documentation/theme-customization/

/* Inventory Colors and Settings */
.foxyshop_stock_alert {
background-color: #FBEEB2;
border: 1px solid #E3CD69;
background-color: #FFF5C9;
border: 1px solid #ECDC93;
padding: 10px;
margin-bottom: 20px;
}
Expand All @@ -145,7 +148,7 @@ http://www.foxy-shop.com/documentation/theme-customization/


/* generic settings below */
#foxyshop_container .clr, .foxyshop_category_widget .clr { clear: both; height: 1px; }
#foxyshop_container .clr, .foxyshop_container .clr, .foxyshop_category_widget .clr { clear: both; height: 1px; }



Expand All @@ -161,6 +164,9 @@ http://www.foxy-shop.com/documentation/theme-customization/
margin: 0 10px 0 0;
list-style: none;
}
#foxyshop_breadcrumbs a {
color:#4F4F4F;
}


/* ---------- Product Category Page ------------ */
Expand Down
25 changes: 12 additions & 13 deletions helperfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ function foxyshop_product_variations($showQuantity = 0, $showPriceVariations = t
$variationName = substr($variationName, strpos($variationName,"{")+1, strpos($variationName,"}") - (strpos($variationName,"{")+1));
}


$className = "variation-" . sanitize_title_with_dashes($variationName);
$writeBeforeVariation = $beforeVariation ? str_replace("%c", $className, $beforeVariation) . "\n" : "";
$writeAfterVariation = $afterVariation ? $afterVariation . "\n" : "";
Expand Down Expand Up @@ -439,8 +438,8 @@ function foxyshop_product_variations($showQuantity = 0, $showPriceVariations = t
//Radio Buttons
} elseif ($variationType == "radio") {
$write .= $writeBeforeVariation;
$write .= '<div class="foxyshop_radio_wrapper">';
$write .= '<div class="foxyshop_radio_title' . $dkeyclass . '"'. $dkey . '>' . str_replace("_", " ", $variationDisplayName) . '</div>';
$write .= '<div role="radiogroup" aria-labelledby="' . esc_attr($product['code']) . '_' . $i . '" class="foxyshop_radio_wrapper">';
$write .= '<div id="' . esc_attr($product['code']) . '_' . $i . '" class="foxyshop_radio_title' . $dkeyclass . '"'. $dkey . '>' . str_replace("_", " ", $variationDisplayName) . '</div>';
$write .= foxyshop_run_variations($variationValue, $variationName, $showPriceVariations, $variationType, $dkey, $dkeyclass, $i, $className);
$write .= '</div>';
$write .= $writeAfterVariation;
Expand Down Expand Up @@ -640,9 +639,9 @@ function foxyshop_quantity($qty = 1, $beforeVariation = "", $afterVariation = '<
$write .= '<label class="foxyshop_quantity" for="quantity_' . $product['id'] . '">' . $quantity_title . '</label>'."\n";
if ($product['quantity_max_original'] > 0) {
if ($numberPrefix) {
$write .= '<select class="foxyshop_quantity foxyshop_addon_fields" originalname="quantity" name="x:quantity" rel="' . $numberPrefix . '">';
$write .= '<select class="foxyshop_quantity foxyshop_addon_fields" originalname="quantity" name="x:quantity" rel="' . $numberPrefix . '" id="quantity_' . $product['id'] . '">';
} else {
$write .= '<select class="foxyshop_quantity" name="quantity">';
$write .= '<select class="foxyshop_quantity" name="quantity" id="quantity_' . $product['id'] . '">';
}
for ($i=($product['quantity_min'] > 0 ? $product['quantity_min'] : 1); $i <= $product['quantity_max_original']; $i++) {
$write .= '<option value="' . $i . foxyshop_get_verification('quantity',$i) . '">' . $i . '</option>'."\n";
Expand Down Expand Up @@ -843,7 +842,7 @@ function foxyshop_build_image_slideshow($slideshow_type = "prettyPhoto", $use_in
echo '<div class="foxyshop_product_image_holder">'."\n";

if ($use_link) echo '<a href="' . foxyshop_get_main_image('large') . '" rel="foxyshop_gallery' . ($imagecount > 1 ? '[' . $product['id'] . ']' : '') . '" title="' . esc_attr(apply_filters('foxyshop_image_link_title', '')) . '">';
echo '<img src="' . foxyshop_get_main_image('medium') . '" id="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image('title')) . '" title="" />';
echo '<img src="' . foxyshop_get_main_image('medium') . '" class="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image('title')) . '" title="" />';
if ($use_link) echo "</a>\n";

echo "</div>\n";
Expand Down Expand Up @@ -898,7 +897,7 @@ function foxyshop_build_image_slideshow($slideshow_type = "prettyPhoto", $use_in
echo '<div class="foxyshop_product_image_holder magnific-gallery">'."\n";

if ($use_link) echo '<a href="' . foxyshop_get_main_image('large') . '" rel="foxyshop_gallery' . ($imagecount > 1 ? '[' . $product['id'] . ']' : '') . '" title="' . esc_attr(foxyshop_get_main_image('title')) . '">';
echo '<img src="' . foxyshop_get_main_image('medium') . '" id="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image('title')) . '" title="" />';
echo '<img src="' . foxyshop_get_main_image('medium') . '" class="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image('title')) . '" title="" />';
if ($use_link) echo "</a>\n";

echo "</div>\n";
Expand Down Expand Up @@ -930,7 +929,7 @@ function foxyshop_build_image_slideshow($slideshow_type = "prettyPhoto", $use_in
echo '<div class="foxyshop_product_image_holder">'."\n";

if ($use_link) echo '<a href="' . foxyshop_get_main_image('large') . '" rel="foxyshop_gallery' . ($imagecount > 1 ? '[' . $product['id'] . ']' : '') . '" title="' . esc_attr(apply_filters('foxyshop_image_link_title', '')) . '">';
echo '<img src="' . foxyshop_get_main_image('medium') . '" id="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image('title')) . '" title="" />';
echo '<img src="' . foxyshop_get_main_image('medium') . '" class="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image('title')) . '" title="" />';
if ($use_link) echo "</a>\n";

echo "</div>\n";
Expand Down Expand Up @@ -960,7 +959,7 @@ function foxyshop_cloudzoom_image_change(new_ikey) {
echo '<div class="foxyshop_product_image_holder">'."\n";

if ($use_link) echo '<a href="' . foxyshop_get_main_image("full") . '" id="foxyshop_main_product_image_link_' . $product['id'] . '" class="cloud-zoom" rel="adjustX: 10, adjustY:-4" title="' . esc_attr(apply_filters('foxyshop_image_link_title', '')) . '">';
echo '<img src="' . foxyshop_get_main_image("medium") . '" id="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image("title")) . '" title="" />';
echo '<img src="' . foxyshop_get_main_image("medium") . '" class="foxyshop_main_product_image" alt="' . esc_attr(foxyshop_get_main_image("title")) . '" title="" />';
if ($use_link) echo "</a>\n";

echo "</div>\n";
Expand Down Expand Up @@ -1192,7 +1191,7 @@ function foxyshop_breadcrumbs($sep = " &raquo; ", $product_fallback = "&laquo; B
$url = get_term_link($terminfo, "foxyshop_categories");
$write1 .= '<li class="foxyshop_breadcrumb_' . $terminfo->term_id . '"><a href="' . $url . '">' . str_replace("_","",$terminfo->name) . '</a></li>';
} else {
$write1 .= '<li class="foxyshop_breadcrumb_' . $terminfo->term_id . ' foxyshop_breadcrumb_current">' . str_replace("_","",$terminfo->name) . '</li>';
$write1 .= '<li class="foxyshop_breadcrumb_' . $terminfo->term_id . ' foxyshop_breadcrumb_current" aria-current="page">' . str_replace("_","",$terminfo->name) . '</li>';
}
}
//Put product at end if this is a product page
Expand All @@ -1201,11 +1200,11 @@ function foxyshop_breadcrumbs($sep = " &raquo; ", $product_fallback = "&laquo; B
$write1 .= '<li>'.$post->post_title.'</li>';
}

if ($write1) echo '<ul id="foxyshop_breadcrumbs">' . $write1 . apply_filters('foxyshop_breadcrumb_nofloat', '<li style="float: none; text-indent: -99999px; width: 1px; margin: 0;">-</li>') . '</ul>';
if ($write1) echo '<ul id="foxyshop_breadcrumbs" aria-label="Breadcrumb">' . $write1 . apply_filters('foxyshop_breadcrumb_nofloat', '<li style="float: none; text-indent: -99999px; width: 1px; margin: 0;">-</li>') . '</ul>';

//Product Fallback
} elseif ($post->ID && $product_fallback != "") {
echo '<ul id="foxyshop_breadcrumbs"><li><a href="' . get_bloginfo('url') . FOXYSHOP_URL_BASE . '/' . apply_filters('foxyshop_template_redirect_product_slug', FOXYSHOP_PRODUCTS_SLUG) . '/">'. $product_fallback . '</a></li>' . apply_filters('foxyshop_breadcrumb_nofloat', '<li style="float: none; text-indent: -99999px; width: 1px; margin: 0;">-</li>') . '</ul>';
echo '<ul id="foxyshop_breadcrumbs" aria-label="Breadcrumb"><li><a href="' . get_bloginfo('url') . FOXYSHOP_URL_BASE . '/' . apply_filters('foxyshop_template_redirect_product_slug', FOXYSHOP_PRODUCTS_SLUG) . '/">'. $product_fallback . '</a></li>' . apply_filters('foxyshop_breadcrumb_nofloat', '<li style="float: none; text-indent: -99999px; width: 1px; margin: 0;">-</li>') . '</ul>';
}

}
Expand Down Expand Up @@ -1241,7 +1240,7 @@ function foxyshop_inventory_management($alertMessage = "There are %c of these it
}
if ($stockStatus == -1 && !$allowBackOrder) {
echo 'jQuery(document).ready(function($){'."\n";
echo '$("#foxyshop_product_form_' . $product['id'] . ' #productsubmit").attr("disabled","disabled").addClass("foxyshop_disabled");'."\n";
echo '$("#foxyshop_product_form_' . $product['id'] . ' .productsubmit").attr("disabled","disabled").addClass("foxyshop_disabled");'."\n";
echo '});'."\n";
}
echo '</script>'."\n";
Expand Down
25 changes: 13 additions & 12 deletions js/variation.process.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jQuery(document).ready(function($){
//Plugin Function Here
if (typeof window.foxyshop_before_image_change == 'function') foxyshop_before_image_change(new_ikey);

$(parentForm + " #foxyshop_main_product_image").attr("src",ikey[new_ikey][2]).attr("alt",ikey[new_ikey][4]).parent().attr("href",ikey[new_ikey][3]);
$(parentForm + " .foxyshop_main_product_image").attr("src",ikey[new_ikey][2]).attr("alt",ikey[new_ikey][4]).parent().attr("href",ikey[new_ikey][3]);

//Cloud-zoom
if (typeof window.foxyshop_cloudzoom_image_change == 'function') {
Expand Down Expand Up @@ -184,20 +184,20 @@ jQuery(document).ready(function($){
$("#fs_quantity_max_" + current_product_id).remove();
}
if (newcount > 0 && newcount <= newalert) {
$(parentForm + " .foxyshop_stock_alert").removeClass("foxyshop_out_of_stock").html(update_inventory_alert_language(arr_foxyshop_inventory_stock_alert[current_product_id],newcount,inventory_code)).show();
$(parentForm + " #productsubmit").removeAttr("disabled").removeClass("foxyshop_disabled");
$(parentForm + " .foxyshop_stock_alert").removeClass("foxyshop_out_of_stock").html(update_inventory_alert_language(arr_foxyshop_inventory_stock_alert[current_product_id],newcount,inventory_code,$('#fs_name_' + current_product_id).val())).show();
$(parentForm + " .productsubmit").removeAttr("disabled").removeClass("foxyshop_disabled");
} else if (newcount <= 0) {
$(parentForm + " .foxyshop_stock_alert").addClass("foxyshop_out_of_stock").html(update_inventory_alert_language(arr_foxyshop_inventory_stock_none[current_product_id],inventory_match_count,inventory_code)).show();
if (!foxyshop_allow_backorder) $(parentForm + " #productsubmit").attr("disabled","disabled").addClass("foxyshop_disabled");
$(parentForm + " .foxyshop_stock_alert").addClass("foxyshop_out_of_stock").html(update_inventory_alert_language(arr_foxyshop_inventory_stock_none[current_product_id],inventory_match_count,inventory_code,$('#fs_name_' + current_product_id).val())).show();
if (!foxyshop_allow_backorder) $(parentForm + " .productsubmit").attr("disabled","disabled").addClass("foxyshop_disabled");
} else {
$(parentForm + " #productsubmit").removeAttr("disabled").removeClass("foxyshop_disabled");
$(parentForm + " .productsubmit").removeAttr("disabled").removeClass("foxyshop_disabled");
$(parentForm + " .foxyshop_stock_alert").hide();
}
} else if (typeof arr_foxyshop_inventory[current_product_id] != 'undefined') {
if (!foxyshop_allow_backorder) {
$("#fs_quantity_max_" + current_product_id).val($("#original_quantity_max_" + current_product_id).val());
}
$(parentForm + " #productsubmit").removeAttr("disabled").removeClass("foxyshop_disabled");
$(parentForm + " .productsubmit").removeAttr("disabled").removeClass("foxyshop_disabled");
$(parentForm + " .foxyshop_stock_alert").removeClass("foxyshop_out_of_stock").hide();
}

Expand Down Expand Up @@ -228,23 +228,24 @@ jQuery(document).ready(function($){
n_sep_by_space = arrl18n_settings[4];
new_price += addOnTotal;
new_price_original += addOnTotal;
$(parentForm + " #foxyshop_main_price .foxyshop_currentprice").text(toCurrency(new_price, currencySymbol, thousandsSeparator, decimalSeparator, p_precedes, n_sep_by_space));
$(parentForm + " #foxyshop_main_price .foxyshop_oldprice").text(toCurrency(new_price_original, currencySymbol, thousandsSeparator, decimalSeparator, p_precedes, n_sep_by_space));
$(parentForm + " .foxyshop_main_price .foxyshop_currentprice").text(toCurrency(new_price, currencySymbol, thousandsSeparator, decimalSeparator, p_precedes, n_sep_by_space));
$(parentForm + " .foxyshop_main_price .foxyshop_oldprice").text(toCurrency(new_price_original, currencySymbol, thousandsSeparator, decimalSeparator, p_precedes, n_sep_by_space));

//Plugin Function Here - AFTER CHANGE VARIATIONS
if (typeof window.foxyshop_after_variation_modifiers == 'function') foxyshop_after_variation_modifiers(new_code, new_codeadd, new_price, new_price_original, new_ikey, current_product_id);

}

function update_inventory_alert_language(strlang, itemcount, itemcode) {
function update_inventory_alert_language(strlang, itemcount, itemcode, itemname) {
strlang = strlang.replace('%code',itemcode);
strlang = strlang.replace('%c',itemcount);
if (itemcount == 1) {
strlang = strlang.replace('%s',"");
} else {
strlang = strlang.replace('%s',"s");
}
strlang = strlang.replace('%n',$("#input[name^='name||']").val());
itemname = itemname || "";
strlang = strlang.replace('%n',itemname);
return strlang;
}

Expand Down Expand Up @@ -298,7 +299,7 @@ jQuery(document).ready(function($){
e.stopPropagation();
e.preventDefault();
} else {
if (jQuery("#foxyshop_product_form_" + current_product_id + " #productsubmit").attr("disabled")) return false;
if (jQuery("#foxyshop_product_form_" + current_product_id + " .productsubmit").attr("disabled")) return false;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-all-categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<?php get_header(); ?>

<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">
<?php

//echo '<h1 id="foxyshop_category_title">Products</h1>';
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-all-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
?>

<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">
<?php
//Write Category Title
echo '<h1 id="foxyshop_category_title">Products</h1>'."\n";
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-checkout-template-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function foxycart_template_header_includes() {
{% include 'svg.inc.twig' %}

<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">


{% import "utils.inc.twig" as utils %}
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-checkout-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function foxycart_template_header_includes() {

get_header(); ?>
<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">


<?php if (version_compare($foxyshop_settings['version'], '1.1', "<=")) { ?>
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-receipt-template-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function foxycart_template_header_includes() {
{% include 'svg.inc.twig' %}

<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">


{% import "utils.inc.twig" as utils %}
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-receipt-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function foxycart_template_header_includes() {

<?php get_header(); ?>
<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">



Expand Down
6 changes: 3 additions & 3 deletions themefiles/foxyshop-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<?php get_header(); ?>

<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">
<h1 id="foxyshop_category_title">Product Search</h1>

<form class="searchform" action="<?php bloginfo("url"); ?>/product-search/" method="get">
Expand All @@ -28,13 +28,13 @@
echo '<ul class="foxyshop_product_list">';
while (have_posts()) :
the_post();

//Product Display
foxyshop_include('product-loop');

endwhile;
echo '</ul>';

//Pagination
foxyshop_get_pagination();
?>
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-single-category-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
global $product, $foxyshop_category_slug, $post;
?>
<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">
<?php
//-------------------------------------------------------------------------------------------------
// Remember that the products on these category pages link to the generated page links (permalinks)
Expand Down
2 changes: 1 addition & 1 deletion themefiles/foxyshop-single-category.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<?php get_header(); ?>

<?php foxyshop_include('header'); ?>
<div id="foxyshop_container">
<div class="foxyshop_container">
<?php
global $product;

Expand Down
Loading