ZEBRA Documentation - Part 1
Template integration in Magento
1.1 Installation
Please run a backup before starting the installation process.
You have successfully purchased the Magento extension. At this point you should
have received an E-Mail containing the extension package you will need for the
installation. Login to your Magento backend and navigate to the Magento Connect
Manager (System > Magento Connect > Magento Connect Manager).
Head over to the paragraph which is named Direct package file upload
and upload the extension package. If the upload process was successful, return
to the Magento backend.
1.2 Adding a new Category-Tree (optional)
We strongly recommend creating a separate Category-Tree for your Facebook store
if you have more than 15 categories (including subcategories). By doing so, you
will have full control on the products that are listed in the Facebook store itself.
Just navigate to Catalog > Manage Categories and click the
Add Root Category button. Now create the specific subcategories
which you want to be displayed in your Facebook store.
1.3 Creating a new Storeview
Now it's time to create a new Storeview for your Facebook store. Navigate to
System > Manage Stores. To keep anything separated, regarding
your Facebook product output, from your regular store, we further recommend
adding a new Website and a new Store.
First add a new Website and name it something like Facebook.
Afterwards add a new Store called Facebook Store to the
website you have just added before. Reference the root category that you
have created in the paragraph 1.2 from within the Root Category
property or any existing root category. When you are done, create a new Storeview
for this store. You can call it something like facebook_view.
1.4 Adding products to the Facebook Store
Now go ahead and add some products to the store. Navigate to Catalog >
Manage Products and edit the products you would like to show in the
frontend. Make sure you have checked the facebook website
from within the websites tab. Then goto the categories tab and add the product
to the desired category of your Facebook store. Keep in mind, that you also
have to add the sub-products to the new website, if you are dealing with bundled products.
When you have finished adding the products, navigate to System >
Index Management and reindex everything in your Magento store.
1.5 Configuration Section
The next step is to configurate the template itself. Open System > Configuration
and choose facebook_view (or however you named that Storeview) as your current
scope. Now click on the Zebra tab. Right there, you can choose a Default Category
and set the attribute Enable to Yes. There are plenty of other
options to play around. They are fairly well described, so these won't be covered at this point.
Save your configuration. The Facebook store is now callable from within the frontend.
You can access it like this:
http://www.yourshop.com/index.php/zebra/store/show/code/facebook_view
Again, we assume you named the Storeview facebook_view. If that's not the
case, change the last parameter in the URL above to whatever your Storeview is called.
Take a look at paragraph 3 to find out, how you can customize the look of the store.
1.6 Changing the Theme
By default the theme zebra is selected after installation. The extension
gets shipped with three more themes: zebra_lava, zebra_desert and zebra_snow.
Checkout the demo
if you want to see how they look like.
You can select one of these other themes by navigating to General > Design > Themes within
the Configuration Section (Make sure the Configuration Scope is set to your Facebook Store-View).
If you want to set the theme to, let's say zebra-desert, type zebra-desert into the input field
labeld with Skin (Images / CSS) and hit save.
ZEBRA Documentation - Part 2
Registration of the Facebook Applicaton
2.1 Register as developer
Adding a new Facebook App requires you to get a Facebook Developer Account. That's not a big
deal at all. Just open up http://developers.facebook.com/
and register yourself as a developer on the Facebook platform.
2.2 Setting up a new Facebook Application
Now, that you are a registered open up https://developers.facebook.com/apps
and click on the button Create New App. Set App Display Name to the name of your shop
(e.g. My Pet Shop) and App Namespace to my-pet-shop for example. The namespace
must be a unique value, which is not taken by another Facebook App yet.
By a successful creation of the Facebook App head over to the Basic settings tab. Copy the
given App-ID and paste it to the field Facebook App ID within the Zebra
configuration tab in your Magento backend. Do the same with App Secret, target field is
Facebook App Secret. Return to Facebook and complete the given empty fields.
2.3 Adding the shop tab to your Facebook page
Navigate to the Zebra configuration section within your Magento backend. If you have filled
out the field Facebook App ID as described in paragraph 2.2 you will see a
link titled with Add your store to your Facebook page. Click it and you will
get redirected to a page where you can add your shop to your Facebook page. Of course it's
required that you are the admin of the Facebook page where you want to add the store tab.
Now open up your Facebook page and you will see your shop tab enabled.
ZEBRA Documentation - Part 3
Customization
The best way to make theme customizations is to make a copy of one of our
themes and apply you changes to that copy. This guarantuees that core updates
of the Zebra extension won't overwrite your changes.
3.1 Skin customization
If you want to attach some changes, that effect the CSS navigate to the directory
/skin/frontend/default/ and duplicate the directory of the skin
which you want to modify. You can name your copy zebra-custom. Now open the file
theme.css located in /zebra-custom/zebra/css/
within your editor and accomplish your customizations. When you are done, navigate
to System > Configuration > Design in the Magento backend. Switch
the current view to the storeview of your Facebook store and set Skin
(Images / CSS) to the name of your theme (e.g. zebra-custom or one of
the provided themes zebra-snow, zebra-desert, zebra-lava). That's it. You should
see your CSS changes now in the frontend.
3.2 Template customization
You can also apply changes to the template files. Create a new theme folder like
/app/design/frontend/default/zebra-custom/template/zebra/. Now copy the template files,
which you want to modify, from /app/design/frontend/base/default/template/zebra/ into
the new created folder from above. Now accomplish the changes and navigate to System >
Configuration > Design within the Magento backend. Make sure you are in the scope of your
Facebook store and write zebra-custom into the field Templates.
Save and you should see how the changes effect the frontend.
ZEBRA Documentation - Part 4
Tips and Tricks
4.1 Changing the fangate image
You can change the image that is shown on the fangate page easily by generating a custom skin as
described in paragraph 3.1. Afterwards, all you have to do is to replace the default file fangate.jpg
located in /skin/frontend/default/zebra-custom/zebra/img/ with your custom image, just named
fangate.jpg too.
4.2 Passing arguments into the Facebook iframe (Deeplinking)
After a successful installation of your shop tab, it will be accessible through an
URL like the following: http://www.facebook.com/sopedcom?sk=app_130099743733156.
Let's say, you want to link directly to a category within your Facebook shop from external, for
example your online shop blog. That's no big deal, just pass your arguments through the URL
parameter &appdata. Here are some examples, how you can make use of this feature:
1. http://www.facebook.com/...&appdata=action|category;id|5
2. Load the category with the ID 5
1. &appdata=action|category;id|5;order|name;orderdir|desc;page|2
2. These arguments load the category with the ID 5 and order
3. the products from behind by name and jump to the 2nd page.
4. Possible sort criterias are name, position and price, while
5. position is the default value
1. http://www.facebook.com/... &appdata=action|product;id|10
2. Load the product with the ID 10
1. http://www.fa ... &appdata=action|block;id|facebook_imprint
2. Load the static block with the identifier facebook_imprint
-
These arguments load the category with the ID 5:
http://www.facebook.com/... &appdata=action|category;id|5
-
These arguments load the category with the ID 5 and order the products from behind by
name and jump to the 2nd page. Possible sort criterias are "name", "position" and "price",
while "position" is the default value:
http://www.fa ... &appdata=action|category;id|5;order|name;orderdir|desc;page|2
-
These arguments load the product with the ID 10:
http://www.facebook.com/... &appdata=action|product;id|10
-
These arguments load the static block with the identifier facebook_imprint.
Notice, that this only works with Magento related static blocks, that are prefixed with facebook_:
http://www.fa ... &appdata=action|block;id|facebook_imprint
4.3 Creating Links
Zebra is Ajax based. This means all requests are passed through an Ajax controller
and the response gets displayed in a div, which has the ID #ajax-content-inner.
Here are some examples, how you can create links within the template that get passed through
the Ajax controller:
1. <a href="#" data-action="category" data-id="5">
2. Load Category with ID 5
3. </a>
1. <a href="#" data-action="category" data-id="5"
2. data-order="name" data-orderdir="desc" data-page="2">
3. Load the category with the ID 5 and order the products
4. from behind by name and navigate to the second page
5. </a>
1. <a href="#" data-action="product" data-id="10">
2. Load the product with the ID 10
3. </a>
1. <a href="#" data-action="block" data-id="facebook_imprint">
2. Load the static block with the identifier "facebook_imprint"
3. </a>
Notice that this kind of linking only works from within the template files.
If you
want to create links from within the CMS in static blocks you have
to do it like this:
1. <a href="action|category;id|5" class="command">
2. Load Category with ID 5
3. </a>
1. <a href="action|category;id|5;order|name;orderdir|desc;page|2"
2. class="command">
3. Load the category with the ID 5 and order the products
4. from behind by name and navigate to the second page
5. </a>
1. <a href="action|product;id|10" class="command">
2. Load the product with the ID 10
3. </a>
1. <a href="action|block;id|facebook_imprint" class="command">
2. Load the static block with the identifier "facebook_imprint"
3. </a>
Notice the css-class "command" which indicates that the link is an Ajax-based call.
By default all non-ajax links will have target="_blank" so that they will get loaded
in an new browser-tab.
4.4 Static Blocks
You can also link to static blocks within the extension. To make that happen, you need to create
static blocks which have an identifier prefixed with facebook_. By doing so,
you can set up the Zebra configuration, that these static blocks get linked from the page footer
(Take a look at the Footer Links section within the Magento configuration).
You can also make a static block appear as Homepage by setting the Property
Start Block in the configuration.
4.5 Customizing the Fullscreen-Button
You have the possibility to influence the look of the fullscreen + flash button which
appears on the product thumbnails, if enabled in the Magento backend. To customize the colors and its
position, just copy the JavaScript file fullscreenstyles.js located under
/skin/frontend/base/default/zebra/js/ into your custom skin directory.
Now open the fullscreenstyles.js in an editor and change the settings to
your needs. They are all well documented.