Jump to content

Manual Field Update


Mike

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

Link to comment
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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...