Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Set Product Features Via Api Rate Topic   - - - - -

 
  • nico
  • Newbie
  • Trial users
  • Join Date: 28-Aug 15
  • 5 posts

Posted 28 August 2015 - 10:42 AM #1

Hi all,

I'm trying to manipulate Products via CsCart API.

 

I would set the product_features via APIs, but can not figure out how.
 
Here's a piece of code:
 
        $row['product_features'] = array(
            'company_id'=>ConfigHelper::getVar('clients.asd.companyId'),
            'description'=>'Età',
            'feature_type'=>'M',
            'variants'=>array(
                array(
                    'variant_id'=>7,
                    'selected'=>7
                )
            )
        );

What am I doing wrong?

 

Thanks.

 



 
  • nico
  • Newbie
  • Trial users
  • Join Date: 28-Aug 15
  • 5 posts

Posted 28 August 2015 - 05:19 PM #2

Hi,

I've found the solution.

        $row['product_features'] = array(
            5 => array(
                'feature_id' => 5,
                'feature_type' => 'M',
                'description' => 'Età',
                'variants'=>array(
                    7 => array(
                        'variant_id' => 7,
                        'variant'=>'0-1 anni',
                    )
                )
            )
        );

Where:

- $row is the array with all the product properties

- 5 is the featureId

- 7 is the variantId

 

In the documentation is not explain very well in my opinion.

 

Thanks.