Wednesday 12 December 2012

SilverStripe: Bulk Remove Comments

SilverStripe: Bulk Remove Comments

to remove all comments for a specific page:
DELETE FROM PageComment WHERE ParentID = <YourPageID>

to remove all comments marked as SPAM:
DELETE FROM PageComment WHERE IsSpam = 1 AND ParentID = <YourPageID>


click here for the original website

Wednesday 10 October 2012

Wordpress: Manually Order Categories

Wordpress: Manually Order Categories

I was trying to find a Wordpress plugin that allows you to manually reorder the Category List.
The module here seems to allow you do this quite easily. I haven't fully tested it myself, but the developer has kept it up to date. The module is called My Category Order.

click here for the original plugin.

Monday 8 October 2012

Magento: Sort Categories / Menu

Magento: Sort Categories / Menu

In order to sort category items in the main menu, you just need to drag them in the admin panel of Magento.

If this doesn't work, you can manually up date the sort values in the database.

Friday 5 October 2012

Magento: Slow Product Import

Magento: Slow Product Import

If you are trying to import products into your Magento shop and it's taking a long time. Check the following things:
  • If you have a lot of products, then that's the reason,
  • But if you only have a couple of hundred products, and it says you are importing more, then you need to clear your logs. The link below will show you how.

click here for the original website

Tuesday 18 September 2012

Wordpress: plugin error 'unexpected output'

Wordpress: plugin error 'unexpected output'

I had the below error when I installed a Wordpress Plugin for a site I am working on.

The plugin generated 228 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

After having done quite a bit of work on the site already, I decided to see what the problem could be.
If you read the link below it'll give you a comprehensive answer, but my short and sweet version is:
The <?php ?> open or closed tags are missing in the main php file for the plugin.

click here for the original website

Monday 17 September 2012

Wordpress: qTranslate Dates/Times Wrong

Wordpress: qTranslate Dates/Times Wrong

To sort out this problem go to 'Settings/Language/Advance Settings/' and select 'Use strftime instead of date.'

click here for the original website
click here for another original website link

Wednesday 8 August 2012

Magento: Special Prices and Promo Codes

Magento: Special Prices and Promo Codes

Ever had the problem where special prices are appearing on products, but you haven't set one up.
This problem is usually because you've setup a promotional code and either set it as inactive, active, or even deleted it, but then missed the step of APPLY CODES, this then applies all the new codes and removes the old ones.

To setup promotional codes, have a look at the link below, but the keypoints are:
  • Conditions set the products that the eligible for the promo
  • Actions are what are applied
  • I usually duplicate the conditions in the actions settings as well.
In order to apply promo codes to specific products you need to change the setting to allowed for the 'use in promo codes' in the attribute settings.

click here for the original website relating to Promocodes

Tuesday 3 July 2012

Magento: Change Address Layout

Magento: Change Address Layout

In order to change the address layout you need to go to System/Configuration/Customer Config
You should be able to find it and adjust the layout here.

The xml file to edit "app\code\local\Mage\Customer\etc\config.xml" seems to be out dated as I tried making adjustments here, but it didn't seem to work. I have only noted this as reference.

Monday 11 June 2012

Magento: Recently Viewed Products

Magento: Recently Viewed Products

The recently viewed products that you had working previously have all of a sudden stopped appearing. This problem has hit me several times over the last year and each time I have had to rediscovered the solution. So this time I have decided to blog it so I don't forget.

Problem:
The recently viewed products have disappeared, or they have stopped appearing.

Solution:
This usually happens when you have either added, removed or sometimes even modified a product. The SOLUTION is to re-index all of the indexes. If that doesn't work, then flush all the caches. After that if it still doesn't work, use everyone's good friend Google (there are other search engines available also).

Friday 18 May 2012

Magento: Create Category List with Images

Magento: Create Category List with Images

The code to create a list of top-level categories along with their images:
<?php $_categories = $this->getStoreCategories() ?>
<?php $count = 0 ?>
<ul id="square-category">
<?php foreach ($_categories as $_category): ?>

<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$immagine = $this->getCurrentCategory()->getThumbnail()
?>

