Showing posts with label show. Show all posts
Showing posts with label show. Show all posts

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

Monday, 12 December 2011

SilverStripe - Adding Checkbox to CMS

SilverStripe - Adding Checkbox to CMS

This allows you to add a checkbox to CMS, and then display stuff in the frontend dependant on if it is ticked or not.

First you need to add the database field for it.

static $db = array(
'ShowExtraClass' => 'Boolean'
);

Then add the checkbox to the cms

function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new CheckboxField ("ShowExtraClass"));
return $fields;
}

And finally you add the if statement in your template:
<% if ShowExtraClass %>

click here for the original website