Posts Tagged ‘system.xml’

Magento : Liste des ressources utilisables dans system.xml

Un petit article rapide d’aide mémoire pour la gestion des fichiers system.xml dans magento 1 .
Ces fichiers peuvent utiliser souvent les éléments suivants :

 Source Model

Il doivent être utilisés pour des champs de types « select » ou « multiselect »

Ex :

<demo_field_source translate="label">
    <label>Demo Field source model</label>
    <frontend_type>select</frontend_type>
    <!-- Définition de la source -->
    <source_model>adminhtml/system_config_source_yesno</source_model>
    <!-- Fin Définition de la source -->
    <sort_order>1</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</demo_field_source>

Les plus utiles à retenir sont les suivants :

  • adminhtml/system_config_source_yesno ( Oui / Non )
  • adminhtml/system_config_source_country (Liste des pays )
  • adminhtml/system_config_source_cms_page ( Liste des pages cms )
  • adminhtml/system_config_source_email_template ( Listes des emails transactionnels )

Liste complète :

adminhtml/system_config_source_yesno
adminhtml/system_config_source_admin_page
adminhtml/system_config_source_catalog_gridPerPage
adminhtml/system_config_source_catalog_listMode
adminhtml/system_config_source_catalog_listPerPage
adminhtml/system_config_source_catalog_listSort
adminhtml/system_config_source_catalog_search_type
adminhtml/system_config_source_catalog_timeFormat
adminhtml/system_config_source_checktype
adminhtml/system_config_source_cms_page
adminhtml/system_config_source_cms_wysiwyg_enabled
adminhtml/system_config_source_country
adminhtml/system_config_source_cron_frequency
adminhtml/system_config_source_currency
adminhtml/system_config_source_currency_service
adminhtml/system_config_source_customer_address_type
adminhtml/system_config_source_customer_forgotpassword
adminhtml/system_config_source_customer_group
adminhtml/system_config_source_design_robots
adminhtml/system_config_source_email_identity
adminhtml/system_config_source_email_method
adminhtml/system_config_source_email_smtpauth
adminhtml/system_config_source_email_template
adminhtml/system_config_source_enabledisable
adminhtml/system_config_source_frequency
adminhtml/system_config_source_locale
adminhtml/system_config_source_locale_currency_all
adminhtml/system_config_source_locale_timezone
adminhtml/system_config_source_locale_weekdaycodes
adminhtml/system_config_source_locale_weekdaycodes
adminhtml/system_config_source_locale_weekdays
adminhtml/system_config_source_nooptreq
adminhtml/system_config_source_notification_frequency
adminhtml/system_config_source_order_status_new
adminhtml/system_config_source_order_status_newprocessing
adminhtml/system_config_source_order_status_processing
adminhtml/system_config_source_payment_allspecificcountries
adminhtml/system_config_source_payment_cctype
adminhtml/system_config_source_price_scope
adminhtml/system_config_source_price_step
adminhtml/system_config_source_product_thumbnail
adminhtml/system_config_source_reports_scope
adminhtml/system_config_source_security_domainpolicy
adminhtml/system_config_source_shipping_allspecificcountries
adminhtml/system_config_source_shipping_flatrate
adminhtml/system_config_source_shipping_tablerate
adminhtml/system_config_source_shipping_taxclass
adminhtml/system_config_source_storage_media_database
adminhtml/system_config_source_storage_media_storage
adminhtml/system_config_source_store
adminhtml/system_config_source_tax_apply_on
adminhtml/system_config_source_tax_basedon
adminhtml/system_config_source_watermark_position
adminhtml/system_config_source_web_redirect
adminhtml/system_config_source_yesno
adminhtml/system_config_source_yesnocustom
backup/config_source_type
captcha/config_font
captcha/config_form_backend
captcha/config_form_frontend
captcha/config_mode
catalog/product_attribute_source_msrp_type
cataloginventory/source_backorders
checkout/config_source_cart_summary
configurableswatches/system_config_source_catalog_product_configattribute
configurableswatches/system_config_source_catalog_product_configattribute_select
customer/config_share
downloadable/system_config_source_contentdisposition
downloadable/system_config_source_orderitemstatus
googleanalytics/system_config_source_type
googlebase/source_accounttype
googlebase/source_country
log/adminhtml_system_config_source_loglevel
pagecache/system_config_source_controls
paygate/authorizenet_source_cctype
paygate/authorizenet_source_cctype
paygate/authorizenet_source_paymentAction
payment/source_invoice
paypal/config::getApiAuthenticationMethods
paypal/config::getExpressCheckoutBASignupOptions
paypal/config::getExpressCheckoutButtonFlavors
paypal/config::getExpressCheckoutSolutionTypes
paypal/config::getPayflowproCcTypesAsOptionArray
paypal/config::getWppCcTypesAsOptionArray
paypal/config::getWppPeCcTypesAsOptionArray
paypal/system_config_source_bmlPosition::getBmlPositionsCCP
paypal/system_config_source_bmlPosition::getBmlPositionsCheckout
paypal/system_config_source_bmlPosition::getBmlPositionsCPP
paypal/system_config_source_bmlPosition::getBmlPositionsHP
paypal/system_config_source_bmlSize::getBmlSizeCCPC
paypal/system_config_source_bmlSize::getBmlSizeCCPS
paypal/system_config_source_bmlSize::getBmlSizeCheckoutC
paypal/system_config_source_bmlSize::getBmlSizeCheckoutN
paypal/system_config_source_bmlSize::getBmlSizeCPPC
paypal/system_config_source_bmlSize::getBmlSizeCPPN
paypal/system_config_source_bmlSize::getBmlSizeHPH
paypal/system_config_source_bmlSize::getBmlSizeHPS
paypal/system_config_source_buyerCountry
paypal/system_config_source_fetchingSchedule
paypal/system_config_source_logo
paypal/system_config_source_merchantCountry
paypal/system_config_source_paymentActions
paypal/system_config_source_paymentActions_express
paypal/system_config_source_requireBillingAddress
paypal/system_config_source_urlMethod
paypal/system_config_source_yesnoShortcut
salesrule/system_config_source_coupon_format
shipping/source_handlingAction
shipping/source_handlingType
tax/system_config_source_algorithm
tax/system_config_source_apply
tax/system_config_source_priceType
tax/system_config_source_tax_country
tax/system_config_source_tax_display_type
tax/system_config_source_tax_region
usa/shipping_carrier_abstract_source_mode
usa/shipping_carrier_abstract_source_requesttype
usa/shipping_carrier_dhl_international_source_contenttype
usa/shipping_carrier_dhl_international_source_method_doc
usa/shipping_carrier_dhl_international_source_method_freedoc
usa/shipping_carrier_dhl_international_source_method_freenondoc
usa/shipping_carrier_dhl_international_source_method_nondoc
usa/shipping_carrier_dhl_international_source_method_size
usa/shipping_carrier_dhl_international_source_method_unitofmeasure
usa/shipping_carrier_dhl_source_dutypaymenttype
usa/shipping_carrier_dhl_source_freemethod
usa/shipping_carrier_dhl_source_method
usa/shipping_carrier_dhl_source_protection_rounding
usa/shipping_carrier_dhl_source_protection_value
usa/shipping_carrier_dhl_source_shipmenttype
usa/shipping_carrier_fedex_source_dropoff
usa/shipping_carrier_fedex_source_freemethod
usa/shipping_carrier_fedex_source_method
usa/shipping_carrier_fedex_source_packaging
usa/shipping_carrier_fedex_source_unitofmeasure
usa/shipping_carrier_ups_source_container
usa/shipping_carrier_ups_source_destType
usa/shipping_carrier_ups_source_freemethod
usa/shipping_carrier_ups_source_method
usa/shipping_carrier_ups_source_originShipment
usa/shipping_carrier_ups_source_pickup
usa/shipping_carrier_ups_source_type
usa/shipping_carrier_ups_source_unitofmeasure
usa/shipping_carrier_usps_source_container
usa/shipping_carrier_usps_source_freemethod
usa/shipping_carrier_usps_source_machinable
usa/shipping_carrier_usps_source_method
usa/shipping_carrier_usps_source_size
weee/config_source_display
weee/config_source_fpt_tax
wishlist/config_source_summary

 

 Frontend Model :

