corpsefilth
corpsefilth
Annotations Of An Introvert
190 posts
Self Reference Tips And Stuff
Don't wanna be here? Send us removal request.
corpsefilth · 7 years ago
Text
Redirect to https and www on wordpress install htaccess sample
RewriteEngine on RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ https://www.domain.com%{REQUEST_URI} [R=301,L]
3 notes · View notes
corpsefilth · 9 years ago
Text
Get Product Collection - Magento Quckie
This snippet loads your product collection and filers by category, simple, and active. In other words it your collection will only have products that are - Simple products - Active (enabled) - and Belong to Category ID 5.
Notice that I'm loading the category object as well, if you want all products you don't need to do this, just remove the addCategoryFilter. addCategoryFilter needs category object, it will not work if you just add the number 5 in there. Hence my $category variable.
$category = Mage::getModel('catalog/category')->load(5); $_productCollection = Mage::getModel('catalog/product')->getCollection(); $_productCollection->addAttributeToSelect('*') ->addAttributeToFilter('status', '1') ->addAttributeToFilter('type_id', array('eq' => 'simple')) ->addCategoryFilter($category);
2 notes · View notes
corpsefilth · 9 years ago
Text
Display recently viewed products on detail page magento - Quickie
Open the catalog.xml and Add below block under the <catalog_product_view><reference name="content"> <block type="reports/product_viewed" name="reports.product.viewed" as="recently_viewed" template="reports/product_viewed.phtml">      <action method="setColumnCount"><columns>5</columns></action>      <action method="setItemLimit"><type>recently_viewed</type><limit>5</limit></action> </block> Now open app\design\frontend\default\bonitto\template\catalog\product\view.phtml and add below code where you want recently viewed products <?php echo $this->getChildHtml('recently_viewed') ?>
1 note · View note
corpsefilth · 9 years ago
Text
Get placeholder image - Magento Quickie
Hi you can get place holder from Mage::getStoreConfig() function
Base image: Mage::getStoreConfig("catalog/placeholder/image_placeholder");
small: Mage::getStoreConfig("catalog/placeholder/small_image_placeholder");
Thumbnail Mage::getStoreConfig("catalog/placeholder/thumbnail_placeholder");
You need just add catalog image path on this url before
 Mage::getSingleton('catalog/product_media_config')->getBaseMediaUrl(). '/placeholder/' .
