Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sending data from an "Artist" field to the orders table


WhirlyGirl

Recommended Posts

Posted

I am designing a music store and have added a new field to the products table called products_artist. I seem to be able to display this on the product_info page, but cannot get it to show up in the shopping cart, or more importantly pass it to the orders_products table so it shows up on the invoices.

 

I have tried editing all the checkout files and shopping cart file, but I'm wondering if there is one that I'm missing. I've created an additional field in the orders_products table so the "artist" name has somewhere to go, it's just not getting there.

 

I have spent days on this and I'm getting nowhere! Perhaps there is someone more experienced with php who can point me to the correct file.

 

Thanks very much,

 

WG

Posted

I am working on this very same issue with a music store also... I would love to know how you wrote the code for Artist name to show in product_info page... Here is my notes of correspondence with forum member kind enough to show interest in helping - I offered to pay for this result so if anyone is willing to set terms do not hesitate to message me:

 

Trying to give you as much information here as possible and hopefully not confuse because I think this should be one function to call from many pages... please let me know if I may provide more.
Anytime that a CD Title is show, the Band Name shows also - on any page that is viewed. (Especially from the Products page, but invoice, printable catalog, etc if possible)

Goals is to trace in reverse (maybe?) PRODUCT << PARENT CATEGORY << MAIN CATEGORY. My thought is this to be done by join statment of product id with parent category id (which is the sub-category under main-category)

 

Image of example for product listing where PARENT CATEGORY is actually SUB-CATEGORY of MAIN CATEGORY:

27e4bfdb.gif

 

URL's of sites that do what I want:

 

Examples of showing ARTIST (parent category of product) of album TITLES (product)

Forum References that may help:

Pages I think would be involved:

  • index.php
  • /includes/header.php (if showing sub-category in heading)
  • /includes/boxes/categories.php (//add to or use for showing sub-category/parent catgeory name of a product? maybe function to grab)
  • /includes/boxes/specials.php (//to show sub-category/parent category name in specials?)
  • /includes/boxes/whats_new.php (//to show sub-category/parent category name)
  • /includes/classes/order.php (//to include the sub-category/parent-of-a-product in the order)
  • /includes/functions/database.php ?
  • /includes/functions/general.php (//put grab for parent category true for sub-categories? or use path to category join with sub-category id? use path to products_to_category?)
  • /includes/functions/html_output.php (//session id?)
  • /includes/languages/english/index.php (//$category_depth ?)
  • /includes/languages/english/print_catalog.php (//MOD in use for listing products)
  • /includes/languages/english/prducts_new.php (***)
  • /includes/modules/new_products.php (//show parent category of new products in lists)
  • /includes/modules/print_catalog.php (//MOD to print products)
  • /includes/modules/product_listing.php (// add to $list_box_contents = array(); ?) and switch ($column_list[$col])
  • /includes/modules/upcoming_product.php (// add to $expected_query = tep_db_query ?)

Note:

  • Using breadcrumb to show artist (parent category of product in a sub-category) did not work because found also that breaks when looking up products by manufacture/label

What do you think so fare? ANY suggestions are welcome and I will do my best to follow along. This mod would be amazing for those of us with products under sub-categories that need the sub-category text visible with every mention of the product.

 

Amanda,

 

Would it be possible for you to draw on a piece of paper what you want and then scan it and send it by e-mail, to me? This is called Paper Prototyping and can be very helpful.

 

If possible, with some URLs that better demonstrate what you want, because I couldn't quite follow your notes. It's been awhile since I "tweak" osCommerce, but I'm willing to help you out, if I can. I need to know what's not working for you (at which page under osCommerce) and what would like to change.

 

If it turns out to be a small coding effort, I'll just ask you for your approval in letting the code out for the community. If it's too much of an effort, I can give you some guidance but I don't have much free time in hands.

 

If I can do it, but it requires a good amount of effort, we'll talk about it before anything else.

 

Is this ok?

 

 

 

 

 

I am designing a music store and have added a new field to the products table called products_artist. I seem to be able to display this on the product_info page, but cannot get it to show up in the shopping cart, or more importantly pass it to the orders_products table so it shows up on the invoices.

 

I have tried editing all the checkout files and shopping cart file, but I'm wondering if there is one that I'm missing. I've created an additional field in the orders_products table so the "artist" name has somewhere to go, it's just not getting there.

 

I have spent days on this and I'm getting nowhere! Perhaps there is someone more experienced with php who can point me to the correct file.

 

Thanks very much,

 

WG

Posted

Hi,

 

I have actually managed to get it to show up on the product info page. The problem I am having is sending the artist name to the shopping cart and order table in the database.

 

The changes I made to the product_info.php are as follows:

 

Around line 80 I added

 

p.products_artist,

 

after p.products_price on the product_info query.

 

Then I changed a line around line 160 to:

 

 <p><b><?php echo TEXT_PRODUCTS_ARTIST; ?>: <?php echo $product_info['products_artist']; ?></b><br><br><?php echo nl2br($product_info['products_description']); ?></p>

 

This seemed to work for that page. Hope it helps you with that problem!

 

Does anybody know how to pass an extra field to the orders table?

 

WG

Posted

Is there a file where you define all the arrays? I have been through the files again and again and I still can't figure it out. I would appreciate anybody's help!!

 

Thanks,

 

:blink:

 

WG

Posted

Did you add a field to the product table for this? If so, maybe join statement of how I had seen product_to_category by product_id would apply?... Or would it work for you to add field in 'orders' table? still trying to figure this out myself but maybe this will bump topic enough to get a more conclusive response to your question.

 

 

 

btw the syntax did not match product_info.php - was this meant for product_listing.php page instead? did you change index.php or includes/languages/english/index.php or includes/languages/english/general.php? ugh.. I am so close, but not quite understanding it all.

 

 

 

Hi,

 

I have actually managed to get it to show up on the product info page. The problem I am having is sending the artist name to the shopping cart and order table in the database.

 

The changes I made to the product_info.php are as follows:

 

Around line 80 I added

 

p.products_artist,

 

after p.products_price on the product_info query.

 

Then I changed a line around line 160 to:

 

<p><b><?php echo TEXT_PRODUCTS_ARTIST; ?>: <?php echo $product_info['products_artist']; ?></b><br><br><?php echo nl2br($product_info['products_description']); ?></p>

 

This seemed to work for that page. Hope it helps you with that problem!

 

Does anybody know how to pass an extra field to the orders table?

 

WG

Posted

ok i was in ..//english/product_info.php instead of the main one... though I used a different method, thank you for the response.

 

 

 

I sure hope that someone is able to address your needing the field/table to post Artist in the orders and such because I need this next. :blush:

Posted

Here's what I have done:

 

 

I have added a new field to the products table called products_artist.

 

I have also added a field to the orders table called products_artist.

 

I can't even echo the artist name in the shopping cart at the moment (although I can in product_info.php) so that's probably why it's not sending the info to the databse. I suspect there is a file somewhere that is making each field some kind of array, but I can't seem to find it.

 

Has anybody had success with this? My main concern is that it shows up on the inoice, but in order for that to happen it needs to be written to the field I have created in the orders table.

 

Look forward to your responses,

 

WG

  • 2 months later...
Posted
I can't even echo the artist name in the shopping cart

 

That part was easy for me:

Try adding this to the file called shopping_cart.php

 

<td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['artist'] . ' - ' . $products[$i]['name'] . '</b></a>';

 

Has anyone been able to figure out how to have the artist show up in the orders_products table?

Archived

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

×
×
  • Create New...