summersab patch 4#32
Open
summersab wants to merge 6 commits intoFoxyCart:masterfrom
summersab:revert-3-summersab-patch-4
Open
summersab patch 4#32summersab wants to merge 6 commits intoFoxyCart:masterfrom summersab:revert-3-summersab-patch-4
summersab wants to merge 6 commits intoFoxyCart:masterfrom
summersab:revert-3-summersab-patch-4
Conversation
Added two new filters to the foxyshop_product_variations function: foxyshop_before_variation_field - allows adding code prior to the variation form field element foxyshop_after_variation_field - allows adding code after the variation form field element Added a $labelPosition option to the foxyshop_product_variations function to allow the variation titles to be displayed as placeholder values in the form field elements
Update helperfunctions.php
Similar to Contact Form 7, FoxyShop loads its CSS on every page of the website. There may be better ways to handle this, but the way it is handled in CF7 is adding a filter that can be used like so:
```
add_filter( 'foxyshop_load_css', '__return_false' ); // Disable FS CSS
add_action('wp_enqueue_scripts', 'load_foxyshop_scripts');
function load_foxyshop_scripts() {
//is_page can take an array that uses page title, slug, or ID such as array( 23, 'about-us', 'Contact' )
if ( is_page( array( '235', 'daisies' ) ) ) {
if ( function_exists( 'foxyshop_do_load_site_scripts' ) ) {
foxyshop_do_load_site_scripts();
}
}
}
```
This helps with PageSpeed and SEO.
I'm not sure if I can justify this PR without the other changes I've made and added to my site's functions.php. However, this small tweak takes into account the scenario where a user has placeholder text in the quantity select box (it is required that the option be set with the attribute `value="0"`). Prior to this change, the price update would show NaN as a new total price. After this change, the update looks to see if the value is 0. Otherwise, it takes the value of the text.
Update variation.process.jquery.js
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Edit the addon quantity select field to allow placeholder text with
value="0"