Re: Adding new Qualifiers to
I would trace the field product_is_free in the products table ...
One way to do this is search for the word: free
This will result in a bit more than you need to change but this is a field that has 3 choices and managed as a radio button ...
You could make a new field: products_condition
And everywhere you find this field in the Admin you will see where to add in the new field ...
Then, expand it to include all of your conditions ...
Make a function to translate the value of the condition into text that you could display in the Admin and you could also use to display in the Catalog if need be ...
It is up to you if you want to use this just for tracking your products for identifying the card condition on both sides ...
Looking just for: product_is_free will locate most of where you need this field added, but to assure that there are not spots where a different variable is used, also do the search for: free
Note: the Tools ... Developer's Tool Kit ... is very handy for locating variables, fields, etc. in the php files ...
Re: Adding new Qualifiers to
With you so far -- The "product is free" will be the rarity, correct - The 3 values? Or would it be condition?
So how do we insert the values into the database? We have over 50,000 items and hand inserting them would take some time.
So all this will have the cards condition show up where we'd like...between name and quantity? Thank you.
Re: Adding new Qualifiers to
I picked the field products_is_free because it is a value that uses multiple choices in the admin via radio button ... and might be easier to follow in the code when adding the new field for: adding, editing, copying, etc.
As to how to update all of your Products with the code, you could get tricky on this ...
If you have the card condition in the products_description field ... you could write an update script that looks for that text, providing it is unique, and can update the code that you assign to the new field for the products_condition ...
NOTE: be sure that you have good backups of your database and website before making any of these changes ...
Re: Adding new Qualifiers to
With you so far....
So I'm not computer science person (i know limited php) how does an update script start?
I think the values for condition in the database are NM,PL,PO for the three conditions. They are in the products_Description table, but in their own field (condition).
I'd just adjust it for Rarities as well i'd image once i figure that out.
Sorry, please forgive me, i'm trying to learn php as fast as possible.
Quote:
Originally Posted by Ajeh
I picked the field products_is_free because it is a value that uses multiple choices in the admin via radio button ... and might be easier to follow in the code when adding the new field for: adding, editing, copying, etc.
As to how to update all of your Products with the code, you could get tricky on this ...
If you have the card condition in the products_description field ... you could write an update script that looks for that text, providing it is unique, and can update the code that you assign to the new field for the products_condition ...
NOTE: be sure that you have good backups of your database and website before making any of these changes ...
Re: Adding new Qualifiers to
Stop ... freeze ...
Are you already saying you have these Card Conditions coded and in the database?
If so, why are we even discussing adding them yet again when they can by just displayed from the new field you already have in the products_description table?
What is the new field that you added to that table called?
Any reason that it is in the products_description table, which is a language oriented table, vs the products table which is the Product oriented table ...
Meaning ... did the condition change just because the language does? Or how are you using this field if you are using codes?
Re: Adding new Qualifiers to
Lol.
Yes, the card conditions are already in the database.
Under their own field in a table. Card_conditions in the table ..
Actually all the things we would like to show customers are in that table.
I didn't set up the databases, my webmaster did. And he's not around for a while.
So how do we go about showing those fields (what is the .php file) to show those things on that page between name and quantity? What is the default page to edit and show them? Thank you.
Re: Adding new Qualifiers to
I was wrong.
Card_condition is the field in the table products_Description.
I hope my terminology was correct.
Re: Adding new Qualifiers to
*thud*
I am not sure what your table structure is nor whether you are typing your field names and database table names exactly as they appear or just randomly ...
Card_condition is this really card_condition
And is card_condition sitting in the products_description table?
From what I can see you just need to pull the existing data from the existing field that you already added before this whole thread started and display it in the Admin ...
The data is not in the field products_description ... it is in the table products_description in a field called card_condition where you can look to see how the products_name is pulled from the database table products_description and add the field card_condition to the same select statements and then be able to display that information in the same manner that the products_name is displayed ...
Re: Adding new Qualifiers to
Yes the fields and tables I gave you were correct.
So how does one go about showing this data in the admin?
Table - products_description
column - products_condition
Re: Adding new Qualifiers to
Find the page you want to display the information ...
example: /admin/orders.php
You will see where it calls:
$order->products[$i]['name']
The problem here is that the products_name was added to the orders_products table during the purchase ...
While you could look up this value, this value may no longer be valid if the product gets deleted later ...
The better way would be to add the products_condition to the orders_products table during the checkout ...
This is done in the /includes/classes/order.php
This is where you would want to add the field products_condition also to the orders_products table in your database and have that added in via the orders class when the order is made ...
If you follow the products_name you should be able to see where this happens ...
Then, in the Admin ... you can obtain the products_condition from the orders table in the same manner that the products_name is displayed by adding it to the select statement(s) where it is called so that you can display it on your orders.php, invoice.php and packingslip.php ...