Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

$order->products question


Guest

Recommended Posts

In a number of product queries the variable $order->products[$i]['id'] is used to reference the id of a product. What this value evaluatues to is typically something with the structure of #{#}# as opposed to just a #. the extraneous stuff seems to be attribute related and appears to duplicate the information in $order->products[$i]['attributes'][$j]['option_id'] and $order->products[$i]['attributes'][$j]['value_id']. Is there a reason for this duplication, and if so, is it safe to assume that sending just the first # through the query will produce the desired result? It appears mysql takes just the first part (before the {) and automatically drops the rest, postgresql will not accept strings that dont convert to int so I'm having to strtok off the first # in the query string assembly. Seems to work okay so far, but was just wondering if there was a reason for the information duplication.

Link to comment
Share on other sites

Your best bet is to

print_r($order);

on one of the checkout pages when you have a cart full of items with attributes.

 

Perhaps seeing the structure of the order class will give you a better idea of why the syntax. While it appears to be a duplication of information is actually is not.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...