chrometweaks.org

Uploading images to iPage.com web site. How long does it take to update?

Click Here To View All Answers...


Got a quick question: Uploading images to iPage.com web site. How long does it take to update? Thanks in advance for any response. 2nd question I got is.. First, thanks again for all your efforts to help me get this right. I really, really appreciate it. (Just wish I wasn't such a bimbo that I couldn't get it right the first time!).

Okay, so I just tried to change it as shown above, and now the availability id numbers don't show up on the page at all. :-(.

Sigh....

Terry..

Comments (80)

I would like to know the answer too. Anyone here know what is the answer. I'll do some investigation and get back to you if I got an anything. You should email the people at iPage as they probably can answer it..

Comment #1

BTW, which is what I originally said two posts ago..

Comment #2

But what you said two posts ago didn't work either..

( Though I would have.

No.

Problem with your blaming the 'operator' no doubt I've missed something! ).

Just to be sure, I've tried it again. Here's the code I have there now:.

In /catalog/includes/classes/shopping_cart.php:.

       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_availability_id, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, ". TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pd.language_id = '"(int)$languages_id"'");.

       if ($products = tep_db_fetch_array($products_query)) {.

         $prid = $products['products_id'];.

         $products_price = $products['products_price'];.

$products_availability = $product_info['products_availability_id'];.

$products_availability_info_query = tep_db_query("select e.products_availability_name from "TABLE_PRODUCTS_AVAILABILITY" e where e.products_availability_id = '"(int)$products_availability"' and e.language_id = '"(int)$languages_id"'");.

$products_availability_info = tep_db_fetch_array($products_availability_info_query);.

$products_availability_name = $products_availability_info['products_availability_name'];.

And in the array:.

                                   'products_availability' => $products_availability_name,.

And in /catalog/shopping_cart.php:.

     $products_name .= '<small> '$products[$i]['products_availability']'</small><br>';.

My page displays, but no product availability info. Honest! Would it help you to access a URL? If so I could PM it to you..

Terry..

Comment #3

I hear you,.

$products_availability = $product_info['products_availability_id'];.

Should be:.

$products_availability = $products['products_availability_id'];.

This post has been edited by.

Gregbaboolal.

: 05 February 2004, 06:29..

Comment #4

OMG you're brilliant!!! It works!!!!.

Thank you, thank you, thank you!.

Terry..

Comment #5

Now I promise I'll leave the orders.php file alone until at least tomorrow..

Terry..

Comment #6

Now where's my admin button template.

Only kidding, you're welcome...thanks..

I'm sure you'll get it..

Just a liitle reminder, that when developing/debugging it is often usefull to temporarily use an echo statement to show the value(s) of a variable at a particular time or state etc.. e.g:.

Echo 'PRODUCTS AVAILABILITY NMAE = '.$products_availability_name.'<br>';.

This might cause a error msg about headers already sent, but it is only temporary while your trying to debug, remembering to remove the echo afterwards that is...

Comment #7

"Oh dear," she says sheepishly as a vague recollection causes her to scroll through some old messages....

Sorry, Greg. My email inbox averages around 6000 messages/day, and between spam and orders, I often lose sight of the 'real' ones..

I'll email you to get more details and will be VERY happy to help!.

Terry.

This post has been edited by.

TerryK.

: 05 February 2004, 06:48..

Comment #8

Ahym, with the danger of sounding patronizing.

You should check you MySQL query. The error you get is because when you build it you select the following attribute: p.products_availability_name where it should read pav.products_availability_name, since you named your TABLE_PRODUCTS_AVAILABILITY as "pav". For more info on MySQL queries go to:.

Http://www.mysql.com.

..

That's only addressing your current error message (if you haven't fixed it yet)..

.... i'm sure the toupee would look nice on ya.

Hope I helped..

Comment #9

Christ.

Didn't realize there were 3 pages hehehe - disregard the previous message..... dumb I was..

Comment #10

I've spent all day today searching the forums for the answer (plus more hours than I care to admit the past couple of weeks) but have only ended up more confused than I was to begin with, which is not a pretty sight....

I'd like to port certain fields from my products table through to checkout_confirmation and the confirmation Email that goes to a customer. I've found pieces here and there that address one part or another, but have been unable to get any of them to work..

