sanjaymodasia/redboxdigitallinkedin

将客户的新属性“Linkedin属性”干净地集成,用于管理Linkedin个人资料URL

安装: 22

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

语言:HTML

类型:magento-module

dev-master 2016-06-07 12:13 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:36:40 UTC


README

安装

通过GIT

  • 克隆此仓库
  • 如果你使用它,请禁用编译。
  • 将仓库中的文件复制到你的magento安装的基础目录中
  • 清除你的缓存
  • 重新启用编译

通过Composer

  • 禁用编译

  • 更新以下内容到你的composer文件中的相应部分

   "require": {
           "sanjaymodasia/redboxdigitallinkedin": "dev-master"
      },
   "repositories": [
      {
            "type": "vcs",
            "url": "https://github.com/sanjaymodasia/RedboxDigitalLinkedin"
        }
    ],
    
  • 更新composer:composer.phar update
  • 清除缓存
  • 重新启用编译

卸载

手动

  • 打开app/etc/modules/RedboxDigital_Linkedin.xml文件并按照以下内容进行更改
    <config>
        <modules>
            <RedboxDigital_Linkedin>
                <active>false</active>
                <codePool>community</codePool>
            </RedboxDigital_Linkedin>
        </modules>
    </config>

通过Composer

  • 从你的composer文件中删除以下内容
   "require": {
           "sanjaymodasia/redboxdigitallinkedin": "dev-master"
      },
   "repositories": [
      {
            "type": "vcs",
            "url": "https://github.com/sanjaymodasia/RedboxDigitalLinkedin"
        }
    ],
  • 更新composer:composer.phar update
  • 清除缓存
  • 重新启用编译

从核心资源表中移除客户自定义属性和模块设置

  • 如果你想完全从你的店铺中卸载模块,请使用以下代码从核心资源表中清除linkedin_profile属性和模块设置
    <?php
    error_reporting(E_ALL | E_STRICT);
    $mageFilename = 'app/Mage.php';
    require_once $mageFilename;
    Mage::setIsDeveloperMode(true);
    umask(0);
    Mage::app();
    Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));

    $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

    try {
        $custAttr = 'linkedin_profile';  // here enter your attribute name which you want to remove
       
        $setup->removeAttribute('customer', $custAttr);
        echo $custAttr." attribute is removed";
    }
        catch (Mage_Core_Exception $e) {
        $this->_fault('data_invalid', $e->getMessage());
    }

    ?>

使模块在任何其他自定义主题中工作

安装此模块后,如果你发现模块不工作

  • 通过启用“模板路径提示”来检查edit.phtml文件,方法是通过admin => system => configuration => Developer(在左侧的“高级”选项卡下)=>选择Current Configuration Scope:(当前店铺) => Debug => Template Path Hints => yes,并检查路径

  • 通过admin => system => configuration => Developer(在左侧的“高级”选项卡下)=> template settings => Allow Symlinks => yes来允许符号链接

  • 如果edit.phtml来自你的任何自定义主题,请转到该phtml文件并执行以下代码

    <?php 
    $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
                    ->setCodeFilter('linkedin_profile')
                    ->getFirstItem();
    ?>
    <?php if($attributeInfo): ?>
        <?php $isRequired = Mage::getStoreConfig('customer/redboxdigital_linkedin/required');?>
        <div class="fieldset">
            <h2 class="legend"><?php echo $this->__('Additional Information') ?></h2>
            <ul class="form-list">
                <li class="fields">
                   <div class="field">
                       <label for="<?php echo $attributeInfo->getAttributeCode(); ?>" <?php if($isRequired):?>class="required"><em>*</em> <?php  else :?>><?php endif;?><?php echo $this->__($attributeInfo->getFrontendLabel()); ?></label>
                       <div class="input-box">
                       <?php if($attributeInfo->getFrontendInput()== 'text'):?>
                           <input type="text" name="<?php echo $attributeInfo->getAttributeCode(); ?>" id="<?php echo $attributeInfo->getAttributeCode(); ?>" value="<?php echo $this->escapeHtml($this->getCustomer()->getLinkedinProfile()) ?>" title="<?php echo $this->__($attributeInfo->getFrontendLabel()); ?>" class="<?php if($isRequired): ?>required-entry<?php endif; ?> input-text <?php echo $attributeInfo->getfrontendClass(); ?>" />
                       <?php endif;?>
                       </div>
                   </div>
               </li>
            </ul>
        </div>
    <?php endif; ?>