phtml中的Magento ad变量
我们有一个附属公司的文件,希望调用phtml文件中的静态块 它必须在这里:phtml中的Magento ad变量,magento,magento-1.7,Magento,Magento 1.7,我们有一个附属公司的文件,希望调用phtml文件中的静态块 它必须在这里: $domain = "domain.com"; domain.com必须是一个变量,我认为最好给它一个静态块,这样我就可以把我自己的变量放在那里。它适用于多存储,因此每个storeview都需要有自己的变量 如果有人知道如何操作,请告诉我。如果所需的域是当前商店url 将域名用于当前url的步骤 $domain = Mage::getBaseUrl(); 如果所需域与当前存储url不同 我将把这部分作为系统配置的一部
$domain = "domain.com";
domain.com必须是一个变量,我认为最好给它一个静态块,这样我就可以把我自己的变量放在那里。它适用于多存储,因此每个storeview都需要有自己的变量
如果有人知道如何操作,请告诉我。如果所需的域是当前商店url
将域名用于当前url的步骤
$domain = Mage::getBaseUrl();
如果所需域与当前存储url不同
我将把这部分作为系统配置的一部分
创建一个新模块
app/code/local/Vendor/Module/etc/config.xml
<config>
<modules>
<Juno_ProductRegion>
<version>0.1.0</version>
</Juno_ProductRegion>
</modules>
<global>
<helpers>
<vendor_module>
<class>Vendor_Module_Helper</class>
</vendor_module>
</helpers>
</global>
</config>
<config>
<tabs>
<vendor translate="label" module="module">
<label>Vendor</label>
</vendor>
</tabs>
<sections>
<vendor translate="label" module="module">
<label>Module</label>
<tab>vendor</tab>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<general translate="label">
<label>General</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<affiliate_url translate="label">
<label>Affiliate URL</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</affiliate_url>
</fields>
</general>
</groups>
</vendor>
</sections>
</config>
<config>
<acl>
<admin>
<children>
<system>
<children>
<config>
<children>
<vendor>
<title>Vendor</title>
</vendor>
</children>
</config>
</children>
</system>
</children>
</admin>
</acl>
</config>
app/code/local/Vendor/Module/etc/adminhtml.xml
<config>
<modules>
<Juno_ProductRegion>
<version>0.1.0</version>
</Juno_ProductRegion>
</modules>
<global>
<helpers>
<vendor_module>
<class>Vendor_Module_Helper</class>
</vendor_module>
</helpers>
</global>
</config>
<config>
<tabs>
<vendor translate="label" module="module">
<label>Vendor</label>
</vendor>
</tabs>
<sections>
<vendor translate="label" module="module">
<label>Module</label>
<tab>vendor</tab>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<general translate="label">
<label>General</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<affiliate_url translate="label">
<label>Affiliate URL</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</affiliate_url>
</fields>
</general>
</groups>
</vendor>
</sections>
</config>
<config>
<acl>
<admin>
<children>
<system>
<children>
<config>
<children>
<vendor>
<title>Vendor</title>
</vendor>
</children>
</config>
</children>
</system>
</children>
</admin>
</acl>
</config>
小贩
这将在System->Configuration中创建一个选项卡和部分,您可以在其中输入每个商店的附属url
获取您将使用的附属url
<?php echo Mage::getStoreConfig('vendor/general/affiliate_url'); ?>
你好,亚当,谢谢你的回复。是的,它是域url。我只需要它而不需要domain.com,所以前面没有任何东西,那么$domain=Mage::getBaseUrl();?否则,我将尝试第二种选择