Forums / General Questions / Best way to manually create product records?

Best way to manually create product records?

Locked

Started by drkstr on 9 Jul 2010, 10:17 PM · Views: 699

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
9 Jul 2010, 10:17 PM
#1
drkstr avatar

drkstr

New Zenner

Join Date:
Jul 2010
Posts:
4
Plugin Contributions:
0

Best way to manually create product records?

No forum category for developers? Hope I'm in the right spot with this question...

I need to manually create product records from outside the scope of the zen engine.

One option is to manipulate the tables manually. I am hesitate to do this because of the dicey one-to-one relationship between products and products_description (the relationship is defined by two auto incrementing primary keys, ack!!).

I dug through the API reference, and I was unable to find any service methods for instantiating new product records.

Can anyone please point me in the right direction for the best course of action?

Many thanks for your time!

~Aaron

9 Jul 2010, 11:11 PM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Best way to manually create product records?

drkstr:

... I need to manually create product records from outside the scope of the zen engine. .....

Not quite sure about what you are trying to achieve?

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Jul 2010, 11:32 PM
#3
drkstr avatar

drkstr

New Zenner

Join Date:
Jul 2010
Posts:
4
Plugin Contributions:
0

Re: Best way to manually create product records?

frank18:

Not quite sure about what you are trying to achieve?
Thanks for quick the reply!

I'm trying to achieve a dynamic product catalog. The products that are displayed to the customer are dependent on a "design utility" that is used on the site. Customers may purchase products designed by other customers, or design their own. The pricing of each product is dependent on the design parameters.

I was able to embed the design utility in the product_info_display template page. However, it uses an AMF remoting service (AMFPHP) to handle all the design-side operations. The service calls do not share the same session or page state as the zen cart.

Any suggestions on the best way to tackle this problem?

10 Jul 2010, 6:12 PM
#4
drkstr avatar

drkstr

New Zenner

Join Date:
Jul 2010
Posts:
4
Plugin Contributions:
0

Re: Best way to manually create product records?

After digging through the core, it appears that there is no centralized mechanism for referencing product catalogs. Instead, hard references to the database are used. Unless I am mistaken, I will need to do some core hacking in order to make session specific product catalogs.

Oh well, at least I know how to proceed.

Cheers!

~Aaron

11 Jul 2010, 12:14 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Best way to manually create product records?

Look in the Admin and you can see where the Products are added ... chase down the code via the Tools ... Developers Tool Kit ... and you will find that it is using quite a few files in the /admin and more specifically the modules in the /admin/modules ...

It starts with the categories.php for the case new_product around 497 ...

Then proceeds from there to the pages for each of the product_types ...

collect_info
preview_info
update_product

From those pieces you can see how the information for a product is gathered and saved to the two tables for:
products
products_description

Unless your Products utilize more than those tables, that is the basics ... fill in those two tables ...

Now, it sounds like you need additional fields so you may either use the same tables or those two tables plus additional tables ...

One example is the Music Product Type that uses multiple additional tables ...

Another example of broader Product types would be in the Free Software Add Ons that you might look at such as the Book Product Type ...

This would give you a better feel for how products are constructed ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Jul 2010, 6:45 AM
#6
drkstr avatar

drkstr

New Zenner

Join Date:
Jul 2010
Posts:
4
Plugin Contributions:
0

Re: Best way to manually create product records?

Excellent information, thanks@ :D