This is my repository of code snippets, url links, and other stuff that I use to develop website with. The main purpose of this site is to catalog, and easy search for the stuff that I use on a regular basis.
The problem with just echoing a php sting for a javascript variable is escaping the sting properly for single and double quotes and line returns. I found this fix for my problem with an apostrophe in the string that closed out the quote early. This is a better option that trying to use addslashes. Use json_encode instead. […]
Returns the permalink to the blog page by getting the blog page id from the option settings defined in the Reading settings.
I came across this filter for Gravity Forms when looking for an option to append classes to the confirmation message output when a form is submitted, and found it to be useful when a form is really long, or is placed further down the page. It will cause the page to jump to the confirmation […]
I find that every build I have requires me looking up the functions to target specific Shopp template pages, so I’m compiling a list for quick reference. is_account_page() returns true when the current page request is for the account page is_cart_page() returns true when the current page request is for the cart page is_catalog_frontpage() returns true if viewing […]
I found this additional class that can be added to the checkout form that will cause an alert window to be displayed when an input does not validate. It may be useful for forms where the light red background is not obvious to the user why they can’t submit the form to checkout. This can […]
If you have an SSL setup for the websites domain, it should be enforced for the wordpress admin login, and all admin pages (typically because the site has the SSL because of ecommerce). Add this contant definition to wp-config.php to force SSL on login and admin pages.
When developing a shopping cart using the shopp plugin, if you are testing a payment gateway that requires an SSL certificate, you can have difficulties fully testing the site. Add this constant to wp-config.php to disable SSL redirects on the checkout page: Just remember to remove it when the site is launched for production use.
I found this little snippet on Norcross blog. It will save me a lot of agreviation in the future with the anchor tags to the attachment page or media file.
During development and testing, you may need to reset the items in the cart, promo codes, shipping zip codes. To do this use the following variable in the url for the shop page: yourwebsite.com/shop/?shopping=reset
This css trick was applied to a website build where I needed background images tabs to overlay one another, so that the next tab’s z-index was lower than the first one causing the background image to be behind the one to the left of it. My first thought was to use :nth-child to assign the […]