Hello Mohammed,

Thanks for reply.

The magentoerponnect don't permit choice between simple and configurable 
product.
Only  ol_catalog method works now.

So i hope, your update quickly :-) or indications to update myself.

Regards,


> Mohammed NAHHAS <mailto:[email protected]>
> 22 novembre 2011 14:11
> Hello Thierry,
>
> Sorry for this late answer,
>
> Actually, creating Bundle and configurable products is done by calling
> "catalog_product.create" .
>
> It will be useful to combine the creation of all products types in a
> single function (catalog_product.create), in this way all we'll have to
> do is to pass the type of product we want to create and the correct
> data.
>
> I'll keep you up to date when it will be done, In the meantime here's an
> example of creating Bundle Product.
>
> I hope that it will be useful
>
>
> Creating Bundle Product :
> -----------------------------------
>
> */ method to call : catalog_product.create
>
> */ parameters :
> (string) $type : type of the product to create, 'bundle'
> (int) $set : attribute set id
> (string) $sku : sku of product to create, must be unique
> (array) $proudct_data : array which contained, product, options and 
> bundle items data
> (string) $store : store code or store id, store id will be retrieved 
> if store code is given
>
> */ returns :
> (int) $id : id of bundle product created
>
> content of $product_data :
> -------------------------------------
>
> $product_data is array which contains :
> Product data : name, description, status, visibility,....
> Options data : option name, input type, position, required.
> Bundle items data : item (product_id), default qty, user defined qty, 
> position, is default.
>
> */ Example : calling the method catalog_product.create (SOAP), to create
> a bundle product, with 2 options named ”Radio Option” & “Select Option”
> and 3 bundle items
>
> */ Note : bundle items must be an existing simple products.
>
>
> public function myFonction() {
>
> /* option N: 1 for the Bundle Product (this option will be required, 
> its type is "select and its name is Select Option */
> $options_data[0] = array(
> 'required' => 1,
> 'option_id' => '',
> 'position' => 0,
> 'type' => 'select',
> 'title' => 'Select Option',
> 'default_title' => 'Select Option',
> 'delete' => '',
> );
>
> /* data of items associated to bundle product [for the option N:1] - 
> Note : option and items data have the same index [0]*/
> $bundle_items_data[0][] = array(
> 'product_id' => 2, // item product Id, this id must exist in magento DB
> 'selection_qty' => 1,
> 'selection_can_change_qty' => 1,
> 'position' => 0,
> 'is_default' => 1,
> 'selection_id' => '',
> 'selection_price_type' => 0,
> 'selection_price_value' => 0.0,
> 'option_id' => '',
> 'delete' => ''
> );
>
> $bundle_items_data[0][] = array(
> 'product_id' => 4,
> 'selection_qty' => 1,
> 'selection_can_change_qty' => 1,
> 'position' => 0,
> 'is_default' => 0,
> 'selection_id' => '',
> 'selection_price_type' => 0,
> 'selection_price_value' => 0.0,
> 'option_id' => '',
> 'delete' => ''
> );
>
> /* Option N: 1 for the Bundle Product (this option will be required, 
> its type is "select and its name is Select Option */
> $options_data[1] = array(
> 'required' => 0,
> 'option_id' => '',
> 'position' => 1,
> 'type' => 'radio',
> 'title' => 'Radio Option',
> 'default_title' => 'Radio Option',
> 'delete' => '',
> );
>
> /* data of items associated to bundle product [for the option N:2] - 
> Note : option and items data have the same index [1]*/
> $bundle_items_data[1][] = array(
> 'product_id' => 7, // id_produit
> 'selection_qty' => 10, // "Default Qty"
> 'selection_can_change_qty' => 0, // "User Defined Qty"
> 'position' => 0,
> 'is_default' => 1,
> 'selection_id' => '',
> 'selection_price_type' => 0,
> 'selection_price_value' => 0.0,
> 'option_id' => '',
> 'delete' => ''
> );
>
>
> $product_data = array(
> 'created_at' => date("Y-m-d H:i:s", 
> Mage::getModel('core/date')->timestamp(time())), 'name' => 
> 'Bundle_Product_name',
> 'description' => 'Bundle Product Description',
> 'short_description' => 'Bundle Product Short Description',
> 'sku_type' => 0, // Type Of Sku : Dynamic Or Fixed
> 'shipment_type' => 1, //Shipment of Bundle Items : Togheter (0); 
> Separately(1)
> 'weight_type' => 0, // Type of the attribute weight : Dynamic Or Fixed 
> (if dynamic do not give a value of weight
> 'status' => 1, // enabled (1) ; Disabled (2)
> 'visibility' => 4,
> 'price_type' => 0, // Dynamic Or Fixed
> 'price_view' => 0, // "Price Range" or "As Low As"
> 'categories' => array(3),
> 'website_ids' => array(1),
> 'options_data' => $options_data,
> 'bundle_items_data' => $bundle_items_data
> );
>
>
> $product_id = $this->_magentoClient->call($this->_session, 
> 'catalog_product.create', array('bundle', 4, 15, $product_data, 1));
> }
>
> Thierry <mailto:[email protected]>
> 16 novembre 2011 19:00
> Public bug reported:
>
> Hello,
>
> I install magento 1.6.1 and the latest version of the connector.
> Note : i setup a dedicated magento with only the connector as 
> extension to be sure.
>
> When installed, it break the magento API due some broken part into the
> extended API in creation and update of products.
>
> Some part of my debug:
>
> In creation mode, some part of product are available (sku, stock, 
> website_id) but nothing in description, status, weight,...
> So the product is not visible into the backend of magento.
>
> I think there is a problem with this part into Ol_Catalog/Products.php
> where attributes are not processed.
>
>
> foreach 
> ($product->getTypeInstance(true)->getEditableAttributes($product) as 
> $attribute) {
> if ($this->_isAllowedAttribute($attribute)
> && isset($productData[$attribute->getAttributeCode()])) {
> $product->setData(
> $attribute->getAttributeCode(),
> $productData[$attribute->getAttributeCode()]
> );
> }
> }
>
> This part where attribute name is declare is processed :
> if (isset($productData['website_ids']) && 
> is_array($productData['website_ids'])) {
> $product->setWebsiteIds($productData['website_ids']);
> }
>
>
> In update mode get same problem with the foreach.
>
> Thanks for your help to solve this.
>
> Regards,
>
> Thierry
>
> ** Affects: magentoerpconnect
> Importance: Undecided
> Status: New
>


** Attachment added: "compose-unknown-contact.jpg"
   
https://bugs.launchpad.net/bugs/891271/+attachment/2604947/+files/compose-unknown-contact.jpg

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/891271

Title:
  update and create function broken on magento 1.6.1

Status in Magento OpenERP Connector:
  New

Bug description:
  Hello,

  I install magento 1.6.1 and the latest version of the connector.
  Note : i setup a dedicated magento with only the connector as extension to be 
sure.

  When installed, it break the magento API due some broken part into the
  extended API in creation and update of products.

  Some part of my debug:

  In creation mode, some part of product are available (sku, stock, website_id) 
but nothing in description, status, weight,...
  So the product is not visible into the backend of magento.

  I think there is  a problem with this part into
  Ol_Catalog/Products.php where attributes are  not processed.

  
  foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as 
$attribute) {
              if ($this->_isAllowedAttribute($attribute)
                  && isset($productData[$attribute->getAttributeCode()])) {
                  $product->setData(
                      $attribute->getAttributeCode(),
                      $productData[$attribute->getAttributeCode()]
                  );
              }
          }

  This part where attribute name is declare is processed :
  if (isset($productData['website_ids']) && 
is_array($productData['website_ids'])) {
              $product->setWebsiteIds($productData['website_ids']);
          }

  
  In update mode get same problem with the foreach.

  Thanks for your help to solve this.

  Regards,

  Thierry

To manage notifications about this bug go to:
https://bugs.launchpad.net/magentoerpconnect/+bug/891271/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help   : https://help.launchpad.net/ListHelp

Reply via email to