[COLOR=“Red”]Update[/COLOR] (7/9/09)
I did some work for a client that lent itself very nicely to this addon. So, in the spirt of community I created a new version that is free for use. It is located at: [url]http://www.ez-ms.com/local_addon_v2.tgz[/url]
New features are:
- Can now specify a CSS directory within the addon directory structure so all your css is in one nice neat place. By default, it is set to ‘css’ which would look for css files in skins/customer/addons/local/css The default stylesheet that will be loaded after the system styles.css is called local_styles.css. It is present with some comments but otherwise empty.
- You can now have the system load a stylesheet that is specific to the controller being viewed. I.e. if you want to customize the checkout page then you’d have a stylesheet present called:
skins/customer/addons/local/css/checkout.css
If you want to override the categories styles then you’d have:
skins/customer/addons/local/css/categories.css
Note that these “controller specific stylesheets” are loaded AFTER both the system stylesheets and the local_styles.css files. Hence they can be VERY specific to a page.
These extensions were pretty quick and easy to do and I think they add a lot of flexibility to the addon enabling you to make local modifications and a custom look & feel without modifying standard template files. Hence, when you upgrade to 2.0.whatever you won’t have any conflicts.
Have fun!
[COLOR=“Red”]End of Update[/COLOR]
After asking the help-desk (response: “sorry, 2.0 is not supported by the help-desk”) and posing questions here on the forum (response from developers: nothing), I decided to just spend the time to read the code and figure it out.
Maybe many of you know how to do this already. I didn’t. I have added my own addons to the system that operate in the background, but had not looked at how to extend/modify the standard skins without creating tons of upgrade conflicts.
3/19/09: Found one small but where I was missing a ‘php’ after a ‘’ which caused (on my system anyway) IE to go crazy. New zip file is in place that corrects the problem. - TB
Below is the README file from the addon I’m offering. I have requested that this be embedded into the standard cart so that it is available to anyone, but no one ever hears back so will just assume it will not be.
I’m happy to try and answer questions you might have, but I think the README I’ve put together is pretty self-explanatory. It is not complicated at all once you get the hang of how it is intended to work. And the good news is that it actually works! Yipee!
Hope this helps someone save some time. Sure doesn’t seem like customers should be having to describe how the system works so it can be used as intended!!! But I guess if someone else is willing to do my job for me, I’d probably just let them do it.
tony
README.txt file located in [doc_root]/skins/[active_skin]/customer/addons/local directory.
---------------------
This information is intended to describe how you can create local customizations
to your user-interface through the use of ‘addons’.
A zip file of the ‘local’ addon can be acquired at [url]http://www.ez-ms.com/local.addon.zip[/url]. Unzip
this on your server or into your ftp environment, change the ownerships and permissions to match your
systems needs and then move the
[doc_root]/addons/local and [doc_root]/var/skins_repository/base/customer/addons/local
path into your cart document root. New skins will automatically get the new addon.
For existing skins, copy
[doc_root]/var/skins_repository/base/customer/addons/local
to your
[doc_root]/skins/[active_skin]/customer/addons
directory.
Next, go to the Administration/addons page and “install” the “Local Configuration” addon. This will
enable the cart to pick up your changes.
I have only done the ‘customer’ skins area. The ‘admin’ area works the same and once the “Local Configuration” addon is installed, you can add your local addons there too.
Description of how it works:
----------------------------
Most templates for main pages have custom template functions named ‘hook’ embedded within
the standard cart pages. I.e. you will see things in the template files like either:
{hook name=“page:type”}{/hook}
OR
{hook name=“page:type”}
Some standard content
{/hook}
where ‘page’ is usually the name of the page (or context) without suffix (like ‘index’) and the ‘type’
is an identifier to tell the system what hook to look for related to that page. Html within
the tag will either be “overridden”, “prepended” or “appended” based on the name of the
‘hook’ template.
As a convenience, EZ Merchant Solutions (http://www.ez-ms.com) has created a freely distributable addon
called ‘local’. Adding hook templates to the ‘local’ addon will allow you to customize your site
without generating conflicts during an upgrade. This is the recommended way to extend or replace
the cart’s look and feel.
In addition to the hook ‘name’ (I.e. index:bottom), hooks can be specified to either
prepend the “hook template” (bottom.pre.tpl), append the “hood template” (bottom.post.tpl) or to replace
the standard content (bottom.override.tpl) with the contents of the “hook template”.
Hence you specify your template (or calls to other templates) in the filename that matches the
action you want the system to perform on your behalf.
As an example, to replace the cart’s standard ‘bottom’ section (set of links and other formatting), you
would create the file:
skins/[active_skin]/customer/addons/local/hooks/index/bottom.override.tpl.
This will tell the system to replace the content inside of the ‘hook’ template tag
{hook name=“index:bottom”}
Standard content
{/hook}
with the content contained within the bottom.override.tpl file.
If you wanted to leave the standard content and simply prepend some graphics for your suppliers, partners,
etc. You would name the file
bottom.pre.tpl
There are a few places where the standard cart is broken. I.e. the hook for index:styles is above the standard styles.css and vmenu.css links. This prevents one from simply redefining elements like color and background-color to new values to change the colors only of the standard templates. A bug report requesting it be moved has been submitted.
You will have to experiment to determine what works best for you. A list of all the template hooks
follows. Use the ones that best meet your needs.
For your information, “basic” skin templates with 'hooks" are listed below.
Hope this helps someone else not have to dig through the code to find out basic architecture information.
Customer Templates with ‘hooks’:
--------------------------------
./customer/index.tpl:{hook name="index:styles"}{/hook}
./customer/index.tpl:{hook name="index:footer"}{/hook}
./customer/main.tpl:{hook name="index:main_content"}
./customer/bottom.tpl:{hook name="index:bottom"}
./customer/views/orders/details.tpl:{hook name="orders:details_bullets"}
./customer/views/orders/details.tpl: {hook name="orders:info"}
./customer/views/orders/details.tpl:{hook name="orders:items_list_row"}
./customer/views/orders/details.tpl: {hook name="orders:product_info"}
./customer/views/orders/details.tpl:{hook name="orders:extra_list"}
./customer/views/orders/details.tpl:{hook name="orders:totals"}
./customer/views/orders/details.tpl: {hook name="orders:details"}
./customer/views/orders/details.tpl:{hook name="orders:confirmation"}
./customer/views/checkout/checkout.tpl: {hook name="checkout:form_data"}
./customer/views/checkout/checkout.tpl: {hook name="checkout:items_list_row"}
./customer/views/checkout/checkout.tpl: {hook name="checkout:product_info"}
./customer/views/checkout/checkout.tpl: {hook name="checkout:cart_content"}
./customer/views/checkout/checkout.tpl: {hook name="checkout:cart_item"}
./customer/views/checkout/components/checkout_totals.tpl: {hook name="checkout:payment_extra"}
./customer/views/checkout/components/checkout_totals.tpl: {hook name="checkout:payment_options"}
./customer/views/checkout/components/checkout_totals.tpl: {hook name="checkout:checkout_totals"}
./customer/views/checkout/components/shipping_rates.tpl: {hook name="checkout:shipping_rates"}
./customer/views/checkout/components/checkout_steps.tpl: {hook name="checkout:checkout_st
eps"}{/hook}
./customer/views/checkout/components/checkout_steps.tpl: {hook name="checkout:checkout_st
eps"}{/hook}
./customer/views/checkout/components/checkout_steps.tpl: {hook name="checkout:che
ckout_steps"}
./customer/views/checkout/components/shipping_estimation.tpl: {hook name="checkout:shipping_estimation
"}
./customer/views/checkout/components/cart_items.tpl: {hook name="checkout:form_data"}
./customer/views/checkout/components/cart_items.tpl:{hook name="checkout:items_list"}
./customer/views/checkout/components/cart_items.tpl: {hook name="checkout:product_info"}
./customer/views/checkout/components/cart_items.tpl:{hook name="checkout:extra_list"}
./customer/views/checkout/components/payment_methods.tpl: {hook name="checkout:payment_methods"}
./customer/views/checkout/components/cart_status.tpl: {hook name="index:cart_status"}
./customer/views/products/view.tpl: {hook name="products:view_details"}
./customer/views/products/view.tpl:{hook name="products:view_main_info"}{/hook}
./customer/views/products/view.tpl: {hook name="products:tabs_block"}{/hook}
./customer/views/products/components/buy_now.tpl:{hook name="products:prices_block"}
./customer/views/products/components/buy_now.tpl:{hook name="products:options_advanced"}
./customer/views/products/components/buy_now.tpl: {hook name="products:buttons_block"}
./customer/views/products/components/buy_now.tpl: {hook name="products:buy_now"}
./customer/views/products/components/products_small_list.tpl: {hook name="products:product_small_list"}
./customer/views/products/components/product_options.tpl:
{if $po.value == $vr.variant_id || ($location != "cart" && $smarty.foreach.vars.first)}{assign var="selected_variant" value=$vr.variant_id}selected="selected"{/if}>{$vr.variant_name} {if $settings.General.display_options_modifiers == "Y"}{
hook name="products:options_modifiers"}{if $vr.modifier|floatval}({include file="common_templates/modifier.tpl" mod_type
=$vr.modifier_type mod_value=$vr.modifier display_sign=true}){/if}{/hook}{/if}
./customer/views/products/components/product_options.tpl: {$vr.variant_name} {if $settings.General.display_options_modif
iers == "Y"}{hook name="products:options_modifiers"}{if $vr.modifier|floatval}({include file="common_templates/modifier.
tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier display_sign=true}){/if}{/hook}{/if}
./customer/views/products/components/product_options.tpl: {if $settings.General.di
splay_options_modifiers == "Y"}{hook name="products:options_modifiers"}{if $vr.modifier|floatval}({include file="common_
templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier display_sign=true}){/if}{/hook}{/if}
./customer/views/products/components/product_options.tpl: pr_o[{$id}][{$po.option_id}]['v'][{$var.variant_
id}] = jQuery.entityDecode('{$var.variant_name|escape:javascript}'{if $settings.General.display_options_modifiers == 'Y'
}{hook name="products:options_modifiers_js"}{if $var.modifier|floatval}+' ({include file="common_templates/modifier.tpl"
mod_type=$var.modifier_type mod_value=$var.modifier display_sign=true})'{/if}{/hook}{/if});
./customer/views/products/components/product_options.tpl:{hook name="products:options_js"}{/hook}
./customer/views/products/components/one_product.tpl:{hook name="products:product_block"}
./customer/views/products/components/products_multicolumns.tpl: {hook name="products:product_multicolumns_list"}
./customer/views/products/components/products.tpl:{hook name="products:product_block"}
./customer/views/products/components/products_list.tpl: {hook name="products:product_list"}
./customer/views/search/results.tpl:{hook name="search::search_results"}
./customer/views/categories/view.tpl:{hook name="categories:view"}
./customer/views/profiles/update.tpl:{hook name="profiles:account_update"}
./customer/views/profiles/components/profiles_account.tpl:{hook name="profiles:account_info"}
./customer/views/pages/view.tpl: {hook name="pages:page_content"}
./customer/views/pages/view.tpl:{hook name="pages:page_extra"}
./customer/addons/news_and_emails/views/news/list.tpl: {hook name="news:list"}
./customer/addons/news_and_emails/views/news/view.tpl:{hook name="news:view"}
./customer/addons/gift_registry/views/events/update.tpl:{hook name="events:fields"}
./customer/addons/gift_registry/views/events/update.tpl: {hook name="events:update"}
./customer/addons/gift_registry/views/events/view.tpl:{hook name="events:view"}
./customer/addons/rma/views/rma/details.tpl: {hook name="orders:return_info"}
./customer/addons/rma/hooks/orders/details.post.tpl: {hook name="orders:product_details"}
./customer/addons/reward_points/views/reward_points/userlog.tpl: {hook name="reward_points:userlo
g"}
./customer/addons/required_products/hooks/products/buttons_block.override.tpl: {hook name="products:buy_now"}
./customer/addons/product_configurator/hooks/orders/items_list_row.override.tpl: {hook name="orde
rs:product_info"}
./customer/addons/product_configurator/hooks/orders/items_list_row.override.tpl:
{hook name="orders:product_info"}
./customer/addons/product_configurator/hooks/checkout/items_list.override.tpl: {hook name="products:options_mul
ticolumns"}
./customer/addons/product_configurator/hooks/checkout/items_list_row.override.tpl: {hook name="chec
kout:product_info"}
./customer/addons/form_builder/hooks/pages/page_content.override.tpl: {hook name="pages:page_content"}{/hook}
./customer/addons/tags/views/tags/summary.tpl: {hook name="tags:view"}
./customer/addons/wishlist/views/wishlist/view.tpl: {hook name="wishlist:items_list"}
./customer/addons/wishlist/views/wishlist/view.tpl: {hook name="wishlist:view"}
./customer/addons/gift_certificates/views/gift_certificates/update.tpl:
./customer/addons/gift_certificates/views/gift_certificates/update.tpl: {hook name="gift_certificates:buttons"}
./customer/addons/gift_certificates/hooks/orders/extra_list.pre.tpl: {hook name="orders:produ
ct_info"}
./customer/addons/gift_certificates/hooks/checkout/extra_list.post.tpl: {hook name="chec
kout:product_info"}{/hook}
./customer/addons/gift_certificates/hooks/checkout/cart_content.pre.tpl: {hook na
me="checkout:product_info"}
./customer/meta.tpl:{hook name="index:meta"}
./customer/blocks/my_account_bottombox.tpl:{hook name="profiles:my_account_menu"}
./customer/blocks/quick_help_bottombox.tpl: {hook name="index:quick_box"}
./customer/blocks/my_account.tpl:{hook name="profiles:my_account_menu"}
./customer/scripts/form_scripts.tpl:{hook name="index:scripts"}