Guest Posted May 29, 2009 Share Posted May 29, 2009 Hi all, Two of our osCommerce stores sell products which can be cut to a custom size for our customers; I have already written some code which allows the customer to specify the dimensions and material type of their products (I have the data loaded into an array), but I am at a loss as to how I can add these dynamically generated products to the shopping cart. I did find a thread in the forum which suggested that someone might have already achieved this (http://www.oscommerce.com/forums/index.php?sho...ynamic+products), but the author of that particular topic has not replied for my request for more information about which contribution he used. If anyone can offer any guidance I will be most grateful. Cheers, Paul Link to comment Share on other sites More sharing options...
Guest Posted May 29, 2009 Share Posted May 29, 2009 Hi again, Following a test of the state osCommerce leaves the underlying database in when a product (which has been previously purchased) is deleted, I have formulated a plan for how I am going to tackle this problem; I thought I would detail my plans here, in case anyone else might find them useful, and also to maybe get some useful feedback: 1. I will create a function that formats my dynamic product for the product catalogue; this function will call another function which will then submit the dynamic product to the catalogue. These dynamically added products will carry an identifying model number field, which allows them to be identified as custom products (i.e. "CUSTOM"). 2. Once the dynamic products are added to the catalogue, the ID's of those products will be blasted into the customers basket. .....now if I were to just leave all of these custom product additions in the database it would soon become very bloated, so here's the part of my plan which may or may not be the best way to go...... 3. When the status of "any" order in the system is changed to delivered the model numbers of all products associated with that order will be checked for the identifying "CUSTOM" flag; any products with the flag (only for the order in question) will then be deleted from the product table (the basic product details still remain in the "orders_products" table for historical reference). One consquence of taking this approach, is that there will be an ever-growing number of invalid product ID's listed in the "orders_products" table; and as I sit here writing this now, I am wondering if the ID's for the deleted products might be reused by osCommerce when subsequent products are added to the catalogue (and whether or not this will cause me a problem). Any comments will be gratefully received. Cheers, Paul Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.