example getting small pace holder image try this
Mage::getSingleton('catalog/product_media_config')->getBaseMediaUrl(). '/placeholder/' .Mage::getStoreConfig("catalog/placeholder/small_image_placeholder");
1 note · View note
corpsefilth · 9 years ago
Text
Magento SMTP pro and WHM
For anyone on a VPS server suddenly getting “535 Incorrect authentication data” error, it is caused by the automatic WHM upgrade which changed one of the server email settings. So, if you are on a VPS server using SMTP Pro and suddenly all outgoing emails stop working, here is one possible issue to check for: 1) Login to WHM 2) Under Server Configuration, select Tweak Settings 3) Click on the Mail tab 4) Scroll down to “Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)” and make sure it’s set to “OFF” 5) Scroll to the bottom of the page and click Save Hope this helps someone with similar setup!
2 notes · View notes
corpsefilth · 9 years ago
Text
Add title for each view - Laravel Quickie
Quickie on how to add a unique title for each of your views in Laravel.
Thanks to Zeckdude http://stackoverflow.com/users/83916/zeckdude
master.blade.php
<!DOCTYPE html> <html lang="en"> <head>    <title>@yield('title')</title>    <meta name="description" content="@yield('description')"> </head>
individual page
@extends('layouts.master') @section('title')    This is an individual page title @stop @section('description')    This is a description @stop @section('content')
or if you want to shorten that some more, alternately do this:
individual page
@extends('layouts.master') @section('title', 'This is an individual page title') @section('description', 'This is a description') @section('content')
0 notes
corpsefilth · 9 years ago
Text
Nice
Magento 2 XML Validation Errors
Magento 2 validates most, if not all, of its XML configuration files via a schema document. If you’re dealing with someone else’s code and you need to jump to the source of a schema problems, here’s a debugging snippet.
#File: vendor/magento/framework/Config/Dom.php public function validate($schemaFileName, &$errors = []) { if ($this->validationState->isValidationRequired()) { $errors = $this->validateDomDocument($this->dom, $schemaFileName, $this->errorFormat); //start debug if(count($errors) > 0) { header('Content-Type: text/plain'); var_dump($errors); var_dump($schemaFileName); echo($this->dom->saveXml()); exit; } //end debug return !count($errors); } return true; }
Magento 2 validates the merged dom tree – this will output the error, the schema file that’s being violated, and the entire merged tree. With this, you should be able to pinpoint the problem node, and from there search your codebase for the incorrect XML file.
3 notes · View notes
corpsefilth · 9 years ago
Text
Control the number of products shown per page for a specific category in magento - Quickie
Navigate to Catalog->Manage Categories .Choose the particular category and select the tab Custom Design and add the below xml snippet to the field Custom Layout Update
<reference name="product_list_toolbar">   <action method="addPagerLimit"><mode>grid</mode><limit>28</limit></action> </reference>
You can change display mode to either as grid or list based on your theme.
2 notes · View notes
corpsefilth · 9 years ago
Text
Wordpress next to Laravel - Quickie
So Laravel’s default root dir is /public, if you install wordpress inside that dir, say /public/blog - then when you go to that on your browser say mydomain.com/blog you will get a redirect loop error, and you will not be able to run wordpress. To fix this add this line to your .htaccess file.
RewriteCond $1 !^(blog)
Your .htaccess file should now look like this:
<IfModule mod_rewrite.c>    <IfModule mod_negotiation.c>        Options -MultiViews    </IfModule>
   RewriteEngine On
   RewriteCond $1 !^(blog)
   # Redirect Trailing Slashes...    RewriteRule ^(.*)/$ /$1 [L,R=301]
   # Handle Front Controller...    RewriteCond %{REQUEST_FILENAME} !-d    RewriteCond %{REQUEST_FILENAME} !-f    RewriteRule ^ index.php [L] </IfModule>
