Jump to content
Sign in to follow this  
Mike

Manual Field Update

Recommended Posts

I wonder if someone could help me with this issue.

I have imported a list of products into the Product/inventory.

All imported perfectly. But the condition field was blank and I wanted it to have the word 'New' in it.

As I had already imported the products I went into SQL and UPDATED the table Inventory and the field condition with the work 'New' for all products.

This worked fine but when viewing the site product normally it still doesn't show the word new against the field condition.

The only way to get it to show the work 'New' in the displayed condition field is to go into each product and then same it through Admin.

Does anyone know a way of resolving this issue?

Regards

Mike

Share this post


Link to post
Share on other sites

Part of the code to fetch and process data concerning the properties of a product is the following:

In /classes/catalogue.class.php, function displayProduct():

$product['condition'] = $GLOBALS['language']->common[$product['condition']];

The $GLOBALS['language'] is a class that manages the language strings. It has a magic getter that, for the statement above, will get the language phrase for the given key in the common group.

The three related language strings are:

<group name="common">
  <string name="new" introduced="6.0.0"><![CDATA[New]]></string>
  <string name="used" introduced="6.0.0"><![CDATA[Used]]></string>
  <string name="refurbished" introduced="6.0.0"><![CDATA[Refurbished]]></string>

Please note the keys (the name attribute) are case-sensitive.

The statement above will look for the common/new key in the language pack being used, and then show the appropriate phrase for that language.

Thus, when you UPDATEd the database to "New", this was not correct as that string could not be found as a language key. However, "new" is the correct string.

Share this post


Link to post
Share on other sites

Thank you very much for your reply.

I have UPDATED the condition field again replacing 'New' with 'new' and it is now displaying them.

Thank you for your help.

Regards

Mike

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×