<?php $count = $count+1 ?>
    <li class="Pos<?php echo $count ?>">
        <a href="<?php echo $this->getCategoryUrl($_category) ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>">
            <img src="/media/catalog/category/<?php echo "$immagine" ?>" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" class="category-img" />
            <span><?php echo $this->htmlEscape($_category->getName()) ?></span>
        </a>
    </li>
<?php endforeach; ?>
</ul>

Magento: Customise the contact form

Magento: Customise the contact form

This is very useful information if you want to modify the magento contact form.

There are several aspects that need to be modified, these include:
  • the .phtml file.
  • the .xml if you want to add extra textual content to the contact page.
  • the email template using the transactional emails in the CMS.
  • adjust the contact form settings in the CMS to use your new template.
Click the link below if you want a more detailed article.

click here for the original website

Thursday 17 May 2012

Magento: Add phtml file to template

Magento: Add phtml file to template

Use this bit of code:
<block type="core/template" name="footerMenu" template="page/footermenu.phtml"/>
in your XML file.
Then this in your template file if you want to place it:
<?php echo $this->getChildHtml('footerMenu') ?>

Magento: Simple Footer Menu

Magento: Simple Footer Menu

Here is the code that I've used to create the simple text links in the footer.
<?php $helper = $this->helper('catalog/category'); ?>
<?php foreach ($helper->getStoreCategories() as $_category): ?>
    <a href="<?php echo $helper->getCategoryUrl($_category); ?>"><?php echo $this->htmlEscape($_category->getName()); ?></a> |
<?php endforeach ?>

click here for the original website where I grabbed the first part of the code.
click here for the original website that I used to modify the code.

Monday 5 March 2012

Magento: Change Category View

Magento: Change Category View

To change the category view without having to edit each category individually, use this code in the catalog.xml file to set the page type.


<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</catalog_category_default>


click here for the original website

Monday 20 February 2012

Magento: Add product using a link

Magento: Add product using a link

/checkout/cart/add?product=1&qty=1


click here for the original website

Thursday 2 February 2012

Magento: Country Codes

Magento: Country Codes


