Magento从一页结账(billing.phtml)中保存客户自定义属性中的价值

时间:2016-05-11 09:24:41

标签: magento custom-attribute

我为客户注册制作了一个属性。注册工作正常。我在一页结账时遇到问题。像正常注册一样,我也在一步结账注册时从客户那里获取价值,但问题是它没有将值存储在属性中。先感谢您 billing.phtml的代码,显示属性的文本框以从用户获取值

                    <li class="fields">
                       <div class="field">
                           <label for="<?php echo $attribute->getAttributeCode(); ?>" <?php if($attribute->getIsRequired()):?>class="required"><em>*</em> <?php  else :?>><?php endif;?><?php echo $this->__($frontEndLabel) ?></label>
                          <div class="input-box">

                               <?php if($attribute->getFrontendInput()== 'text'):?>
                                   <input type="text" name="billing[test]" id="billing:<?php echo $attribute->getAttributeCode(); ?>"  title="<?php echo $this->__($frontEndLabel); ?>" class="input-text <?php echo $fieldRequiredClass; ?> <?php echo $fieldFrontendClass ;?>"  />
                                  <?php endif ?>
                           </div>        
                        </div>

            <?php endif ?>
           <?php endforeach ?> 
           </li>

1 个答案:

答案 0 :(得分:1)

只需更新config.xml中的以下代码并进行检查即可

class Queue:
    def __init__(self):
        self.lista=[]

    def put(self,x):
        self.lista.append(x)

    def get(self):
        if not len(self.lista)==0:
            return self.lista.pop(0)

    def isempty(self):
        if len(self.lista)==0:
            return True
        else:
            False

    def length(self):
        return len(self.lista)


    def dequeue(self):
        if not len(self.lista)==0:
            n=self.lista.pop(0)
            return n

    def enqueue(self,item):
        self.lista.insert(0,item)

class Word:
    def __init__(self,w,f=None):
        self.word=w
        sel.parent=f

def hamta():
    ordlista=[]
    fil=open("labb9text.txt")
    ordlista=[]
    for line in fil.readlines():
        ordlista.append(line.strip())
    return ordlista

def setlista():
    ordlista=hamta()
    setlista=set()
    for a in ordlista:
        if a not in setlista:
            setlista.add(a)
    return setlista

def hittabarn(parent):
    mangd=setlista() 
    children=[]
    lparent=list(parent)
    mangd.remove(parent)
    for word in mangd:
        letters=list(word)
        count=0
        i=0
        for a in letters:
            if a==lparent[i]:
                count+=1
                i+=1
            else:
                i+=1
            if count==2:
                if word not in children:
                    children.append(word)
            if i>2:
                break
    return children

def way(start,slut): 
    queue=Queue()
    queue.enqueue(start)
    visited=set()                       
    while not queue.isempty():
        vertex=queue.get()
        if vertex==slut:
            return True
        else:
            s=hittabarn(start)
            for vertex in s:
                if vertex not in visited:
                    queue.put(vertex)
                else:
                    visited.add(vertex)
        return False