I've been tweaking and adjusting the invoice for well over a week now and I cannot figure out how to remove the model number from the items in the invoice.
Can someone point me to the code to change for this?
Thanks as always!
This is a discussion on Removing products_model from Item page within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; I've been tweaking and adjusting the invoice for well over a week now and I cannot figure out how to ...
I've been tweaking and adjusting the invoice for well over a week now and I cannot figure out how to remove the model number from the items in the invoice.
Can someone point me to the code to change for this?
Thanks as always!
can you please be a bit more specific on what page you are trying to remove the products_model from. For instance, if it's invoice.php or printable_invoice.php or product_info.php?
There are any number of places that the products model is shown to a customer. From the product_info page to order_history.
A simple thing to look for is ['products_model'] and then remove that reference from the output. On the other hand, if you are looking at the orders table references then you will most likely find it referenced as $order->products[$i]['model']
So, it really matters at where you are looking for the reference as to what you should be looking for.
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
I'm referring to the actual email invoice that the buyer and I receive when the order is placed.
As for looking for products_model in the files, products_model appears in twenty eight php files at the moment. order->products[$i]['model'] appears in eight files.
okay.
Now that we know what we are dealing with, the e-mail that is sent when an order completes, that would happen before the order success page... so let's look at checkout_process.php which comes between checkout confirmation and order success.
Look for:
This is where the e-mail confirmation is built...Code:// lets start with the email confirmation
Now we can see the line:
AHA! That is the list of what was ordered.... but where was $products_ordered built?Code:$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
Look back up the file about 3 lines before the comment and you will find...
Look what I found! $order->products[$i]['model']Code:$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
right there between some ()'s
In the future, try to understand the individual steps that the order goes through and it will be obvious where you have to look to find what you want. If it isn't inline in the file that is doing that "function" then see if the file calls any functions or classes and look there.
The process a buyer goes through in the store is VERY linear. Even though the code uses classes and OO, the process of using store is a linear one. Add stuff to cart -> checkout
shipping -> checkout payment -> checkout confirm -> checkout success. e-mail goes out after confirm and before success. Therefore that piece of the process had to take place between those two files. There is ONE hidden php file that happens between those two points, and that is checkout process, the piece that takes all the pre-process information and processes the checkout (checkout success is the display if everything goes right).
So, you didn't have to grep for the strings. Once you know what you want to change and where that action happens in the business process, it's just a matter of understanding the files that make the business process happen to know where to look.
[Paul, I'm not going through this just for you, but for others so that they at least learn from this on HOW to find the file they want to work on, because once you find the file, it's generally easy to figure out what has to be changed.]
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Bookmarks