AF Afghanistan AF - AFG AFG
AL Albania AL - ALB ALB
DZ Algeria DZ - DZA DZA
AS American Samoa AS - ASM ASM
AD Andorra AD - AND AND
AO Angola AO - AGO AGO
AI Anguilla AI - AIA AIA
AQ Antarctica AQ - ATA ATA
AG Antigua and Barbuda AG - ATG ATG
AR Argentina AR - ARG ARG
AM Armenia AM - ARM ARM
AW Aruba AW - ABW ABW
AU Australia AU - AUS AUS
AT Austria AT - AUT AUT
AZ Azerbaijan AZ - AZE AZE
BS Bahamas BS - BHS BHS
BH Bahrain BH - BHR BHR
BD Bangladesh BD - BGD BGD
BB Barbados BB - BRB BRB
BY Belarus BY - BLR BLR
BE Belgium BE - BEL BEL
BZ Belize BZ - BLZ BLZ
BJ Benin BJ - BEN BEN
BM Bermuda BM - BMU BMU
BT Bhutan BT - BTN BTN
BO Bolivia BO - BOL BOL
BA Bosnia and Herzegovi BA - BIH BIH
BW Botswana BW - BWA BWA
BV Bouvet Island BV - BVT BVT
BR Brazil BR - BRA BRA
IO British Indian Ocean IO - IOT IOT
VG British Virgin Islan VG - VGB VGB
BN Brunei BN - BRN BRN
BG Bulgaria BG - BGR BGR
BF Burkina Faso BF - BFA BFA
BI Burundi BI - BDI BDI
KH Cambodia KH - KHM KHM
CM Cameroon CM - CMR CMR
CA Canada CA - CAN CAN
CV Cape Verde CV - CPV CPV
KY Cayman Islands KY - CYM CYM
CF Central African Repu CF - CAF CAF
TD Chad TD - TCD TCD
CL Chile CL - CHL CHL
CN China CN - CHN CHN
CX Christmas Island CX - CXR CXR
CC Cocos [Keeling] Isla CC - CCK CCK
CO Colombia CO - COL COL
KM Comoros KM - COM COM
CG Congo - Brazzaville CG - COG COG
CD Congo - Kinshasa CD - COD COD
CK Cook Islands CK - COK COK
CR Costa Rica CR - CRI CRI
HR Croatia HR - HRV HRV
CU Cuba CU - CUB CUB
CY Cyprus CY - CYP CYP
CZ Czech Republic CZ - CZE CZE
CI Côte d’Ivoire CI - CIV CIV
DK Denmark DK - DNK DNK
DJ Djibouti DJ - DJI DJI
DM Dominica DM - DMA DMA
DO Dominican Republic DO - DOM DOM
EC Ecuador EC - ECU ECU
EG Egypt EG - EGY EGY
SV El Salvador SV - SLV SLV
GQ Equatorial Guinea GQ - GNQ GNQ
ER Eritrea ER - ERI ERI
EE Estonia EE - EST EST
ET Ethiopia ET - ETH ETH
FK Falkland Islands FK - FLK FLK
FO Faroe Islands FO - FRO FRO
FJ Fiji FJ - FJI FJI
FI Finland FI - FIN FIN
FR France FR - FRA FRA
GF French Guiana GF - GUF GUF
PF French Polynesia PF - PYF PYF
TF French Southern Terr TF - ATF ATF
GA Gabon GA - GAB GAB
GM Gambia GM - GMB GMB
GE Georgia GE - GEO GEO
DE Germany DE - DEU DEU
GH Ghana GH - GHA GHA
GI Gibraltar GI - GIB GIB
GR Greece GR - GRC GRC
GL Greenland GL - GRL GRL
GD Grenada GD - GRD GRD
GP Guadeloupe GP - GLP GLP
GU Guam GU - GUM GUM
GT Guatemala GT - GTM GTM
GG Guernsey GG - GGY GGY
GN Guinea GN - GIN GIN
GW Guinea-Bissau GW - GNB GNB
GY Guyana GY - GUY GUY
HT Haiti HT - HTI HTI
HM Heard Island and McD HM - HMD HMD
HN Honduras HN - HND HND
HK Hong Kong SAR China HK - HKG HKG
HU Hungary HU - HUN HUN
IS Iceland IS - ISL ISL
IN India IN - IND IND
ID Indonesia ID - IDN IDN
IR Iran IR - IRN IRN
IQ Iraq IQ - IRQ IRQ
IE Ireland IE - IRL IRL
IM Isle of Man IM - IMN IMN
IL Israel IL - ISR ISR
IT Italy IT - ITA ITA
JM Jamaica JM - JAM JAM
JP Japan JP - JPN JPN
JE Jersey JE - JEY JEY
JO Jordan JO - JOR JOR
KZ Kazakhstan KZ - KAZ KAZ
KE Kenya KE - KEN KEN
KI Kiribati KI - KIR KIR
KW Kuwait KW - KWT KWT
KG Kyrgyzstan KG - KGZ KGZ
LA Laos LA - LAO LAO
LV Latvia LV - LVA LVA
LB Lebanon LB - LBN LBN
LS Lesotho LS - LSO LSO
LR Liberia LR - LBR LBR
LY Libya LY - LBY LBY
LI Liechtenstein LI - LIE LIE
LT Lithuania LT - LTU LTU
LU Luxembourg LU - LUX LUX
MO Macau SAR China MO - MAC MAC
MK Macedonia MK - MKD MKD
MG Madagascar MG - MDG MDG
MW Malawi MW - MWI MWI
MY Malaysia MY - MYS MYS
MV Maldives MV - MDV MDV
ML Mali ML - MLI MLI
MT Malta MT - MLT MLT
MH Marshall Islands MH - MHL MHL
MQ Martinique MQ - MTQ MTQ
MR Mauritania MR - MRT MRT
MU Mauritius MU - MUS MUS
YT Mayotte YT - MYT MYT
MX Mexico MX - MEX MEX
FM Micronesia FM - FSM FSM
MD Moldova MD - MDA MDA
MC Monaco MC - MCO MCO
MN Mongolia MN - MNG MNG
ME Montenegro ME - MNE MNE
MS Montserrat MS - MSR MSR
MA Morocco MA - MAR MAR
MZ Mozambique MZ - MOZ MOZ
MM Myanmar [Burma] MM - MMR MMR
NA Namibia NA - NAM NAM
NR Nauru NR - NRU NRU
NP Nepal NP - NPL NPL
NL Netherlands NL - NLD NLD
AN Netherlands Antilles AN - ANT ANT
NC New Caledonia NC - NCL NCL
NZ New Zealand NZ - NZL NZL
NI Nicaragua NI - NIC NIC
NE Niger NE - NER NER
NG Nigeria NG - NGA NGA
NU Niue NU - NIU NIU
NF Norfolk Island NF - NFK NFK
KP North Korea KP - PRK PRK
MP Northern Mariana Isl MP - MNP MNP
NO Norway NO - NOR NOR
OM Oman OM - OMN OMN
PK Pakistan PK - PAK PAK
PW Palau PW - PLW PLW
PS Palestinian Territor PS - PSE PSE
PA Panama PA - PAN PAN
PG Papua New Guinea PG - PNG PNG
PY Paraguay PY - PRY PRY
PE Peru PE - PER PER
PH Philippines PH - PHL PHL
PN Pitcairn Islands PN - PCN PCN
PL Poland PL - POL POL
PT Portugal PT - PRT PRT
PR Puerto Rico PR - PRI PRI
QA Qatar QA - QAT QAT
RO Romania RO - ROU ROU
RU Russia RU - RUS RUS
RW Rwanda RW - RWA RWA
RE Réunion RE - REU REU
BL Saint Barthélemy BL - BLM BLM
SH Saint Helena SH - SHN SHN
KN Saint Kitts and Nevi KN - KNA KNA
LC Saint Lucia LC - LCA LCA
MF Saint Martin MF - MAF MAF
PM Saint Pierre and Miq PM - SPM SPM
VC Saint Vincent and th VC - VCT VCT
WS Samoa WS - WSM WSM
SM San Marino SM - SMR SMR
SA Saudi Arabia SA - SAU SAU
SN Senegal SN - SEN SEN
RS Serbia RS - SRB SRB
SC Seychelles SC - SYC SYC
SL Sierra Leone SL - SLE SLE
SG Singapore SG - SGP SGP
SK Slovakia SK - SVK SVK
SI Slovenia SI - SVN SVN
SB Solomon Islands SB - SLB SLB
SO Somalia SO - SOM SOM
ZA South Africa ZA - ZAF ZAF
GS South Georgia and th GS - SGS SGS
KR South Korea KR - KOR KOR
ES Spain ES - ESP ESP
LK Sri Lanka LK - LKA LKA
SD Sudan SD - SDN SDN
SR Suriname SR - SUR SUR
SJ Svalbard and Jan May SJ - SJM SJM
SZ Swaziland SZ - SWZ SWZ
SE Sweden SE - SWE SWE
CH Switzerland CH - CHE CHE
SY Syria SY - SYR SYR
ST São Tomé and Príncip ST - STP STP
TW Taiwan TW - TWN TWN
TJ Tajikistan TJ - TJK TJK
TZ Tanzania TZ - TZA TZA
TH Thailand TH - THA THA
TL Timor-Leste TL - TLS TLS
TG Togo TG - TGO TGO
TK Tokelau TK - TKL TKL
TO Tonga TO - TON TON
TT Trinidad and Tobago TT - TTO TTO
TN Tunisia TN - TUN TUN
TR Turkey TR - TUR TUR
TM Turkmenistan TM - TKM TKM
TC Turks and Caicos Isl TC - TCA TCA
TV Tuvalu TV - TUV TUV
UM U.S. Minor Outlying  UM - UMI UMI
VI U.S. Virgin Islands VI - VIR VIR
UG Uganda UG - UGA UGA
UA Ukraine UA - UKR UKR
AE United Arab Emirates AE - ARE ARE
GB United Kingdom GB - GBR GBR
US United States US - USA USA
UY Uruguay UY - URY URY
UZ Uzbekistan UZ - UZB UZB
VU Vanuatu VU - VUT VUT
VA Vatican City VA - VAT VAT
VE Venezuela VE - VEN VEN
VN Vietnam VN - VNM VNM
WF Wallis and Futuna WF - WLF WLF
EH Western Sahara EH - ESH ESH
YE Yemen YE - YEM YEM
ZM Zambia ZM - ZMB ZMB
ZW Zimbabwe ZW - ZWE ZWE
AX Ã…land Islands AX - ALA ALA