I've been successful in adding new fields to the product_info page, but arrays in shopping_cart.php aren't written the same way, and all I manage to get is parse errors..

Can anyone explain to me, step by step, what it takes to get something from the table to display in the shopping cart, and then carry through to the Email confirmation? I would be *so* grateful..

TIA,.

Terry..

Comment #11

Can you give a more specific example of what you would like to do,.

For example do you want to list a particular product's name and price again on the confirmation page?..

Comment #12

I have a number of fields in my product table that I need to carry through the process, including:.

Product # - a field I created myself using the 'Extra Fields' mod/instructions.

Availability (to show in stock / on backorder, etc.) - this was a contrib that takes the availability message to the product info page, but not through to the order info.

Model - I use to display formats like CD, Cassette, VHS, etc..

Oh, please, please, please say you can help me I'm going from blonde to bald, and I'm not sure which will be worse!.

TIA,.

Terry..

Comment #13

I'm not familar with those contribs so I don't know (if at all) how they store their information in the shopping_cart..

Try inserting this code somewhere in the (main body of) checkout_confirmation.php (backup first!).

For ($i=0; $i<sizeof($order->products); $i++) {.

Echo 'Product = '.$order->products[$i]['name'].'<br>';.

Echo 'Model = '.$order->products[$i]['model'].'<br>';.

Echo 'Qty = '.$order->products[$i]['qty'].'<br>';.

//Now try for the bit(s) you want.

Echo 'Product No = '.$order->products[$i]['product_number'].'<br>';.

Echo 'Availability = '.$order->products[$i]['product_availability'].'<br>';.

For ($j=0; $j < sizeof($order->products[$i]['attributes']); $j++) {.

  if($order->products[$i]['attributes'][$j]['option']){.

    echo 'Option No = '.$j.' Atrribute = '.$order->products[$i]['attributes'][$j]['option']. ' Value = '.$order->products[$i]['attributes'][$j]['value']'<br>';.

  }.

}.

Echo '<hr>';.

}.

It will try and list (some of) the information about the products in the 'order' (from the shopping_cart class), you might have to change the var names where it says 'Now try for the bits you want' to suit the var names of used by those contributions..

This post has been edited by.

Gregbaboolal.

: 01 February 2004, 08:53..

Comment #14

Thanks so much! I'll give this a try tomorrow after a few hours of sleep and see how it goes. Will let you know....

Thanks again!.

Terry..

Comment #15

Ok, biting more than I chew here (time wise more than anything),.

But quickly thinking, you will also need to look at the follwing bit of the code in 'order.php' in the includes/classes directory.

This is were the info from the previous snippet code shown above is coming from, so you might have to amend the sql query to include the fields that you require, if the contributions have not already done so, I think, help.

..

$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from "TABLE_ORDERS_PRODUCTS" where orders_id = '"(int)$order_id"'");.

     while ($orders_products = tep_db_fetch_array($orders_products_query)) {.

       $this->products[$index] = array('qty' => $orders_products['products_quantity'],.

                                'id' => $orders_products['products_id'],.

                                       'name' => $orders_products['products_name'],.

                                       'model' => $orders_products['products_model'],.

                                       'tax' => $orders_products['products_tax'],.

                                       'price' => $orders_products['products_price'],.

                                       'final_price' => $orders_products['final_price']);.

       $subindex = 0;.

       $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from "TABLE_ORDERS_PRODUCTS_ATTRIBUTES" where orders_id = '"(int)$order_id"' and orders_products_id = '"(int)$orders_products['orders_products_id']"'");.

       if (tep_db_num_rows($attributes_query)) {.

         while ($attributes = tep_db_fetch_array($attributes_query)) {.

           $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],.

                                                                    'value' => $attributes['products_options_values'],.

                                                                    'prefix' => $attributes['price_prefix'],.

                                                                    'price' => $attributes['options_values_price']);.

           $subindex++;.

         }.

       }..

Comment #16

Also, exactly which database table is this info stored in, products or orders_products, the above assumes the latter?..

Comment #17

Thanks again for your help..

The fields are stored in the following tables:.

1. products_availability_name is in table: products_availability.

