Zen Cart Logo
Forums / General Questions / Calling for the 'product type'

Calling for the 'product type'

Locked

Views: 756

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
4 Jul 2010, 6:31 PM
#1
nehoward64 avatar

nehoward64

Zen Follower

Join Date:
Mar 2010
Location:
Battle Creek, MI
Posts:
124
Plugin Contributions:
0

Calling for the 'product type'

Hey all,

I am working on what should be a simple mod to an add on and have a question regarding the 'product_type'...

Example... Product_general

When within a module, and you make the following information request:

(isset($_GET['product_type]) ? '$product_type=' $_GET['product_type'] : ' ')

what date will populate the variable?

Will it simply be "product_general" or "general" or some other message stored somewhere in a database?

Thanks in advance.

Nelson

5 Jul 2010, 11:24 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Calling for the 'product type'

None of that will give you anything about the product type, since $_GET['product_type'] is never set.

It would be much better if you were to explain what you're trying to do and why, instead of getting too specific into a non-working solution :)

6 Jul 2010, 3:14 AM
#3
nehoward64 avatar

nehoward64

Zen Follower

Join Date:
Mar 2010
Location:
Battle Creek, MI
Posts:
124
Plugin Contributions:
0

Re: Calling for the 'product type'

Lol, thanks for the heads up!

What i am doing is trying to modify the 'selling gold' addon to incorporate all 4 of the 'precious' metals, by aquiring the product type from within either 'collectinfo.php' or 'previewinfo.php' my hope is to automate the function of updating from the currency server all 4 metals at once and also being able to have admin>catalog>products automatically know what metal type to use when adding or editing a product based on the information gathered during the inquiry.

Maybe i am on the wrong track, but, i am thinking that if i can create all 4 product types(product_silver, product_gold, product_platinum, product_palladium), when admin is entering a new product and the catagory is set for 'product_silver', collectinfo.php could simply make a call for the product type. Once the product type is known, you set it in a variable and use that as the means for making the appropriate query to the currency type and/or the currency server to update the price. (does that make sense?)

Anyhow, that is the plan....

Nelson

6 Jul 2010, 3:43 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Calling for the 'product type'

Oh. You're talking about the admin side.
Yes, in that case $_GET['product_type'] will contain the numeric value of the product type selected for adding the new product or editing an existing one.

So, after you've added your product types, you can see the "number" by going to Admin->Catalog->Product Types, and clicking on the product type you want to know the number for. The "ptID" value in the browser Address bar will tell you the number associated with that product-type.

6 Jul 2010, 6:33 PM
#5
nehoward64 avatar

nehoward64

Zen Follower

Join Date:
Mar 2010
Location:
Battle Creek, MI
Posts:
124
Plugin Contributions:
0

Re: Calling for the 'product type'

ok, that is perfect, and once the currency has been determined based on the product type(metal type) the correct price will be reflected to the customer based on the most recently updated exchange rate from the server. It is starting to seem fairly straight forward now....

Thanks a bunch for the input...

Nelson

(wishing i had learned PHP sooner instead of OS9 and UNIX)