Tuesday 31 January 2012

Monday 16 January 2012

CSS: how to click though objects

CSS: how to click though objects

pointer-events:none;


click here for the original website

CSS: css3 with IE

CSS: css3 with IE

Just add a link to the PIE.htc in the css style that requires it and it should work in IE7 and IE8.

Edit.
Make sure to add position relative inorder to get it to work.

click here for the original website

Silverstripe: Math Spam Protection

Silverstripe: Math Spam Protection

Go to the link below to get a hold of it and some instructions.


click here for the original website

Thursday 12 January 2012

SilverStripe: Get the contents of one page to appear on another

SilverStripe: Get the contents of one page to appear on another

Use snippet of code:
<div class="typography"><h1><% control Title %>$XML<% end_control %></h1>
<% control Page(disclaimer) %>$Content<% end_control %></div>


click here for the original website

Wednesday 11 January 2012

Magento: adding the contents of a category to a page

Magento: adding the contents of a category to a page

If you want to add the contents of a category to a page insert this code:

{{block type="catalog/product_list" column_count="4" category_id="8" template="catalog/product/list.phtml"}}


click here for the original website

Tuesday 10 January 2012

Magento: if language is

Magento: if language is

Use this bit of code see what the language is

$language_settings = Mage::app()->getStore()->getCode();
$language_settings = strtolower($language_settings);
if ( $language_settings == “default") {
echo “Default = English”;
} elseif ( $language_settings == “french") {
echo “French”;
} elseif ( $language_settings == “german") {
echo “German”;
}

