Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Tables "order_products_download" not updating


HairyPotter

Recommended Posts

Posted

Hi,

 

I have been using osCommerce for some time, but never with downloadable products. After setting one product for download and enabling the download functionality, the point right now is:

 

1) the user buys a downloadable good

2) the order is registered on table "orders_order"

3) tables "order_products_attributes" and "order_products_download" are not updated and stay completely blank.

 

If I insert a new item on orders_products_download using phpMyAdmin pointing to the file I would like the user to download, then the user can see and download the file.

 

For some reason, the problem seems to be that those tables I mentioned on 3 are not updating during the sell.

 

which file should I check? checkout_process.php ?

 

before you ask me:

1) yes the file exists and it is on the correct directory

2) the attribute was linked to the product

3) the problem is really the tables not updating, specially " :(order_products_download "

Posted
which file should I check? checkout_process.php ?

 

yes, this is where the orders_products_download table has the data added to it. the table name is referenced twice within the file...both times it's inside a big if ((DOWNLOAD_ENABLED == 'true') statement. have you enabled downloadable products in your admin -> configuration -> download settings?

Posted
yes, this is where the orders_products_download table has the data added to it. the table name is referenced twice within the file...both times it's inside a big if ((DOWNLOAD_ENABLED == 'true') statement. have you enabled downloadable products in your admin -> configuration -> download settings?

 

Yes, everything is enabled.

looking checkout_process.php I found this line before the one you mentioned...

 

if (isset($order->products[$i]['attributes'])) {

 

... what you said is executed if this is true...

 

I verified that at this point

$order->products[$i]['attributes']

is completely empty.

 

No attribute is arriving there, so the IF if failing and the table is not updating.

I am trying to figure out when this attribute is being stored...

 

I think the sequence is

 

product_info.php

shopping_cart.php

checkout_confirmation.php

checkout_process.php

 

any idea when $order->products[$i]['attributes']

is stored?

 

I am desperate! :'(

thanks for your help.

Posted
if (isset($order->products[$i]['attributes'])) {

 

if my guess is right, this is being set up when you assign an attribute to the product in the admin. i know you said you're using the attributes, but how exactly are you assigning the attribute and the value for the attribute? you need to give it an attribute name and value, as well as the download product file name.

 

but to answer your question, $order-products is set up when the $order instance is created, in includes/classes/order.php. this check is simply saying something like "does this product have any attributes selected for it?", and since this is coming back as false it makes me think that the attribute wasn't set up correctly.

Posted
if my guess is right, this is being set up when you assign an attribute to the product in the admin. i know you said you're using the attributes, but how exactly are you assigning the attribute and the value for the attribute? you need to give it an attribute name and value, as well as the download product file name.

 

but to answer your question, $order-products is set up when the $order instance is created, in includes/classes/order.php. this check is simply saying something like "does this product have any attributes selected for it?", and since this is coming back as false it makes me think that the attribute wasn't set up correctly.

 

 

Hi, the products are fine.

This is where the problem is....

There are 3 tables for products:

 

products

product_attributes

product_attributes_download

 

these 3 are fine.... products are there, so do attributes.

 

and there are 4 tables for orders

orders

orders_products

orders_products_attributes

orders_products download

 

when an order is placed containing a product with an attribute, just 2 of these 4 tables are updated

orders

orders_products

 

the other two

orders_products_attributes

orders_products download

 

remain empty.

Posted
Hi, the products are fine.

This is where the problem is....

There are 3 tables for products:

 

products

product_attributes

product_attributes_download

 

these 3 are fine.... products are there, so do attributes.

 

and there are 4 tables for orders

orders

orders_products

orders_products_attributes

orders_products download

 

when an order is placed containing a product with an attribute, just 2 of these 4 tables are updated

orders

orders_products

 

the other two

orders_products_attributes

orders_products download

 

remain empty.

 

 

Hi, I solved the problem.

Thanks for your help.

The problem was really on product_info!!!!!!

probably something I have removed by accident.

Thanks!!!!!!!!!!!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...