Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

add model to products_new.php


reformedman

Recommended Posts

How do I add the "model" to the products_new.php page?

 

This is what I tried:

<tr>

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a>

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' . $products_model['products_model'] . '

<br><b>' . TEXT_MANUFACTURER . '</b> ' . $products_new['manufacturers_name'] . '

<br><b>' . TEXT_PRICE . '</b> ' . $products_price; ?></td>

<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>

</tr>

<tr>

<td colspüan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

 

I also tried:

<br><b>' . TEXT_MODEL . '</b> ' . $products_model['products_model'] . '

 

But they don't work, the output comes out looking like this:

 

Studies on Revelations

TEXT_PRODUCT_MODEL

editorial: Editorial Peregrino

Precio: $13.50

man of a reformed faith.

Link to comment
Share on other sites

You can't display it if it's not retrieved in the MYSQL query.

 

I don't use the model so I can't test this, but I'm thinking if you added:

 

p.products_model

 

To the query it would then be available via: $products_new['products_model']

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

You can't display it if it's not retrieved in the MYSQL query.

 

I don't use the model so I can't test this, but I'm thinking if you added:

 

p.products_model

 

To the query it would then be available via: $products_new['products_model']

 

Hi Germ,

I didn't understand most of what you said but am willing to make this work.

As far as the MySQL thing, do I need to access PHPMYADMIN?

 

where do i add p.products_model? in the mysql thing?

 

I'll add the $products_new['products_model'] to the products_new.php page because I'm pretty sure that's where you mean it should go.

It'll be done in less than 5 minutes.

 

Please respond, I'd like to make this work if possible and will greatly appreciate your help.

man of a reformed faith.

Link to comment
Share on other sites

On that page , my query looks like this:

 

  $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

Adding it would then be as simple as:

 

  $products_new_query_raw = "select p.products_id, pd.products_name, [color="#FF0000"][b]p.products_model,[/b][/color] p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

I'm not very literate with MYSQL but I think that would work.

 

If you backup the file first so you can replace it if it doesn't you haven't got anything to lose.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I added that p.product etc.. where you told me to add it perfectly.

It still looks the same.

 

what is it that i have to do with MYSQL?

Should I access the database through cpanel, or did you mean that the line that I added to products_new.php was the mysql work that you mentioned?

man of a reformed faith.

Link to comment
Share on other sites

Post just the code you have on the page that you're using to try to display the model.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

<tr>

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a>

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' . $products_model['products_model'] . '

<br><b>' . TEXT_MANUFACTURER . '</b> ' . $products_new['manufacturers_name'] . '

<br><b>' . TEXT_PRICE . '</b> ' . $products_price; ?>

</td>

<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>

</tr>

<tr>

<td colspüan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

 

 

 

 

 

Did you mean just this portion or the whole page?

man of a reformed faith.

Link to comment
Share on other sites

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' . $products_model['products_model'] . '

Should be:

 

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' .  $products_new['products_model'] . '

You also need to have TEXT_PRODUCT_MODEL defined somewhere.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' . $products_model['products_model'] . '

Should be:

 

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' .  $products_new['products_model'] . '

You also need to have TEXT_PRODUCT_MODEL defined somewhere.

 

 

almost there.

you have gotten farther than i have so far.

I defined the author over at the products_new.php under the languages spanish file.

man of a reformed faith.

Link to comment
Share on other sites

So, are you "good to go" now?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

no

 

this is still wrong:

<br><b>' . TEXT_PRODUCT_MODEL . '</b> ' . $products_new['products_model'] . '

 

so i changed it to

<br><b>' . TEXT_PRODUCTS_MODEL . '</b> ' . $products_new['products_model'] . '

 

because thats the definition in the languages products_new.php

 

after doing that, all fixed.

 

A million thanks to you Jim, you've always been great help here.

Thanks

 

 

btw anyway to edit the url from post #5? maybe put some asterisks on it a little bit?

man of a reformed faith.

Link to comment
Share on other sites

If you can't edit it now it's too late.

 

You'd have to get a moderator (Jan Zongee) to do it for you.

 

I think you only have 15 minutes after you post something to change it yourself.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...