Skip to content

Instantly share code, notes, and snippets.

View ScarletPonytail's full-sized avatar

ScarletPonytail ScarletPonytail

View GitHub Profile
@ScarletPonytail
ScarletPonytail / catalog.xml
Last active June 8, 2017 14:12
Magento - Add custom attribute to product grid with if statement
<!-- Add custom attribute to catalog.xml within "catalog/product_list" block -->
<action method="addAttribute"><name>no_of_chickens</name></action>
<action method="addAttribute"><name>animal_type</name></action>
@ScarletPonytail
ScarletPonytail / functions.php
Last active June 8, 2017 14:12
WordPress - Breadcrumbs
// Add Breadcrumbs
// ----------------------------------
function dimox_breadcrumbs(){
/* === OPTIONS === */
$text['home'] = 'Home'; // text for the 'Home' link
$text['category'] = 'Archive by Category "%s"'; // text for a category page
$text['tax'] = 'Archive for "%s"'; // text for a taxonomy page
$text['search'] = 'Search Results for "%s" Query'; // text for a search results page
$text['tag'] = 'Posts Tagged "%s"'; // text for a tag page
@ScarletPonytail
ScarletPonytail / text.txt
Last active June 8, 2017 14:12
phpMyAdmin - Adding a new table row
// Single row
INSERT INTO core_config_data (`scope`, `scope_id`, `path`, `value`) VALUES ('default', 0, 'admin/url/use_custom_path', 0);
// Multiple rows
INSERT INTO PUT_YOUR_TABLE_NAME_HERE ('scope', 'scope_id', 'path', 'value') VALUES
("Default", 0, "admin/url/custom", NULL),
("Default", 0, "admin/url/use_custom", 0),
("Default", 0, "admin/url/use_custom_path", 0);
DELETE FROM PUT_YOUR_TABLE_NAME_HERE
@ScarletPonytail
ScarletPonytail / text.txt
Last active June 8, 2017 14:12
Magento - Translate file
// Where is 'translate.csv'?
app > design > frontend > playground > default > locale > en_GB
// 4.3 HOW TO CHANGE THE SEARCH BOX PLACEHOLDER TEXT IF TRANSLATE ISN’T WORKING
If you are finding that updating the ‘translate.csv’ isn’t working, there is another option or editing another file called ‘form.mini.phtml, which can be found by navigating to in the rdw theme, and then copying to your project folder:
app > design > frontend > “project name” > template > catalogsearch
@ScarletPonytail
ScarletPonytail / text.txt
Last active June 8, 2017 14:12
Magento - Sage Pay Integration
// Pre Installation:
01. Buy licence key from Ebizmarts.
(Magento 1) https://store.ebizmarts.com/sage-pay-suite-pro.html
(Magento 2) https://store.ebizmarts.com/sage-pay-suite-pro-magento-2.html
02. Request dev licence from Sage Pay.
03. Get Sage Pay vendor, username and password from customer.
04. Ping both dev and live servers to get IP address.
05. Submit server IP to MySagePay.
MySagePay > Settings > Valid IP's
@ScarletPonytail
ScarletPonytail / text.html
Created March 22, 2017 13:43
HTML - Select list with working links
<select class="form-control" onchange="location = this.value;">
<option>Select a region...</option>
<option value="http://stage11.brightdesign.co.uk/wine-investment/investment-wines/bordeaux/">Bordeaux</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
@ScarletPonytail
ScarletPonytail / text.txt
Last active June 8, 2017 14:12
CSS - CSS3 Box Shadows
http://codepen.io/haibnu/pen/FxGsI
@ScarletPonytail
ScarletPonytail / text
Created March 24, 2017 13:29
Magento - Add PayPal to Sage Pay
https://www.sagepay.co.uk/support/12/36/linking-paypal-to-your-live-account
@ScarletPonytail
ScarletPonytail / text
Last active June 8, 2017 14:11
Magento - Newsletter [Fix not working sign up form]
{{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}}
If you wish to redirect customers to specific page after newsletter subscription, here's how.
Copy
app\code\core\Mage\Newsletter\controllers\SubscriberController.php
to
@ScarletPonytail
ScarletPonytail / text
Last active March 21, 2018 10:28
WordPress - Increase file upload threshold
01. Create a php.ini file and upload it to the wp-admin folder.
02. Put the following into the file:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_execution_time, upload_max_filesize, memory_limit and post_max_size in the php.ini
03. File path to MAMP's php.ini: