close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

storing product options in an order history table

Thread began 4/05/2012 2:46 am by Christopher West | Last modified 4/05/2012 12:30 pm by Jason Byrnes | 508 views | 3 replies |

Christopher WestCommunity Expert

storing product options in an order history table

Hi I have a range of product options (due to complexity of them, I had to create them as an array) (the product options are made up as a series of text fields, checkboxes and select lists).

How would I go about storing these in an order history table? I have read a little on the php command "serialize" would it be best to use this method to pass the array into a database?

since there are many different product options relating to a single product I was assuming that I would need 3 tables:
1. order summary
2. orders
3. orderProductOptions

then then "orderProductOptions would have a field that stores the ID from order summary table. Would that make sense?

currently on my cart.php I am displaying the options by this code:

<?php
$options = $DinkyCart->DisplayInfo("Options");
$optionArray = explode("<br>",$options);
$optionInfo = array();
for ($x=0; $x<sizeof($optionArray)-1; $x++) {
$optionInfo[] = explode("**",$optionArray[$x]);
}
?>

-----------------------------------------------------------

<tr>
<td valign="top"><p><strong>Options</strong></p>
<p>
<?php
for ($y=0; $y<sizeof($optionInfo); $y++) {
?>

<?php echo($optionInfo[$y][0]); ?>
<br>
<?php
}
?>
</p>
td>

<td align="right" valign="top">
<?php
for ($y=0; $y<sizeof($optionInfo); $y++) {
?>

£<?php echo(number_format($optionInfo[$y][1],2)); ?>
<br>
<?php
}
?>
</p></td></tr>

Sign in to reply to this post

Jason ByrnesWebAssist

I think you are overcomplicating it.

when eCart stores the order information, it uses an orders table for storing the order summary and an orderdetails table for storing a record for each product in the order using the eCart Store Order Details behavior.

the options are store in the cart options column separated by a <br> tag.

In the eCart Store Order Details behavior, you just need to bind the options column of the order details table to the options column of the cart

Sign in to reply to this post

Christopher WestCommunity Expert

ok I need to try this, but before I do, so am I right in thinking that if a product on the cart has many different types of product options (these have different prices as well) then all that will be automatically stored in the options column of the ecart.

I just cannot visualise it at the moment (so obviously I need to try that) before posting I guess. its just that the options I had created from a premier ticket with Ray because the product options arnt like the product options on your website tutorial PDFs. So I needed a hand-coded approach to the ecart. So Im just wondering is the same method your stating will also work with my product options approach.

Sign in to reply to this post

Jason ByrnesWebAssist

yes, all of the options for the product are stored in the options column of the cart separated by a <br> tag;

option1<br>option2<br>options3<br>


all you need to do is bind the options column of the order detail table to the options column of the cart.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...