Jump to content

[PS1.6] Setting combination images via Web Service


Recommended Posts

Hi all, 

I'm trying to add images to product combinations using python library PrestaPyt.

I'm experiencing  the same issue described  at http://forge.prestashop.com/browse/PSCFV-12135, but that bug report is already closed.

First I created products with all their images; then I tried to create combinations with the right image id.

              'associations': { 
                'images': # 
                  {'image': {'id': '22'[spam-filter],
                'product_option_values': {'product_option_values': [{'id': color_id},{'id': size_id}]}
              'available_date': fix_date(row[14]),
              'default_on': '1',
              'ean13': row[23],
              # 'ecotax': '',
              # 'id': '',
              'id_product': product_id,
              # 'location': '',
              'minimal_quantity': '1',
              'price': row[20].replace(',','.'),
              # 'quantity': '',
              'reference': row[3],
              # 'supplier_reference': '',
              # 'unit_price_impact': '',
              # 'upc': '',
              # 'weight': '',
              'wholesale_price': row[12].replace(',','.')
ret = prestashop.add('combinations', data)

But the response doesn't contains any image id

    {'associations': {
      'images': {'attrs': {'node_type': 'image'}, 'value': ''}, 
      'product_option_values': {'attrs': {'node_type': 'product_option_values'}, 
      'product_option_values': [{'id': '561'}, {'id': '568'}]}
    'ean13': '', 
    'supplier_reference': '', 
    'weight': '', 
    'reference': 'JEANS001-US30-BK', 
    'wholesale_price': '', 
    'price': '0.00', 
    'minimal_quantity': '1', 
    'upc': '', 
    'default_on': '1', 
    'location': '', 
    'available_date': '', 
    'unit_price_impact': '', 
    'ecotax': '', 
    'quantity': '', 
    'id': '133', 
    'id_product': '104'


How can I obtain this?
Thanks in advance


Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...