Community Add-Ons
Imprint Text Options
for osCommerce Online Merchant v2.2
you can have a lot of text options, to be assigned with product, and
set different options enabled for different products, using checkboxes, when
add/edit product.
so, for example, you sell mugs with imprinting, then you can assign fields
'name' and 'date of birth' to mug_1 product, 'date' and 'phrase' with mug_2, so
customer will fill this fields and it will be stored into db.
ps: BACKUP BEFORE INSTALLING! :)
Hi everyone,
This will display products attributes within order confirmation email sent by oscommerce.
Modification of checkout_process.php is required.
Hi everyone,
This will display products attributes within order confirmation email sent by oscommerce.
Modification of checkout_process.php is required.
This is the fix for the error that appear when you change the product name of an order that was ordered before.
Hi,
there is an error into the code that will appear on customer order if you change the product name of an ordored product.
see my post in the thread here :
http://forums.oscommerce.com/index.php?showtopic=270881&st=0&p=1112795&#entry1112795
is anybody able to fix it
nothing to download just a comment
Please download 1.3.1 version of imprint as this is only the mods not the rest of the files. Shortly I will package it all together and upgrade the version with e-mail support from previous.
Forgot (again :-)) to mention:
Step 1. --------> Open classes/order.php
<-------------FIND THIS:
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
<------------ADD ABOVE:
//CENTRAL50 CHARGE PER CUSTOM
$check_query = tep_db_query("select products_id, customqty from customers_basket_text_attributes_qty where session_id = '" . $osCsid . "' and products_id = '" . $this->products[$index]['id'] . "'"); //also text option
$check = tep_db_fetch_array($check_query);
if ($check['customqty'] > 0) {
$charge = $check['customqty'] * 5; //Change value to whatever you want to charge per custom
$shown_price = $shown_price + $charge;
$this->info['subtotal'] += $charge;
}
//CENTRAL50 CHARGE PER CUSTOM
Make sure you change the value in the above code to what ever you want to charge per customized entry.
Its updated in this package.
Okay everyone, I rewrote the code today. I am going to publish it in a package on the contrib page. I urge everyone (as will be noted on contrib page) to use this new contrib.
For my purposes, I only needed 1 text option per product (name). But yesterday I realized that my mod only allows that. So if you installed it, and you used more then one text per name (name, color) it would not work.
So I re-wrote it, shortened up some of the queries, etc. I would like to clean up the code a little more, but for now it works and I wanted people to download the new one not the old one before I went on vacation.
I also took out the check box option. Again, after realizing the people have more then one text option on a product page, it would look redundant. Now the system will recognize if there is text entered into that specific field or not. It will then run the rest of the system accordingly.
Please note for the other contrib, the charge per custom field contrib I wrote, that will be updated as well. You should note this:
You have a product page with two fields on it: Name, Color
----A customer buys that product with both fields filled out.
The system will charge that customer for 1 Custom entry. Not two. Charging for every entry in one qty would not make sense.
Same goes for if the custom adds two of those products to their shopping cart, the first one has only the Name field entered and the second one has the Color field entered. The system will charge them for two customizations.
Understand? I want to make that as simple as possible.
It would not make sense if you had color, name, age, size, etc. on each product page and charged for each one. If you want to do that, let me know, and I will see if I have time to rewrite the code to do so.
Other wise, like I said:
1. Customer buys product (1 qty) with two fields(name,color) filled out.
---System charges the customer for one customization.
OR
2. Customer buys more then 1 of the same product (xx qty) and fills out the two fields(name,color) for each qty differently - Example:
product = bottle
[b]Name | color[/b] (fields)
Jon | blue
mind | (blank)
over | (blank)
(blank | matter
Now thats the qty of 4 for the same product (bottle). The system will charge them for 4 customs. Not 8, that would not be right.
And so on for every other product in their shopping cart.
Okay, I will release the new contribs a little later.
Now to install:
What does this do? Well, there has been a lot of talk about how its dumb why a customer can't add the same product with another field.
What this does is add the second customized entry to the same column in the database, but puts a seperator of "|---|" in between the multiple entries.
You can change it to what ever you want, but do remember that there is two instances of this in this code, and they must both match for it to work.
I also added a check box on the product_info.php page where the customer selects whether they want to customize or not. This will stop the mod from
adding an empty value in. Of coarse I could rework it to see if its empty to just not insert it, but I am tied up enough to even write this mod for
everyone.
Another feature is that it now adds a numeric value (new column in database) per customized field. Even if the customer gets 3 of the same product,
and two of those have customized fields tied with it, the value will be shown as 2. This is more primarly for the other contrib I released, where
you can now charge per customized entry (it uses this value).
I would seperate it for this contrib, but tell you the truth I dont have the time to do so.
USE AT YOUR OWN RISK. AND ALWAYS BACK UP BACK UP BACK UP
I am always still learning in coding, so anyone who has even better knowledge could clean it up if they want.
This does what its supposed to do for me and thats all I need.
----This is the complete package. New directions and new code. This comes with two text files for using More Entries, and Charge which requires More Entries.
Its complete, with the missing code and everything now in here. Enjoy
Woops, forgot to mention to change the value of what you want to charge. Fixed it, same package as below with the added note.
What does this do? Well when a customer adds a customized field to your product, it will add the fee with it in their checkout.
<-------THIS REQURIES THE "MORE ENTRIES" MOD that I released. It works off of that, so you need to install it.--------->
If they bought more then 1 of the same product, and has multiple customized names, this will still calc how many customized fields there is,
and give the charge.
USE AT YOUR OWN RISK. AND ALWAYS BACK UP BACK UP BACK UP
I am always still learning in coding, so anyone who has even better knowledge could clean it up if they want.
This does what its supposed to do for me and thats all I need.
What does this do? Well, there has been a lot of talk about how its dumb why a customer can't add the same product with another field.
What this does is add the second customized entry to the same column in the database, but puts a separator of "|---|" in between the multiple entries.
You can change it to what ever you want, but do remember that there is two instances of this in this code, and they must both match for it to work.
I also added a check box on the product_info.php page where the customer selects whether they want to customize or not. This will stop the mod from
adding an empty value in. Of coarse I could rework it to see if its empty to just not insert it, but I am tied up enough to even write this mod for
everyone.
Another feature is that it now adds a numeric value (new column in database) per customized field. Even if the customer gets 3 of the same product,
and two of those have customized fields tied with it, the value will be shown as 2. This is more primarily for the other contrib I released, where
you can now charge per customized entry (it uses this value).
I would separate it for this contrib, but tell you the truth I don't have the time to do so.
USE AT YOUR OWN RISK. AND ALWAYS BACK UP BACK UP BACK UP
I am always still learning in coding, so anyone who has even better knowledge could clean it up if they want.
This does what its supposed to do for me and thats all I need.
This package comes with the install text, not the full package of the whole contrib.
This is much requested, so therefore i post this here. I use the contribution Email invoice 1.0 and used the new template file: box_invoice.php
Great contribution but the attributes weren't included into the packing slip and invoice. This package includes both files edited. Replace and enjoy!
*This file is an add-on to the original Imprint Text Options. Please download the original file first.
Updated /admin/orders.php to correctly return apostrophes in product names without throwing an error.
Added update instructions below to install.txt
Added screenshot
Great contrib. Thanks to Denuz for writing it and FalseDawn for the education in tep_db_input.
Enjoy!
In the admin/orders.php file. There is a critical syntax error.
Just add this section instead of the one in the file.
Have also updated the attached package as well.
// denuz text attr
$pid = @mysql_result(tep_db_query("select products_id from products_description where products_name='" . $order->products[$i]['name'] . "'"), 0, "products_id");
$attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['oID'] . " and ota.products_id = ' . $pid . ' and pta.products_text_attributes_id = ota.products_text_attributes_id");
while ($attr = tep_db_fetch_array($attr_q)) {
echo '<br><nobr><small> <i> - ' . $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text']);
echo '</i></small></nobr>';
}
// eof denuz text attr
2 small fixes:
- add the line below to admin/includes/filenames.php
define('FILENAME_TEXT_ATTRIBUTES', 'text_attributes.php');
- add the line below to admin/includes/languages/english.php
define('TEXT_DISPLAY_NUMBER_OF_TEXT_ATTRIBUTES', 'Text Attributes Total: ');
that's it.
- fixed problems when osc attributes also submitted to product
- added table definition
support forum: http://forums.oscommerce.com/index.php?showtopic=147933
sorry, i forgot lang translation file.
full package
- fixed bug when delete product from shopping cart
- added web interface for adding new attributes
previous archive was broken, posted again.
you can have a lot of text options, to be assigned with product, and
set different options enabled for different products, using checkboxes, when
add/edit product.
so, for example, you sell mugs with imprinting, then you can assign fields
'name' and 'date of birth' to mug_1 product, 'date' and 'phrase' with mug_2, so
customer will fill this fields and it will be stored into db.
ps: BACKUP BEFORE INSTALLING! :)
