예제 #1
0
파일: Tax.php 프로젝트: relue/magento2
 /**
  * Creates instance of class
  *
  * @param array $taxInfo as described in product requirements
  * @see http://code.google.com/intl/ru/apis/shopping/content/getting-started/requirements-products.html#tax
  */
 public function __construct(array $taxInfo = array())
 {
     $this->registerAllNamespaces(Varien_Gdata_Gshopping_Content::$namespaces);
     parent::__construct('tax', $this->_rootNamespace, $this->lookupNamespace($this->_rootNamespace));
     $this->_taxInfo = $taxInfo;
     foreach ($taxInfo as $key => $value) {
         $this->_extensionElements[] = new Zend_Gdata_App_Extension_Element($key, $this->_rootNamespace, $this->_rootNamespaceURI, $value);
     }
 }
예제 #2
0
 /**
  * Creates instance of class
  *
  * @param array $shippingInfo as described in product requirements
  * @see http://code.google.com/intl/ru/apis/shopping/content/getting-started/requirements-products.html#shipping
  */
 public function __construct(array $shippingInfo = [])
 {
     $this->registerAllNamespaces(\Magento\Framework\Gdata\Gshopping\Content::$namespaces);
     parent::__construct('shipping', $this->_rootNamespace, $this->lookupNamespace($this->_rootNamespace));
     $this->_shippingInfo = $shippingInfo;
     foreach ($shippingInfo as $key => $value) {
         $this->_extensionElements[] = new \Zend_Gdata_App_Extension_Element($key, $this->_rootNamespace, $this->_rootNamespaceURI, $value);
     }
 }
예제 #3
0
 /**
  * Create a new instance.
  *
  * @param string $name (optional) The name of the Base attribute
  * @param string $text (optional) The text value of the Base attribute
  * @param string $text (optional) The type of the Base attribute
  */
 public function __construct($name = null, $text = null, $type = null)
 {
     $this->registerAllNamespaces(Zend_Gdata_Gbase::$namespaces);
     if ($type !== null) {
         $attr = array('name' => 'type', 'value' => $type);
         $typeAttr = array('type' => $attr);
         $this->setExtensionAttributes($typeAttr);
     }
     parent::__construct($name, $this->_rootNamespace, $this->lookupNamespace($this->_rootNamespace), $text);
 }
예제 #4
0
 /**
  * Create a Content attribtue new instance.
  *
  * <sc:attribute name="[$name]" type="[$type]">
  *     [$text]
  * </sc:attribute>
  *
  * @param string $name The name of the Content attribute
  * @param string $text The text value of the Content attribute
  * @param string $type The type of the Content attribute
  * @param string $unit Currency for prices
  */
 public function __construct($name = null, $text = null, $type = null, $unit = null)
 {
     $this->registerAllNamespaces(\Magento\Framework\Gdata\Gshopping\Content::$namespaces);
     $reserved = array('id', 'image_link', 'content_language', 'target_country', 'expiration_date', 'adult');
     if (null !== $unit) {
         $this->_extensionAttributes['unit'] = array('name' => 'unit', 'value' => $unit);
     }
     if (in_array($name, $reserved)) {
         $elementName = $name;
     } else {
         $elementName = 'attribute';
         if (null !== $name) {
             $this->_extensionAttributes['name'] = array('name' => 'name', 'value' => $name);
         }
         if (null !== $type) {
             $this->_extensionAttributes['type'] = array('name' => 'type', 'value' => $type);
         }
     }
     parent::__construct($elementName, 'sc', $this->lookupNamespace('sc'), $text);
 }