click here for the original website

Monday 9 January 2012

Magento - Add multiple currencies

Magento - Add multiple currencies

  1. Go to System\Configuration\Currency Setup and select your allowed countries.
  2. Then go to System\Manage Currency Rates and adjust your currency converstion rates. You can also do this by importing the rates from 'Webservicex'.

this is the phrase I googled for: "magento setup multiple currency shop"

click here for the original website

Friday 6 January 2012

Magento - Translation

Magento - Translation


If you want to translate your website there are 2 sets of translate files you need to add.
  1. app/locale/translate_folder_here
    The translation folder you place here is the offical translation of Magento. It contains lots of files all in csv format.
  2. app/design/frontend/default/skin_name_here/locale/translation_folder_here/translate.csv
    This translation file is almost like your customised version. Anything that has been missed or you wish to translate further you can do here in this format:

    'original phrase', 'translated_original phrase'
Translation files:
  • Click here to go to the translation section where you can download all the available translations.
  • Click here to go to the Farsi Files forum entry.

Magento - Free Modules

Magento - Free Modules

An article post that contains free magento modules.


click here for the original website

Wednesday 4 January 2012

Magento - Maintainence mode

Magento - Maintainence mode

In order to put your Magento site into maintenance mode, put a file called "maintenance.flag" in the sites' root directory


click here for the original website

Magento - How to add an attribute in the back end and make it appear in the front end

Magento - How to add an attribute in the back end and make it appear in the front end

First you define the attribute in the back end as per normal. Login to the admin section, Catalog/Attributes/etc.

Then you have add a snippet of code in the template you want the attribute to appear in.

<'remove this quote'?=$_product->getHERE() ?>

Where 'HERE' is your attributes id.


click here for the original website

Tuesday 3 January 2012

Magento - Show 'Out of Stock' items in the catalog

Magento - Show 'Out of Stock' items in the catalog

Magento, by default hides 'Out of Stock' items from the front end catalog. If you want them to appear (show in the frontend but have out of stock written next to it) you have to:
  1. Login to the backend
  2. Go to system/configuration
  3. Locate the 'Inventory' tab
  4. and Set Display out of stock products to ‘Yes’ in Stock options tab

click here for the original website

Magento - Editing the Magento email templates

Magento - Editing the Magento email templates

If you want to edit the Magento email templates, you can either edit:
  1. Just the Logo
    If you locate the email logo file here(skin directory/images/logo_email.gif") and replace it with your email logo. That should do a simple swap and any email's that go out will have your logo on them.
  2. The Template Itself
    If you want to edit the templates, the best way is to use the CMS itself.
    • First login to the admin, then go to: system/transactional emails.
    • Here you create your new template based on the original, and then change the aspects you want to change.
    • Then you go to system/configuration/sales | sales emails and using the dropdown menus select your customised emails.

click here for the original website