Skip to content

Instantly share code, notes, and snippets.

View DivaVocals's full-sized avatar

Crystal Jones DivaVocals

View GitHub Profile
@DivaVocals
DivaVocals / tpl_modules_shipping_estimator.php
Last active August 29, 2015 14:04
zenCart - Hide Available Shipping Methods table until Shipping Estimator runs ( /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php)
<?php
//This is a replacement for the /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php.
//There are two areas that were changed, just look for the //-bof and //-eof comments
// Use when you don't want the Available Shipping Methods table to display on the
//http://yoursite(dot)com/index(dot)php? main_page=shopping_cart page until you enter the location and postal code
//information. This way all the available shipping methods are displayed together. (flat rates as well as UPS)
}
}
if($_SESSION['cart']->get_content_type() == 'virtual'){
?>
@DivaVocals
DivaVocals / Center-Authorize-net-Code
Last active August 29, 2015 14:13
Center Authorize.net's Seal Code - I've seen LOTS of solutions out there in the wild to answer this question, and nearly ALL of them are wrong.. This solution works and is syntactically correct.
<!-- Add this code to your website: Note the only REAL change is on line 6, the addition of a linebreak after the Authorize.net seal -->
<!-- (c) 2005, 2008. Authorize.Net is a registered trademark of CyberSource Corporation -->
<div class="AuthorizeNetSeal">
<script type="text/javascript" language="javascript">var ANS_customer_id="YOUR-AUTHORIZE.NET-CUST-ID";</script>
<script type="text/javascript" language="javascript" src="//verify.authorize.net/anetseal/seal.js"></script>
<br />
<a href="//www.authorize.net/" id="AuthorizeNetText" target="_blank">Online Payments</a>
</div>
<!-- end Authorize.Net -->
@DivaVocals
DivaVocals / ZC-PW-Reset
Created January 12, 2015 07:52
Change or Reset Zen Cart Password
# See this Zen Cart FAQ: http://www.zen-cart.com/content.php?44-how-do-i-change-or-reset-my-admin-password-%28i-lost-it%29
DELETE FROM admin WHERE admin_name = 'Admin';
INSERT INTO admin (admin_name, admin_email, admin_pass, admin_profile)
VALUES ('Admin', 'admin@localhost', '351683ea4e19efe34874b501fdbf9792:9b', 1);
@DivaVocals
DivaVocals / wp4zen_css
Last active August 29, 2015 14:13
WordPress for Zen Cart CSS to format the Blog Categories, Blog Pages, & Blog Archives sideboxes to match Better Categories formatting
/*apply better categories sidebox styling to wp4zen sideboxes*/
#wpcategoriessideboxContent, #wppagessideboxContent, #wparchivessideboxContent{border-top:1px solid #dbdbce;padding: 0px 5px;}
/*bof better categories list formatting for wp4zen*/
li.cat-item a, li.cat-item a:hover, li.cat-item a:active, li.page_item a, li.page_item a:hover, li.page_item a:active, #wparchivessideboxContent ul li a, #wparchivessideboxContent ul li a:hover, #wparchivessideboxContent ul li a:active{padding-left:40px;color:#0C4169 !important;}
li.cat-item:hover, li.cat-item:active, li.page_item:hover, li.page_item:active, #wparchivessideboxContent ul li:hover, #wparchivessideboxContent ul li:active{background-color: #7daf00;color:#0C4169;margin-left:-5px;margin-right:-5px;}
li.cat-item, li.page_item, #wparchivessideboxContent ul li {display: block;background-color: #fffffe;border-top: 0px solid #ffffff;border-bottom:1px solid #dbdbce;padding: 5px 4px 5px 0px;transition:background 2s ease;-webkit-transition:background 2s ease;-moz-tr
@DivaVocals
DivaVocals / gist:f7e957cd182986f9246b
Created February 25, 2015 00:40
How to force table cell <td> content to wrap
http://stackoverflow.com/questions/6666532/how-to-force-table-cell-td-content-to-wrap
table {border-collapse:collapse; table-layout:fixed;}
table td {word-wrap:break-word;}
Alternate solution:
td {
white-space: -o-pre-wrap;
word-wrap: break-word;
white-space: pre-wrap;
@DivaVocals
DivaVocals / gist:23fb29d894fef4d745a4
Created February 28, 2015 21:42
Declare a size/partial border
Method 1: http://dabblet.com/gist/e5a78f2d4bf50b6be4d3
CSS:
div {
text-align:center;
}
h1 {
position: relative;
display: inline-block;
color: #818488;
@DivaVocals
DivaVocals / gist:81a2d425ed6c6ce35526
Created March 1, 2015 02:02
Mobile Slide Menu Options
http://mmenu.frebsite.nl/
http://www.tegdesign.com/tegansnyder-JQuery-Mobile-Slide-Menu/
http://madebymade.github.io/jquery-navobile/
http://alijafarian.com/jquery-horizontal-slideout-menu/
http://www.webdesignerdepot.com/2014/04/how-to-create-mobile-style-slide-in-navigation/
http://www.jquerybyexample.net/2014/02/mobile-menu-jquery-plugins-and-tutorial-list.html
http://www.queness.com/post/14244/side-out-sidebar-navigation-javascript-solutions
@DivaVocals
DivaVocals / tpl_main_page.php
Last active November 1, 2015 16:54
Zen Cart - Display Banner when this is the homepage only
/* https://www.zen-cart.com/showthread.php?206857-Header-Banner-Choosing-how-to-display&p=1192557#post1192557 */
/* includes/templates/MYTEMPLATE/common/tpl_main_page.php - Display Banner when this is the homepage only */
if ($this_is_home_page && (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) {
@DivaVocals
DivaVocals / tpl_main_page.php
Last active November 1, 2015 16:54
Zen Cart - Display Banner on any page except the product_info page
/* https://www.zen-cart.com/showthread.php?206857-Header-Banner-Choosing-how-to-display&p=1192586#post1192586 */
/* includes/templates/MYTEMPLATE/common/tpl_main_page.php - Display banner on any page except the product_info page */
<?php if (in_array($current_page_base,explode(",",'product_info')) ) {
// do nothing
} else {
?>
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
<?php
@DivaVocals
DivaVocals / tpl_main_page.php
Last active November 1, 2015 16:53
Zen Cart - Display Banner everywhere EXCEPT homepage
/* https://www.zen-cart.com/showthread.php?71519-How-do-i-make-banner-ads-appear-on-the-front-page-only&p=628667#post628667 */
/* includes/templates/MYTEMPLATE/common/tpl_main_page.php - Display Banner everywhere EXCEPT homepage */
if (!$this_is_home_page && (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) {