2. products_item_number and products_model are both in table: products.

I've now managed to get the item number and model to display in my shopping cart, but not the availability text. I presume it's because this code:.

       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pd.language_id = '"(int)$languages_id"'");.

       if ($products = tep_db_fetch_array($products_query)) {.

Isn't calling anything from the products_availability table, but I'm not sure how to add it. What's the significance of the "p" and "pd" in the query? Would I need to put something like "pa" for product availability in there?.

Please help, if you can....

TIA,.

Terry..

Comment #18

Yeah, you spotted the right place,.

If you notice that is in the function get_products() which is defined in the shopping_cart class and called/used in the order class a few lines above the bit of code I showed you in the previous post..

P, and pd is an abbreviation for the 'products' and 'products_description' tables; notice that both tables each have a products_id field, this why there is the statement pd.products_id = p.products_id to ensure that each record from the table match correspondingly, and the abbreviation saves having to spell out the lenthy table name, so you add into:.

TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where.

Somethin like this:.

TABLE_PRODUCTS" p, ".TABLE_PRODUCTS_AVAILABILITY." pa, ". TABLE_PRODUCTS_DESCRIPTION" pd where.

And now also have to have a statement(s) like:.

Pa.products_id = p.products_id and pa.products_id = pd.products_id.

You may well just be able to achieve this with a left join statement but not sure, but the above will suffice..

So once you have updated the query statement, you then need to store this in the $products_array[] by adding the respective fields like:.

'products_availability' => $products['products_availability'],.

You can add the fields from the products table that you require into the above SQL statement,.

Now have a look in the orders.php class and see that you can now import this info into this class, and hopefully use wherever..

Give a shout if stuck...

Comment #19

"Help!," she shouts desperately, as she sits at her computer, surrounded by an oozing blob of adhesive muck that is rapidly edging closer, threatening her very being in it's determination to leave her stuck in coding h*ll for all eternity....

[ / drama].

Okay, I've tried adding this code, but am obviously doing something wrong. Here's what I added in /catalog/includes/classes/shopping_cart.php (note: I made products_availability table "pav" as there is already a "pa" for attributes though I don't know if it has any affect on this array...) :.

     $products_array = array();.

     reset($this->contents);.

     while (list($products_id, ) = each($this->contents)) {.

       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_availability_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, ". TABLE_PRODUCTS_AVAILABILITY ." pav, ". TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pav.products_id = p.products_id and pav.products_id = pd.products_id and pd.language_id = '"(int)$languages_id"'");.

       if ($products = tep_db_fetch_array($products_query)) {.

         $prid = $products['products_id'];.

         $products_price = $products['products_price'];.

And:.

         $products_array[] = array('id' => $products_id,.

                                   'name' => $products['products_name'],.

                                   'model' => $products['products_model'],.

                                   'image' => $products['products_image'],.

                                   'availability' => $products['products_availability_name'],.

Etc..

In /catalog/shopping_cart.php, I've added:.

     $products_name .= '<small> '$products[$i]['availability']'</small><br>';.

When I upload it to my server, I get this error on my cart page:.

And here I was so proud of myself for getting the other bits to work... Please help I've already had to invest in a toupee..

TIA,.

Terry..

Comment #20

When I get fed up with the computer, I just reboot and try a fresh;.

You have already answered yourself earlier in this post:.

But it is appreciated from where the confusion may of stemmed, change p.products_availability_name to pav.products_availability_name, you've done well...

Comment #21

Believe me, I've walked away from this and come back the next day mannnnny times over the past couple of weeks..

Still no go....

Now I get this error:.

2000 - Unknown column 'pav.products_id' in 'where clause'.

Select p.products_id, pd.products_name, pav.products_availability_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from products p, products_availability pav, products_description pd where p.products_id = '31' and pd.products_id = p.products_id and pav.products_id = p.products_id and pav.products_id = pd.products_id and pd.language_id = '1'.

[TEP STOP].

So I've still obviously got something wrong. Here's how that 'where' clause looks now:.

       $products_query = tep_db_query("select p.products_id, pd.products_name, pav.products_availability_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, ". TABLE_PRODUCTS_AVAILABILITY ." pav, ". TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pav.products_id = p.products_id and pav.products_id = pd.products_id and pd.language_id = '"(int)$languages_id"'");.

       if ($products = tep_db_fetch_array($products_query)) {.

         $prid = $products['products_id'];.

         $products_price = $products['products_price'];.

(I will be so happy if the day ever comes that I really think I even half understand this stuff... ).

Next suggestion?.

TIA ... again!.

Terry..

Comment #22

Post the the mysql statement from the original contribution for that you are needing, or alternatively just post the columns defined in the products_availability table, I had assumed that this table also had a column called products_id, so that each record could be identified by it; ok so far, mysql is accepting the products_availability_name from the table products_available, so now need to find how to link each particular record to the original products_table, what is the name of the contribution, do you have a link for it?..

Comment #23

The contrib is here:.

Http://www.oscommerc...tributions,1621.

And here's the mysql statement:.

#.

# Table structure for table `products_availability`.

#.

# v v 1.03 2003/11/09.

#.

DROP TABLE IF EXISTS `products_availability`;.

CREATE TABLE `products_availability` (.

 `products_availability_id` int(11) NOT NULL auto_increment,.

 `language_id` int(11) NOT NULL default '1',.

 `products_availability_name` varchar(255) NOT NULL default '',.

 `date_added` datetime default NULL,.

 `last_modified` datetime default NULL,.

 PRIMARY KEY  (`products_availability_id`,`language_id`),.

 KEY `IDX_PRODUCTS_AVAILABILITY_NAME` (`products_availability_name`).

) TYPE=MyISAM AUTO_INCREMENT=14;.

#.

# Dumping data for table `products_availability`.

#.

INSERT INTO `products_availability` VALUES (1, 1, 'Usually ships in 24 hours', now(), NULL);.

INSERT INTO `products_availability` VALUES (4, 1, 'Usually ships in 1-2 business days', now(), NULL);.

INSERT INTO `products_availability` VALUES (5, 1, 'Usually ships in 2-7 business days', now(), NULL);.

INSERT INTO `products_availability` VALUES (6, 1, 'Usually ships in 1 to 2 weeks', now(), NULL);.

INSERT INTO `products_availability` VALUES (7, 1, 'Usually ships in 2 to 3 weeks', now(), NULL);.

INSERT INTO `products_availability` VALUES (8, 1, '<i>Limited Availability.</i> Call for Details.', now(), NULL);.

INSERT INTO `products_availability` VALUES (9, 1, 'This item is not stocked. Call for Availability.', now(), NULL);.

INSERT INTO `products_availability` VALUES (10, 1, 'This item has been discontinued.', now(), NULL);.

INSERT INTO `products_availability` VALUES (11, 1, '<font color="#FF0000">This item is currently <b>SOLD OUT</b></foNT>', now(), NULL);.

INSERT INTO `products_availability` VALUES (12, 1, '<b>Not yet released</b>', now(), NULL);.

INSERT INTO `products_availability` VALUES (13, 1, 'Available for immediate download', now(), NULL);.

ALTER TABLE `products` ADD `products_availability_id` VARCHAR( 255 );.

INSERT INTO `configuration` VALUES ('', 'Product Availability List', 'MAX_DISPLAY_PRODUCTS_AVAILABILITY_IN_A_LIST', '1', 'Used in Product Availability; when the number of Product Availability options exceeds this number, a drop-down list will be displayed instead of the default list', 7, 97, NULL, now(), NULL, NULL);.

INSERT INTO `configuration` VALUES ('', 'Product Availability Select Size', 'MAX_PRODUCTS_AVAILABILITY_LIST', '1', 'Used in Product Availability; when this value is \'1\' the classic drop-down list will be used for Product Availability. Otherwise, a list-box with the specified number of rows will be displayed.', 7, 98, NULL, now(), NULL, NULL);.

INSERT INTO `configuration` VALUES ('', 'Display Product Availability', 'PRODUCT_LIST_PRODUCTS_AVAILABILITY', '1', 'Do you want to display Product Availability?', 8, 99, NULL, now(), NULL, NULL);.

That's what you need?.

Thanks!!!.

Terry..

Comment #24

Do you have a field called products_id in the products_availability table?..

Comment #25

The fields in the products_availability table are:.

Products_availability_id.

Language_id.

Products_availability_name.

Date_added.

Last_modified.

The products_availability_id is also listed in the products table..

It's the products_availability_name that I need to have display in the shopping cart and, when it's finally working there, then I'll start working on carrying it forward to the order page. Hah! Wish me luck!.

Terry..

Comment #26

Remove this from the query.

And pav.products_id = pd.products_id.

You cant match against a field that isnt there..

Comment #27

Ok, had a look at the install/code notes,.

What you need to do is just have:.

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_availability_id, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, ". TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pd.language_id = '"(int)$languages_id"'");.

This will get the products_availability_id from the 'products' table, now translate this id into something textual by querying the 'products_availability' table with:.

$products_availability = $product_info['products_availability_id'];.

$products_availability_info_query = tep_db_query("select e.products_availability_name from "TABLE_PRODUCTS_AVAILABILITY" e where e.products_availability_id = '"(int)$products_availability"' and e.language_id = '"(int)$languages_id"'");.

$products_availability_info = tep_db_fetch_array($products_availability_info_query);.

$products_availability_name = $products_availability_info['products_availability_name'];.

Now insert this info into the shopping_cart class inside the function get_products() for the products_array[]:.

'products_availability' => $products_availability_name,.

This should now be available for use in the catalog/shopping_cart.php file..

You can similarly get this info into the classes/order.php 'cart' function with:.

'products_availability' => $products[$i]['products_availability'],.

This should then allow you to access this info on the checkout_confirm pages...

Comment #28

Working in a roundabout way with the code you supplied, I've finally managed to get the product_availability_id showing in the shopping cart, but all attempts to get it to switch to the product_availability_name return the same (wrong) result all were calling the same text, but not the RIGHT text for any of them. Now it displays at least this:.

Here's what I have now code-wise..

In /catalog/includes/classes/shopping_cart.php:.

$products_array = array();.

Reset($this->contents);.

While (list($products_id, ) = each($this->contents)) {.

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_availability_id, pe.products_availability_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, ". TABLE_PRODUCTS_AVAILABILITY ." pe, ". TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pd.language_id = '"(int)$languages_id"'");.

If ($products = tep_db_fetch_array($products_query)) {.

$prid = $products['products_id'];.

$products_price = $products['products_price'];.

$products_availability = $product_info['products_availability_id'];.

$products_availability_info_query = tep_db_query("select e.products_availability_name from "TABLE_PRODUCTS_AVAILABILITY" e where e.products_availability_id = '"(int)$products_availability"' and e.language_id = '"(int)$languages_id"'");.

$products_availability_info = tep_db_fetch_array($products_availability_info_query);.

$products_availability_name = $products_availability_info['products_availability_id'];.

And in the array:.

'availability' => $products['products_availability_id'],.

Then in /catalog/shopping_cart.php, I have this:.

$products_name .= '<small> '$products[$i]['availability']'</small><br>';.

Now can anyone tell me how to convert the availability ID number to the text? I'm so close ... I hope.....

TIA,.

Terry.

This post has been edited by.

TerryK.

: 05 February 2004, 05:17..

Comment #29

Use this in the first bit of code of the previous post just shown:.

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_availability_id, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from "TABLE_PRODUCTS" p, ". TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"(int)$products_id"' and pd.products_id = p.products_id and pd.language_id = '"(int)$languages_id"'");.

I.e. you don't need to have the products_availability TABLE stuff in the above query, only the p.products_availability_id from the products table..

Now try this in the array instead:.

'availability' => $products_availability_name,.

HTH..

This post has been edited by.

Gregbaboolal.

: 05 February 2004, 05:58..

Comment #30

First, thanks again for all your efforts to help me get this right. I really, really appreciate it. (Just wish I wasn't such a bimbo that I couldn't get it right the first time!).

Okay, so I just tried to change it as shown above, and now the availability id numbers don't show up on the page at all. :-(.

Sigh....

Terry..

Comment #31

I just realized,.

$products_availability_name = $products_availability_info['products_availability_id'];.

Should actually be:.

$products_availability_name = $products_availability_info['products_availability_name'];..

Comment #32


This question was taken from a support group/message board and re-posted here so others can learn from it.