Le frontend model est un block de template magento  et  qui permets de gérer un affichage particulier pour l’élément de configuration.…

Pas de commentaires

Magento : Surcharger config.xml ou system.xml

Le système d’override de Magento est très puissant et relativement facile à mettre en place pour les Blocks , Helper et modèles.

En effet ( même si ce n’est pas la méthode recommandée) , il est possible de copier le fichier à surcharger de son arborescence initiale vers le codePool local, et d’y réaliser directement les modifications.

Ex pour le module Cms :
app/code/core/Mage/Cms/Block/Page.php vers app/code/core/Mage/Cms/Block/Page.php
app/code/core/Mage/Cms/Helper/Page.php vers app/code/core/Mage/Cms/Helper/Page.php
app/code/core/Mage/Cms/Model/Page.php vers app/code/core/Mage/Cms/Model/Page.php

Cette surcharge permets également de surcharger les modules placés dans le codePool Community, car si un fichier avec la même arborescence existe dans le codePool local, c’est toujours lui qui sera utilisé.

En revanche pour surcharger un fichier config.xml ou system.xml , il va être nécessaire de créer un module.
( Je ne détaille pas la création de celui-ci )

Commençons par le fichier config.xml

Le principe de l’override est simple, nous allons créer dans le fichier config.xml de notre module le même chemin xml que celui que nous souhaitons overrider.…

Pas de commentaires


Compte Github