then you should be able to process finishing the wordpress install etc.
0 notes
corpsefilth · 9 years ago
Text
Taxonomy Query for Custom Post Type Loop Wordpress - Quickie
Grabbing a custom taxonomy/s and then looping through the custom post type for each taxonomy.
<?php //start by fetching the terms for the portfoliosets taxonomy $terms = get_terms( 'portfoliosets', array(    'orderby'    => 'count',    'hide_empty' => 0 ) ); ?>
<?php // now run a query for each portfoliosets set foreach( $terms as $term ) {
   // Define the query    $args = array(        'post_type' => 'portfolios',        'portfoliosets' => $term->slug    );    $myquery = new WP_Query( $args );
   // output the term name in a heading tag                    echo'<h2>' . $term->name . '</h2>';
   // output the post titles in a list    echo '<ul>';
       // Start the Loop        while ( $myquery->have_posts() ) : $myquery->the_post(); ?>
       <li class="animal-listing" id="post-<?php the_ID(); ?>">            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>        </li>
       <?php endwhile;
   echo '</ul>';
   // use reset postdata to restore orginal query    wp_reset_postdata();
} ?>
0 notes
corpsefilth · 9 years ago
Text
“df” Commands to Check Disk Space in Linux - Quickie
[root@tecmint ~]# df -a Filesystem           1K-blocks      Used Available Use% Mounted on /dev/cciss/c0d0p2     78361192  23186116  51130312  32% / proc                         0         0         0   -  /proc sysfs                        0         0         0   -  /sys devpts                       0         0         0   -  /dev/pts /dev/cciss/c0d0p5     24797380  22273432   1243972  95% /home /dev/cciss/c0d0p3     29753588  25503792   2713984  91% /data /dev/cciss/c0d0p1       295561     21531    258770   8% /boot tmpfs                   257476         0    257476   0% /dev/shm none                         0         0         0   -  /proc/sys/fs/binfmt_misc sunrpc                       0         0         0   -  /var/lib/nfs/rpc_pipefs
In Human Readable Format:
[root@tecmint ~]# df -h Filesystem            Size  Used Avail Use% Mounted on /dev/cciss/c0d0p2      75G   23G   49G  32% / /dev/cciss/c0d0p5      24G   22G  1.2G  95% /home /dev/cciss/c0d0p3      29G   25G  2.6G  91% /data /dev/cciss/c0d0p1     289M   22M  253M   8% /boot tmpfs                 252M     0  252M   0% /dev/shm
Check Inodes:
[root@tecmint ~]# df -i Filesystem            Inodes   IUsed   IFree IUse% Mounted on /dev/cciss/c0d0p2    20230848  133143 20097705    1% / /dev/cciss/c0d0p5    6403712  798613 5605099   13% /home /dev/cciss/c0d0p3    7685440 1388241 6297199   19% /data /dev/cciss/c0d0p1      76304      40   76264    1% /boot tmpfs                  64369       1   64368    1% /dev/shm
1 note · View note
corpsefilth · 9 years ago
Text
Remove version string from css and js files on wordpress - quickie
To prevent you css files from being cached you might want to remove the version number from the style or script loader on wordpress:
function remove_cssjs_ver( $src ) {    if( strpos( $src, '?ver=' ) )        $src = remove_query_arg( 'ver', $src );    return $src; } add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 ); add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
into your functions.php will do it.
0 notes
corpsefilth · 9 years ago
Link
email tester regex
0 notes
corpsefilth · 10 years ago
Text
To Generate a Certificate Signing Request for Apache 2.x
Log in to your server's terminal (SSH).
At the prompt, type the following command: openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -outyourdomain.csr
Enter the requested information:
Open the CSR in a text editor and copy all of the text.
Paste the full CSR into the SSL enrollment form in your account.
Replace yourdomain with the domain name you're securing. For example, if your domain name is coolexample.com, you would type coolexample.key andcoolexample.csr.
Common Name: The fully-qualified domain name, or URL, you're securing. If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for example *.coolexample.com.
Organization: The legally-registered name for your business. If you are enrolling as an individual, enter the certificate requestor's name.
Organization Unit: If applicable, enter the DBA (doing business as) name.
City or Locality: Name of the city where your organization is registered/located. Do not abbreviate.
State or Province: Name of the state or province where your organization is located. Do not abbreviate.
Country: The two-letter International Organization for Standardization (ISO) formatcountry code for where your organization is legally registered.
If you do not want to enter a password for this SSL, you can leave the Passphrase field blank. However, please understand there might be additional risks.
0 notes
corpsefilth · 10 years ago
Link
Laravel reseed - quickie
0 notes
corpsefilth · 10 years ago
Link
WHM phpmyadmin increase upload size
0 notes
corpsefilth · 10 years ago
Text
The Fav Icon info - quickie
Fav Icons - sample html
<!-- Fav Icon and Apple Touch Icons --> <link rel="icon" href="/assets/img/ico/favicon.ico" type="image/x-icon"> <link rel="apple-touch-icon" href="/assets/img/ico/touch-icon-iphone.png"> <link rel="apple-touch-icon" sizes="76x76" href="/assets/img/ico/touch-icon-ipad.png"> <link rel="apple-touch-icon" sizes="120x120" href="/assets/img/ico/touch-icon-iphone-retina.png"> <link rel="apple-touch-icon" sizes="152x152" href="/assets/img/ico/touch-icon-ipad-retina.png">
0 notes