Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

attributes in function add_product()


daroch

Recommended Posts

Posted

Hi all!

 

This is my first topic and my english is very bad but i'm going trying explain my little problem with the sintax of function

add_product('products_id','quantity','attributes') in catalog/includes/classes/shopping_cart.php.

 

I want to add a product directly in the shopping cart from a link.

For example, i'm using:

<?php

$cart->add_product('15','2');

?>

and with this, the catalog add two units of product wich has id=15 and it's OK

 

The problem starts when i try add a product with specific attributes, i think that the attributes is a array as ['option_id']['option_value_id] and i'm trying add a product with the option_id=6 and the value_option_id=14 selected:

 

<?php

$cart->add_product('15','2','[6][14]'); ?>

 

but this no sends the attributes.

What am I doing bad?

 

Thak you very much... :ph34r:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...