Zen Cart Logo
Forums / All Other Contributions/Addons / Manual Product Input thru PHP

Manual Product Input thru PHP

Locked

Views: 1,039

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
15 Sep 2010, 1:46 AM
#1
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Manual Product Input thru PHP

Hi,

I'm working on v1.3.9.f
I'm having a problem manually inputting a product with Attributes using PHP. When I run the script ant input the products with quantity the products always come up as sold out.
When I use the Stock By Attributes mod, it works.

Any ideas?

Thanks
:frusty:

15 Sep 2010, 7:44 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Manual Product Input thru PHP

Could you clarify what you mean by "manually inputting a product with Attributes using PHP". Do you mean that you've written your own script with PHP and it doesn't work?

16 Sep 2010, 12:41 AM
#3
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Re: Manual Product Input thru PHP

kuroi:

Could you clarify what you mean by "manually inputting a product with Attributes using PHP". Do you mean that you've written your own script with PHP and it doesn't work?

I have written a script in PHP that is able to enter products with attributes. I have the script take a CSV datafeed file, it has in excess of 20,000 items. I have the data populating the shopping cart, but the quantity is always sold out in the cart, but there is quantity and it is correct when I check the sql database. When I manually enter an item into the cart using the stock by attributes mod included with v3.9.f the quantity shows up properly in the shopping cart.

16 Sep 2010, 2:32 AM
#4
flipside avatar

flipside

Zen Follower

Join Date:
Oct 2004
Location:
Ontario
Posts:
114
Plugin Contributions:
0

Re: Manual Product Input thru PHP

products_status = 1

Make sure you are setting the products_status field to one in your script.

16 Sep 2010, 9:29 PM
#5
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Re: Manual Product Input thru PHP

I just checked the products table, and when there's quantity in the inventory, the products_status is set to 1.

16 Sep 2010, 9:37 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Manual Product Input thru PHP

When I run the script ant input the products with quantity the products always come up as sold out.
When I use the Stock By Attributes mod, it works.
I assume that you have stock by attributes installed which adds tables for items with attributes

Is your script addressing these additional tables?

16 Sep 2010, 9:43 PM
#7
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Re: Manual Product Input thru PHP

Yes, my script does address these tables.
The names of the tables I address are: products_attributes, products_options_types, products_options, products_options_values, products_options_values_to_products_options, and products_with_attributes_stock

16 Sep 2010, 9:48 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Manual Product Input thru PHP

I just checked the products table, and when there's quantity in the inventory, the products_status is set to 1.
What about the stock levels in the other tables?
Might cross check all tables altered when you manually enter through the admin versus through your script

A diff tool can locate changes in the sql before and after

16 Sep 2010, 10:51 PM
#9
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Re: Manual Product Input thru PHP

What tool can locate the changes before and after?
I checked the stock levels in other tables, they're correct.
Let me know about the tool and I'll give it a shot.

Thanks

17 Sep 2010, 12:04 AM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4
17 Sep 2010, 12:11 AM
#11
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Re: Manual Product Input thru PHP

I've been doing exactly that.
Going to try uploading just one item with attributes, of the 20,000 datafeed, and manually input one item thru the stock by attributes mod, and do a comparison of the DB tables to see if I can spot anything.

17 Sep 2010, 12:14 AM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Manual Product Input thru PHP

As it is functional through the admin it must be something you are missing in your script

17 Sep 2010, 12:21 AM
#13
elgrcg avatar

elgrcg

New Zenner

Join Date:
Mar 2008
Posts:
38
Plugin Contributions:
0

Re: Manual Product Input thru PHP

Exactly.
It's about 300+ lines.
Is there a way I can privately share the script with you?

17 Sep 2010, 7:29 AM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Manual Product Input thru PHP

Exactly.
It's about 300+ lines.
Is there a way I can privately share the script with you?
Only if you intend on contributing & supporting it

17 Sep 2010, 7:44 AM
#15
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Manual Product Input thru PHP

To put it another way ... debugging 300+ lines of code for your personal use would be way beyond the scope of a user-to-user support forum.

However, if your intention is to package and contribute that code for wider use, there are people who may be prepared to help as part of their contribution to the wider community.